part: fix "part list ... -bootable varname" to use hex
PATCH 1/1 part: fix "part list ... -bootable varname" to use hex
From: Stephen Warren <[email protected]>
Unfortunately U-Boot assumes that almost all numbers are in hex, including partition numbers passed to e.g. "load". So, the command "part list mmc 0 -bootable devplist" should use hex when writing partition numbers into $devplist, so they'll be correctly interpreted.
--- common/cmd_part.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/cmd_part.c +1 -1
@@ -100,7 +100,7 @@ static int do_part_list(int argc, char * const argv[])if (bootable && !info.bootable)continue ; -sprintf (t,"%s%d" , str[0 ] ?" " :"" , p); +sprintf (t,"%s%x" , str[0 ] ?" " :"" , p);strcat (str, t); }setenv (var, str);
Signature · 1 line
2.6.3
PATCH 1/1 part: fix "part list ... -bootable varname" to use hex
Quoted 6 lines · Stephen Warren
From: Stephen Warren <[email protected]>
Unfortunately U-Boot assumes that almost all numbers are in hex, including partition numbers passed to e.g. "load". So, the command "part list mmc 0 -bootable devplist" should use hex when writing partition numbers into $devplist, so they'll be correctly interpreted.
Ugh, that's unexpected. But indeed it assumes partition numbers are base 16.
Quoted 23 lines
Change-Id I9a70b19749643876baadb45efbc3decaef8bfee2Fixes 0798d6fd4191 ("part: Add support for list filtering onbootable partitions")
Cc Sjoerd Simons <[email protected]>Signed-off-by Stephen Warren <[email protected]>---
?common/cmd_part.c | 2 +-
?1 file changed, 1 insertion(+), 1 deletion(-)common/cmd_part.c +0
-0@@ -100,7 +100,7 @@ static int do_part_list(int argc, char * const argv[]) ? if (bootable && !info.bootable) ? continue;?
common/cmd_part.c +1
-1-sprintf (t,"%s%d" , str[0 ] ?" " :"" , p); +sprintf (t,"%s%x" , str[0 ] ?" " :"" , p);?
strcat(str, t);
? }
?setenv(var, str);
Signature · 2 lines
Sjoerd Simons Collabora Ltd.
Quoted 7 lines · Stephen Warren
From: Stephen Warren <[email protected]>
Unfortunately U-Boot assumes that almost all numbers are in hex, including partition numbers passed to e.g. "load". So, the command "part list mmc 0 -bootable devplist" should use hex when writing partition numbers into $devplist, so they'll be correctly interpreted.
Quoted 5 lines
Change-Id I9a70b19749643876baadb45efbc3decaef8bfee2Fixes 0798d6fd4191 ("part: Add support for list filtering on bootable partitions")Cc Sjoerd Simons <[email protected]>Signed-off-by Stephen Warren <[email protected]>Reviewed-by Sjoerd Simons <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151215/41e18c7c/attachment.sig>