cmd: ufetch: print Net feature when NET_LWIP=y, prettyfy if NET=n
cover cmd: ufetch: print Net feature when NET_LWIP=y, prettyfy if NET=n
Make sure the Net feature is printed when NET_LWIP is enabled, not only when NET_LEGACY is.
Only print comma and following whitespace as separator if there was a feature printed before feature to be printed.
---
Quentin Schulz (2):
cmd: ufetch: show net feature when NET_LWIP is selected
cmd: ufetch: only show comma separator if there was a previous feature
cmd/ufetch.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-)
---
base-commit: 4433253ecf2041f9362a763bb6cb79960921ac7e
change-id: 20260428-ufetch-net-1ba7553a20c7
Best regards,
Signature · 1 line
Quentin Schulz <[email protected]>
PATCH 1/2 cmd: ufetch: show net feature when NET_LWIP is selected
From: Quentin Schulz <[email protected]>
We've had a new lwIP networking stack for a couple of years already, so let's show there is a "net" feature if it's selected. Since NET_LEGACY || NET_LWIP is the same as NET, let's check on NET.
--- cmd/ufetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/ufetch.c +1 -1
@@ -159,7 +159,7 @@ static int do_ufetch(struct cmd_tbl *cmdtp, int flag, int argc,break ;case FEATURES :printf ("Features:" RESET " " ); -if (IS_ENABLED (CONFIG_NET_LEGACY )) +if (IS_ENABLED (CONFIG_NET ))printf ("Net" );if (IS_ENABLED (CONFIG_EFI_LOADER ))printf (", EFI" );
Signature · 1 line
2.54.0
Re: [PATCH 1/2] cmd: ufetch: show net feature when NET_LWIP is selected
Quoted 6 lines · Quentin Schulz
cmd: ufetch: show net feature when
NET_LWIPis selectedWe've had a new lwIP networking stack for a couple of years already, so let's show there is a 'net' feature if it's selected. Since
NET_LEGACY||NET_LWIPis the same as NET, let's check on NET.
Quoted 6 lines
Reported-by Simon Glass <[email protected]>Closes https://lore.kernel.org/u-boot/CAFLszTgZC1FGy8965pHiG-u=FhrguftRv41ghQ_Qb_RRXx6tyg@mail.gmail.com/ open hereSigned-off-by Quentin Schulz <[email protected]>
cmd/ufetch.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 2/2 cmd: ufetch: only show comma separator if there was a previous feature
In reply to Quentin SchulzFrom: Quentin Schulz <[email protected]>
Currently, if NET is disabled, the next feature to be printed will start with a comma and a space which is not pretty. Add the comma and whitespace only when a previous feature has already been shown.
--- cmd/ufetch.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-)
cmd/ufetch.c +20 -9
@@ -157,26 +157,37 @@ static int do_ufetch(struct cmd_tbl *cmdtp, int flag, int argc,printf (" (%d baud)" , gd->baudrate);putc ('\n' );break ; -case FEATURES : +case FEATURES : { +bool sep = false; +printf ("Features:" RESET " " ); -if (IS_ENABLED (CONFIG_NET )) -printf ("Net" ); -if (IS_ENABLED (CONFIG_EFI_LOADER )) -printf (", EFI" ); -if (IS_ENABLED (CONFIG_CMD_CAT )) -printf (", cat :3" ); +if (IS_ENABLED (CONFIG_NET )) { +printf ("%sNet" , sep ?", " :"" ); + sep = true; + } +if (IS_ENABLED (CONFIG_EFI_LOADER )) { +printf ("%sEFI" , sep ?", " :"" ); + sep = true; + } +if (IS_ENABLED (CONFIG_CMD_CAT )) { +printf (":%scat :3" , sep ?", " :"" ); + sep = true; + }#ifdef CONFIG_ARM64 switch (current_el ()) {case 2 : -printf (", VMs" ); +printf ("%sVMs" , sep ?", " :"" ); + sep = true;break ;case 3 : -printf (", full control!" ); +printf ("%sfull control!" , sep ?", " :"" ); + sep = true;break ; }#endif printf ("\n" );break ; + }case RELOCATION :if (gd->flags &GD_FLG_SKIP_RELOC )printf ("Relocated:" RESET " no\n" );
Signature · 1 line
2.54.0
Re: [PATCH 2/2] cmd: ufetch: only show comma separator if there was a previous feature
Hi Quentin,
Quoted 13 lines · Quentin Schulz
cmd: ufetch: only show comma separator if there was a previous feature
Currently, if NET is disabled, the next feature to be printed will start with a comma and a space which is not pretty. Add the comma and whitespace only when a previous feature has already been shown.
Signed-off-by Quentin Schulz <[email protected]>
cmd/ufetch.c| 29 ++++++++++++++++++++---------1 file changed, 20 insertions(+), 9 deletions(-)
cmd/ufetch.c static int do_ufetch(struct cmd_tbl *cmdtp, int flag, int argc, · line 160
Quoted 4 lines
cmd/ufetch.c +4
-0@@ -157,26 +157,37 @@ static int do_ufetch(struct cmd_tbl *cmdtp, int flag, int argc, +if (IS_ENABLED (CONFIG_CMD_CAT )) { +printf (":%scat :3" , sep ?", " :"" ); + sep = true; + }
Do you want the ':' before the '%s' ?
Regards,
Simon
Quoted 7 lines · Quentin Schulz
Make sure the Net feature is printed when
NET_LWIPis enabled, not only whenNET_LEGACYis.Only print comma and following whitespace as separator if there was a feature printed before feature to be printed.
Signed-off-by Quentin Schulz <[email protected]>
As simon pointed out the erroneous ':', with that fixed
Quoted 15 lines
---
Quentin Schulz (2):
cmd: ufetch: show net feature whenNET_LWIPis selected
cmd: ufetch: only show comma separator if there was a previous featurecmd/ufetch.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-)---
base-commit:4433253ecf2041f9362a763bb6cb79960921ac7e
change-id: 20260428-ufetch-net-1ba7553a20c7Best regards,
Signature · 1 line
Quentin Schulz <[email protected]>
Signature · 1 line
// Casey (she/her)