cmd: env: select: Add output for available environment targets
v4 cover cmd: env: select: Add output for available environment targets
Add the "-l" parameter to the "env select" command to print the available environment targets, convert all argument parsing in the file nvedit.c to getopt() and check that with unit tests.
The first patch converts the parsing of arguments to getopt() for all env commands. The second one adds unit tests for checking the env command. These were used to check the env commands before and after the conversion. The third patch adds the actual new parameter "-l" for the "env select" command.
Christoph Niedermaier (3):
cmd: nvedit: Convert the parsing of arguments to getopt()
test: cmd: nvedit: Add basic unit tests
cmd: env: select: Add output for available environment targets
cmd/nvedit.c | 353 +++++++++--------- env/Kconfig | 1 + env/env.c | 16 + include/env.h | 7 + test/cmd/Makefile | 1 + test/cmd/nvedit.c | 891 ++++++++++++++++++++++++++++++++++++++++++++++ test/cmd_ut.c | 2 + 7 files changed, 1098 insertions(+), 173 deletions(-) create mode 100644 test/cmd/nvedit.c
---
Cc: Andy Shevchenko <[email protected]>
Cc: Christian Marangi <[email protected]>
Cc: Heinrich Schuchardt <[email protected]>
Cc: Ilias Apalodimas <[email protected]>
Cc: Jerome Forissier <[email protected]>
Cc: Joe Hershberger <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Venkatesh Yadav Abbarapu <[email protected]>
Signature · 1 line
2.30.2
PATCH v4 1/3 cmd: nvedit: Convert the parsing of arguments to getopt()
The entire parsing of the arguments is done manually. Improve this by converting all parsing of arguments to getopt().
---
Cc: Andy Shevchenko <[email protected]>
Cc: Christian Marangi <[email protected]>
Cc: Heinrich Schuchardt <[email protected]>
Cc: Ilias Apalodimas <[email protected]>
Cc: Jerome Forissier <[email protected]>
Cc: Joe Hershberger <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Venkatesh Yadav Abbarapu <[email protected]>
---
V3: - Add this patch to the series
V4: - No changes
--- cmd/nvedit.c | 335 +++++++++++++++++++++++++-------------------------- env/Kconfig | 1 + 2 files changed, 164 insertions(+), 172 deletions(-)
cmd/nvedit.c +163 -172
@@ -41,6 +41,7 @@#include <linux/stddef.h> #include <asm/byteorder.h> #include <asm/io.h> +#include <getopt.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -92,19 +93,26 @@ static int do_env_print(struct cmd_tbl *cmdtp, int flag, int argc,int i;int rcode =0 ;int env_flag =H_HIDE_DOT ; +struct getopt_state gs; +int opt; +getopt_init_state (&gs); +while ((opt =getopt (&gs, argc, argv,"ea" )) >0 ) { +switch (opt) { +case 'e' :#if defined(CONFIG_CMD_NVEDIT_EFI ) -if (argc >1 && argv[1 ][0 ] =='-' && argv[1 ][1 ] =='e' ) -return do_env_print_efi (cmdtp, flag, --argc, ++argv); +return do_env_print_efi (cmdtp, flag, argc - gs.index, &argv[gs.index]);#endif - -if (argc >1 && argv[1 ][0 ] =='-' && argv[1 ][1 ] =='a' ) { - argc--; - argv++; - env_flag &= ~H_HIDE_DOT ; +break ; +case 'a' : + env_flag &= ~H_HIDE_DOT ; +break ; +default : +return CMD_RET_USAGE ; + } } -if (argc ==1 ) { +if (gs.index == argc) {/* print all env vars */ rcode =env_print (NULL , env_flag);if (!rcode)
@@ -116,7 +124,7 @@ static int do_env_print(struct cmd_tbl *cmdtp, int flag, int argc,/* print selected env vars */ env_flag &= ~H_HIDE_DOT ; -for (i =1 ; i < argc; ++i) { +for (i = gs.index; i < argc; ++i) {int rc =env_print (argv[i], env_flag);if (!rc) {printf ("## Error: \"%s\" not defined\n" , argv[i]);
@@ -133,6 +141,8 @@ static int do_env_grep(struct cmd_tbl *cmdtp, int flag, {char *res =NULL ;int len, grep_how, grep_what; +struct getopt_state gs; +int opt;if (argc <2 )return CMD_RET_USAGE ;
@@ -140,36 +150,31 @@ static int do_env_grep(struct cmd_tbl *cmdtp, int flag, grep_how =H_MATCH_SUBSTR ;/* default: substring search */ grep_what =H_MATCH_BOTH ;/* default: grep names and values */ -while (--argc >0 && **++argv =='-' ) { -char *arg = *argv; -while (*++arg) { -switch (*arg) { +getopt_init_state (&gs); +while ((opt =getopt (&gs, argc, argv,"envb" )) >0 ) { +switch (opt) {#ifdef CONFIG_REGEX -case 'e' :/* use regex matching */ - grep_how =H_MATCH_REGEX ; -break ; +case 'e' :/* use regex matching */ + grep_how =H_MATCH_REGEX ; +break ;#endif -case 'n' :/* grep for name */ - grep_what =H_MATCH_KEY ; -break ; -case 'v' :/* grep for value */ - grep_what =H_MATCH_DATA ; -break ; -case 'b' :/* grep for both */ - grep_what =H_MATCH_BOTH ; -break ; -case '-' : - goto DONE; -default : -return CMD_RET_USAGE ; - } +case 'n' :/* grep for name */ + grep_what =H_MATCH_KEY ; +break ; +case 'v' :/* grep for value */ + grep_what =H_MATCH_DATA ; +break ; +case 'b' :/* grep for both */ + grep_what =H_MATCH_BOTH ; +break ; +default : +return CMD_RET_USAGE ; } } -DONE: len =hexport_r (&env_htab,'\n' , flag | grep_what | grep_how, - &res,0 , argc, argv); + &res,0 , argc - gs.index, &argv[gs.index]);if (len >0 ) {puts (res);
@@ -510,37 +515,34 @@ static int do_env_default(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { int all = 0, env_flag = H_INTERACTIVE; - -debug ("Initial value for argc=%d\n" , argc); -while (--argc >0 && **++argv =='-' ) { -char *arg = *argv; - -while (*++arg) { -switch (*arg) { -case 'a' :/* default all */ - all =1 ; -break ; -case 'f' :/* force */ - env_flag |=H_FORCE ; -break ; -case 'k' : - env_flag |=H_NOCLEAR ; -break ; -default : -return cmd_usage (cmdtp); - } +struct getopt_state gs; +int opt; + +getopt_init_state (&gs); +while ((opt =getopt (&gs, argc, argv,"afk" )) >0 ) { +switch (opt) { +case 'a' :/* default all */ + all =1 ; +break ; +case 'f' :/* force */ + env_flag |=H_FORCE ; +break ; +case 'k' : + env_flag |=H_NOCLEAR ; +break ; +default : +return cmd_usage (cmdtp); } } -debug ("Final value for argc=%d\n" , argc); -if (all && (argc ==0 )) { +if (all && (argc == gs.index)) {/* Reset the whole environment */ env_set_default ("## Resetting to default environment\n" , env_flag);return 0 ; } -if (!all && (argc >0 )) { +if (!all && (argc > gs.index)) {/* Reset individual variables */ -env_set_default_vars (argc, argv, env_flag); +env_set_default_vars (argc - gs.index, &argv[gs.index], env_flag);return 0 ; }
@@ -552,32 +554,26 @@ static int do_env_delete(struct cmd_tbl *cmdtp, int flag, {int env_flag =H_INTERACTIVE ;int ret =0 ; +struct getopt_state gs; +int opt; +int i; -debug ("Initial value for argc=%d\n" , argc); -while (argc >1 && **(argv +1 ) =='-' ) { -char *arg = *++argv; - - --argc; -while (*++arg) { -switch (*arg) { -case 'f' :/* force */ - env_flag |=H_FORCE ; -break ; -default : -return CMD_RET_USAGE ; - } +getopt_init_state (&gs); +while ((opt =getopt (&gs, argc, argv,"f" )) >0 ) { +switch (opt) { +case 'f' :/* force */ + env_flag |=H_FORCE ; +break ; +default : +return CMD_RET_USAGE ; } } -debug ("Final value for argc=%d\n" , argc);env_inc_id (); -while (--argc >0 ) { -char *name = *++argv; - -if (hdelete_r (name, &env_htab, env_flag)) +for (i = gs.index; i < argc; i++) +if (hdelete_r (argv[i], &env_htab, env_flag)) ret =1 ; - }return ret; }
@@ -633,64 +629,58 @@ static int do_env_export(struct cmd_tbl *cmdtp, int flag, {char buf[32 ];ulong addr; -char *ptr, *cmd, *res; +char *ptr, *res;size_t size =0 ;ssize_t len;env_t *envp;char sep ='\n' ;int chk =0 ;int fmt =0 ; - - cmd = *argv; - -while (--argc >0 && **++argv =='-' ) { -char *arg = *argv; -while (*++arg) { -switch (*arg) { -case 'b' :/* raw binary format */ -if (fmt++) - goto sep_err; - sep ='\0' ; -break ; -case 'c' :/* external checksum format */ -if (fmt++) - goto sep_err; - sep ='\0' ; - chk =1 ; -break ; -case 's' :/* size given */ -if (--argc <=0 ) -return cmd_usage (cmdtp); - size =hextoul (*++argv,NULL ); - goto NXTARG; -case 't' :/* text format */ -if (fmt++) - goto sep_err; - sep ='\n' ; -break ; -default : -return CMD_RET_USAGE ; - } +struct getopt_state gs; +int opt; + +getopt_init_state (&gs); +while ((opt =getopt (&gs, argc, argv,"bcs:t" )) >0 ) { +switch (opt) { +case 'b' :/* raw binary format */ +if (fmt++) + goto sep_err; + sep ='\0' ; +break ; +case 'c' :/* external checksum format */ +if (fmt++) + goto sep_err; + sep ='\0' ; + chk =1 ; +break ; +case 's' :/* size given */ + size =hextoul (gs.arg,NULL ); +break ; +case 't' :/* text format */ +if (fmt++) + goto sep_err; + sep ='\n' ; +break ; +default : +return CMD_RET_USAGE ; } -NXTARG: ; } -if (argc <1 ) +if (argc == gs.index)return CMD_RET_USAGE ; - addr =hextoul (argv[0 ],NULL ); + addr =hextoul (argv[gs.index],NULL ); ptr =map_sysmem (addr, size); + gs.index++; +if (size)memset (ptr,'\0' , size); - argc--; - argv++; -if (sep) {/* export as text file */ len =hexport_r (&env_htab, sep,H_MATCH_KEY |H_MATCH_IDENT , - &ptr, size, argc, argv); + &ptr, size, argc - gs.index, &argv[gs.index]);if (len <0 ) {pr_err ("## Error: Cannot export environment: errno = %d\n" , errno);
@@ -711,7 +701,7 @@ NXTARG: ; len =hexport_r (&env_htab,'\0' ,H_MATCH_KEY |H_MATCH_IDENT , - &res,ENV_SIZE , argc, argv); + &res,ENV_SIZE , argc - gs.index, &argv[gs.index]);if (len <0 ) {pr_err ("## Error: Cannot export environment: errno = %d\n" , errno);
@@ -731,7 +721,7 @@ NXTARG: ; sep_err:printf ("## Error: %s: only one of \"-b\", \"-c\" or \"-t\" allowed\n" , - cmd); + argv[0 ]); return 1; }#endif
@@ -765,7 +755,7 @@ static int do_env_import(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { ulong addr; -char *cmd, *ptr; +char *ptr;char sep ='\n' ;int chk =0 ;int fmt =0 ;
@@ -773,42 +763,40 @@ static int do_env_import(struct cmd_tbl *cmdtp, int flag,int crlf_is_lf =0 ;int wl =0 ;size_t size; - - cmd = *argv; - -while (--argc >0 && **++argv =='-' ) { -char *arg = *argv; -while (*++arg) { -switch (*arg) { -case 'b' :/* raw binary format */ -if (fmt++) - goto sep_err; - sep ='\0' ; -break ; -case 'c' :/* external checksum format */ -if (fmt++) - goto sep_err; - sep ='\0' ; - chk =1 ; -break ; -case 't' :/* text format */ -if (fmt++) - goto sep_err; - sep ='\n' ; -break ; -case 'r' :/* handle CRLF like LF */ - crlf_is_lf =1 ; -break ; -case 'd' : - del =1 ; -break ; -default : -return CMD_RET_USAGE ; - } +struct getopt_state gs; +int opt; + +getopt_init_state (&gs); +while ((opt =getopt (&gs, argc, argv,"bctrd" )) >0 ) { +switch (opt) { +case 'b' :/* raw binary format */ +if (fmt++) + goto sep_err; + sep ='\0' ; +break ; +case 'c' :/* external checksum format */ +if (fmt++) + goto sep_err; + sep ='\0' ; + chk =1 ; +break ; +case 't' :/* text format */ +if (fmt++) + goto sep_err; + sep ='\n' ; +break ; +case 'r' :/* handle CRLF like LF */ + crlf_is_lf =1 ; +break ; +case 'd' : + del =1 ; +break ; +default : +return CMD_RET_USAGE ; } } -if (argc <1 ) +if (argc == gs.index)return CMD_RET_USAGE ;if (!fmt)
@@ -817,11 +805,13 @@ static int do_env_import(struct cmd_tbl *cmdtp, int flag,if (sep !='\n' && crlf_is_lf ) crlf_is_lf =0 ; - addr =hextoul (argv[0 ],NULL ); + addr =hextoul (argv[gs.index],NULL ); ptr =map_sysmem (addr,0 ); -if (argc >=2 &&strcmp (argv[1 ],"-" )) { - size =hextoul (argv[1 ],NULL ); + gs.index++; + +if (argc - gs.index >=1 &&strcmp (argv[gs.index],"-" )) { + size =hextoul (argv[gs.index],NULL ); }else if (chk) {puts ("## Error: external checksum format must pass size\n" );return CMD_RET_FAILURE ;
@@ -844,7 +834,7 @@ static int do_env_import(struct cmd_tbl *cmdtp, int flag,printf ("## Info: input data size = %zu = 0x%zX\n" , size, size); } -if (argc >2 ) +if (argc - gs.index >1 ) wl =1 ;if (chk) {
@@ -866,8 +856,10 @@ static int do_env_import(struct cmd_tbl *cmdtp, int flag, ptr = (char *)ep->data; } + gs.index++; +if (!himport_r (&env_htab, ptr, size, sep, del ?0 :H_NOCLEAR , - crlf_is_lf, wl ? argc -2 :0 , wl ? &argv[2 ] :NULL )) { + crlf_is_lf, wl ? argc - gs.index :0 , wl ? &argv[gs.index] :NULL )) {pr_err ("## Error: Environment import failed: errno = %d\n" , errno);return 1 ;
@@ -878,7 +870,7 @@ static int do_env_import(struct cmd_tbl *cmdtp, int flag, sep_err:printf ("## %s: only one of \"-b\", \"-c\" or \"-t\" allowed\n" , - cmd); + argv[0 ]); return 1; }#endif
@@ -971,6 +963,8 @@ static int do_env_info(struct cmd_tbl *cmdtp, int flag,int eval_flags =0 ;int eval_results =0 ;bool quiet = false; +struct getopt_state gs; +int opt;#if defined(CONFIG_CMD_SAVEENV ) && !IS_ENABLED (CONFIG_ENV_IS_DEFAULT )enum env_location loc;#endif
@@ -980,23 +974,20 @@ static int do_env_info(struct cmd_tbl *cmdtp, int flag,return print_env_info ();/* process options */ -while (--argc >0 && **++argv =='-' ) { -char *arg = *argv; - -while (*++arg) { -switch (*arg) { -case 'd' : - eval_flags |=ENV_INFO_IS_DEFAULT ; -break ; -case 'p' : - eval_flags |=ENV_INFO_IS_PERSISTED ; -break ; -case 'q' : - quiet = true; -break ; -default : -return CMD_RET_USAGE ; - } +getopt_init_state (&gs); +while ((opt =getopt (&gs, argc, argv,"dpq" )) >0 ) { +switch (opt) { +case 'd' : + eval_flags |=ENV_INFO_IS_DEFAULT ; +break ; +case 'p' : + eval_flags |=ENV_INFO_IS_PERSISTED ; +break ; +case 'q' : + quiet = true; +break ; +default : +return CMD_RET_USAGE ; } }
env/Kconfig +1 -0
@@ -2,6 +2,7 @@ menu "Environment" config ENV_SUPPORT def_bool y + select GETOPT config ENV_SOURCE_FILE string "Environment file to use"
Signature · 1 line
2.30.2
PATCH v4 2/3 test: cmd: nvedit: Add basic unit tests
In reply to Christoph NiedermaierAdd basic unit tests for argument checking of the env command.
---
Cc: Andy Shevchenko <[email protected]>
Cc: Christian Marangi <[email protected]>
Cc: Heinrich Schuchardt <[email protected]>
Cc: Ilias Apalodimas <[email protected]>
Cc: Jerome Forissier <[email protected]>
Cc: Joe Hershberger <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Venkatesh Yadav Abbarapu <[email protected]>
---
V3: - Add this patch to the series
V4: - Replace offsetof calculated size with a fixed size
- Remove "env delete stdout" due to reproducibility problems
- Cover also systems without redundant environment
- Add comments to import examples
- Write the import examples for each test into memory
--- test/cmd/Makefile | 1 + test/cmd/nvedit.c | 891 ++++++++++++++++++++++++++++++++++++++++++++++ test/cmd_ut.c | 2 + 3 files changed, 894 insertions(+) create mode 100644 test/cmd/nvedit.c
test/cmd/Makefile +1 -0
@@ -23,6 +23,7 @@ obj-$(CONFIG_CMD_LOADM) += loadm.o obj-$(CONFIG_CMD_MEMINFO) += meminfo.o obj-$(CONFIG_CMD_MEMORY) += mem_copy.o obj-$(CONFIG_CMD_MEM_SEARCH) += mem_search.o +obj-$(CONFIG_ENV_SUPPORT) += nvedit.o ifdef CONFIG_CMD_PCI obj-$(CONFIG_CMD_PCI_MPS) += pci_mps.o endif
test/cmd/nvedit.c new file +891 -0
891 lines not on this page · raw message
test/cmd_ut.c +2 -0
@@ -67,6 +67,7 @@ SUITE_DECL(log);SUITE_DECL (mbr);SUITE_DECL (measurement);SUITE_DECL (mem); +SUITE_DECL (nvedit);SUITE_DECL (optee);SUITE_DECL (pci_mps);SUITE_DECL (seama);
@@ -94,6 +95,7 @@ static struct suite suites[] = {SUITE (mbr,"mbr command" ),SUITE (measurement,"TPM-based measured boot" ),SUITE (mem,"memory-related commands" ), +SUITE (nvedit,"env command" ),SUITE (optee,"OP-TEE" ),SUITE (pci_mps,"PCI Express Maximum Payload Size" ), SUITE(seama, "seama command parameters loading and decoding"),
Signature · 1 line
2.30.2
PATCH v4 3/3 cmd: env: select: Add output for available environment targets
In reply to Christoph NiedermaierAdd parameter "-l" for printing available environment targets. The active target is marked with an asterisk. This is done by adding the function env_select_print_list().
If "env select" is called without a target parameter the result is "Select Environment on <NULL>: driver not found". Replace this not so useful output by showing the env usage message instead.
---
Cc: Andy Shevchenko <[email protected]>
Cc: Christian Marangi <[email protected]>
Cc: Heinrich Schuchardt <[email protected]>
Cc: Ilias Apalodimas <[email protected]>
Cc: Jerome Forissier <[email protected]>
Cc: Joe Hershberger <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Venkatesh Yadav Abbarapu <[email protected]>
---
V2: - Showing available environment targets by parameter "-l"
- Showing env usage message if env select is called without a target
V3: - Convert the parsing of arguments to getopt()
V4: - No changes
--- cmd/nvedit.c | 18 +++++++++++++++++- env/env.c | 16 ++++++++++++++++ include/env.h | 7 +++++++ 3 files changed, 40 insertions(+), 1 deletion(-)
cmd/nvedit.c +17 -1
@@ -504,6 +504,22 @@ static int do_env_load(struct cmd_tbl *cmdtp, int flag, int argc,static int do_env_select (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) { +struct getopt_state gs; +int opt; + +if (!argv[1 ]) +return CMD_RET_USAGE ; + +getopt_init_state (&gs); +while ((opt =getopt (&gs, argc, argv,"l" )) >0 ) { +switch (opt) { +case 'l' :/* list */ +return env_select_print_list () ?1 :0 ; +default : +return CMD_RET_USAGE ; + } + } +return env_select (argv[1 ]) ?1 :0 ; }#endif
@@ -1180,7 +1196,7 @@ U_BOOT_LONGHELP(env, "env load - load environment\n"#endif #if defined(CONFIG_CMD_NVEDIT_SELECT ) - "env select [target] - select environment target\n" + "env select [-l] [target] - list/select environment target(s)\n"#endif #if defined(CONFIG_CMD_NVEDIT_EFI )"env set -e [-nv][-bs][-rt][-at][-a][-i addr:size][-v] name [arg ...]\n"
env/env.c +16 -0
@@ -350,6 +350,22 @@ int env_init(void)return ret; } +int env_select_print_list (void ) +{ +struct env_driver *drv; +int prio; + +printf ("Available Environment targets:\n" ); +for (prio =0 ; (drv =env_driver_lookup (ENVOP_INIT , prio)); prio++) { +if (gd->env_load_prio == prio) +printf ("* " ); +else +printf (" " ); +printf ("%s\n" , drv->name); + } +return 0 ; +} +int env_select (const char *name) {struct env_driver *drv;
include/env.h +7 -0
@@ -286,6 +286,13 @@ int env_save(void);*/ int env_erase (void ); +/** +* env_select_print_list() - Print available environment targets +* +* Return: 0 if OK, -ve on error +*/ +int env_select_print_list (void ); +/** * env_select() - Select the environment storage *
Signature · 1 line
2.30.2
Quoted 10 lines · Christoph Niedermaier
Add the "-l" parameter to the "env select" command to print the available environment targets, convert all argument parsing in the file
nvedit.ctogetopt()and check that with unit tests.The first patch converts the parsing of arguments to
getopt()for all env commands. The second one adds unit tests for checking the env command. These were used to check the env commands before and after the conversion. The third patch adds the actual new parameter "-l" for the "env select" command.
Quoted 4 lines
Christoph Niedermaier (3):
cmd: nvedit: Convert the parsing of arguments togetopt()
test: cmd: nvedit: Add basic unit tests
cmd: env: select: Add output for available environment targets
Can you please make a v5 that's run through CI? I saw that am64x_evm_a53 fails to build now and I'm seeing the tests fail too:
https://source.denx.de/u-boot/u-boot/-/jobs/1196652
Thanks!
Signature · 1 line
Tom
From: Tom Rini <[email protected]>
Sent: Thursday, July 10, 2025 3:58 AM
Quoted 14 lines
Subject: Re: [PATCH V4 0/3] cmd: env: select: Add output for available environment targets
Quoted 10 lines · Christoph Niedermaier
Add the "-l" parameter to the "env select" command to print the available environment targets, convert all argument parsing in the file
nvedit.ctogetopt()and check that with unit tests.The first patch converts the parsing of arguments to
getopt()for all env commands. The second one adds unit tests for checking the env command. These were used to check the env commands before and after the conversion. The third patch adds the actual new parameter "-l" for the "env select" command.
Quoted 8 lines
Quoted 4 lines
Christoph Niedermaier (3):
cmd: nvedit: Convert the parsing of arguments togetopt()
test: cmd: nvedit: Add basic unit tests
cmd: env: select: Add output for available environment targetsCan you please make a v5 that's run through CI? I saw that
am64x_evm_a53fails to build now and I'm seeing the tests fail too:
https://source.denx.de/u-boot/u-boot/-/jobs/1196652
Sorry, I will have a look at it and make a new version. Are my patches also the cause of the build issue with am64x_evm_a53?
Regards
Christoph
Quoted 21 lines · Christoph Niedermaier
From: Tom Rini <[email protected]>
Sent: Thursday, July 10, 2025 3:58 AMQuoted 19 lines
Subject: Re: [PATCH V4 0/3] cmd: env: select: Add output for available environment targets
Quoted 14 lines · Christoph Niedermaier
Add the "-l" parameter to the "env select" command to print the available environment targets, convert all argument parsing in the file
nvedit.ctogetopt()and check that with unit tests.The first patch converts the parsing of arguments to
getopt()for all env commands. The second one adds unit tests for checking the env command. These were used to check the env commands before and after the conversion. The third patch adds the actual new parameter "-l" for the "env select" command.Christoph Niedermaier (3):
cmd: nvedit: Convert the parsing of arguments togetopt()
test: cmd: nvedit: Add basic unit tests
cmd: env: select: Add output for available environment targets
Quoted 6 lines
Quoted 3 lines
Can you please make a v5 that's run through CI? I saw that
am64x_evm_a53fails to build now and I'm seeing the tests fail too:
https://source.denx.de/u-boot/u-boot/-/jobs/1196652Sorry, I will have a look at it and make a new version. Are my patches also the cause of the build issue with
am64x_evm_a53?
Yes, something in the series was leading to at least that platform and likely many others (I saw that in my local board testing, CI failed the pipeline before getting to the world stage so I don't know all of the ones that failed).
Signature · 1 line
Tom
From: Tom Rini <[email protected]>
Sent: Friday, July 11, 2025 7:41 PM
Quoted 26 lines · Christoph Niedermaier
Quoted 25 lines
From: Tom Rini <[email protected]>
Sent: Thursday, July 10, 2025 3:58 AMQuoted 22 lines
Subject: Re: [PATCH V4 0/3] cmd: env: select: Add output for available environment targets
Quoted 10 lines · Christoph Niedermaier
Add the "-l" parameter to the "env select" command to print the available environment targets, convert all argument parsing in the file
nvedit.ctogetopt()and check that with unit tests.The first patch converts the parsing of arguments to
getopt()for all env commands. The second one adds unit tests for checking the env command. These were used to check the env commands before and after the conversion. The third patch adds the actual new parameter "-l" for the "env select" command.Quoted 4 lines
Christoph Niedermaier (3):
cmd: nvedit: Convert the parsing of arguments togetopt()
test: cmd: nvedit: Add basic unit tests
cmd: env: select: Add output for available environment targetsCan you please make a v5 that's run through CI? I saw that
am64x_evm_a53fails to build now and I'm seeing the tests fail too:
https://source.denx.de/u-boot/u-boot/-/jobs/1196652
Quoted 7 lines
Quoted 2 lines
Sorry, I will have a look at it and make a new version. Are my patches also the cause of the build issue with
am64x_evm_a53?Yes, something in the series was leading to at least that platform and likely many others (I saw that in my local board testing, CI failed the pipeline before getting to the world stage so I don't know all of the ones that failed).
OK, then I will also have a look at it.
Thanks for the clarification.
Regards
Christoph
From: Christoph Niedermaier
Sent: Friday, July 11, 2025 10:57 PM
Quoted 31 lines
From: Tom Rini <[email protected]>
Sent: Friday, July 11, 2025 7:41 PMQuoted 29 lines · Christoph Niedermaier
Quoted 27 lines
From: Tom Rini <[email protected]>
Sent: Thursday, July 10, 2025 3:58 AMQuoted 14 lines
Subject: Re: [PATCH V4 0/3] cmd: env: select: Add output for available environment targets
Quoted 10 lines · Christoph Niedermaier
Add the "-l" parameter to the "env select" command to print the available environment targets, convert all argument parsing in the file
nvedit.ctogetopt()and check that with unit tests.The first patch converts the parsing of arguments to
getopt()for all env commands. The second one adds unit tests for checking the env command. These were used to check the env commands before and after the conversion. The third patch adds the actual new parameter "-l" for the "env select" command.Quoted 8 lines
Quoted 4 lines
Christoph Niedermaier (3):
cmd: nvedit: Convert the parsing of arguments togetopt()
test: cmd: nvedit: Add basic unit tests
cmd: env: select: Add output for available environment targetsCan you please make a v5 that's run through CI? I saw that
am64x_evm_a53fails to build now and I'm seeing the tests fail too:
https://source.denx.de/u-boot/u-boot/-/jobs/1196652Sorry, I will have a look at it and make a new version. Are my patches also the cause of the build issue with
am64x_evm_a53?
Quoted 7 lines
Quoted 4 lines
Yes, something in the series was leading to at least that platform and likely many others (I saw that in my local board testing, CI failed the pipeline before getting to the world stage so I don't know all of the ones that failed).
OK, then I will also have a look at it.
Thanks for the clarification.
I have submitted version 5, which should solve the problem with CI. I could not reproduce the problem when building for am64x_evm_a53. I hope that it will also be gone with version 5.
Thanks and regards
Christoph