Skip to contentSkip to conversation

part: fix "part list ... -bootable varname" to use hex

PATCH In review Stephen Warren 3 participants 3 messages Dec 9, 2015 – Dec 15, 2015

lore
Share & tools
lore
#0 lore raw

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.

Change-Id I9a70b19749643876baadb45efbc3decaef8bfee2
Fixes 0798d6fd4191 ("part: Add support for list filtering on bootable partitions")
Cc Sjoerd Simons <[email protected]>
---
 common/cmd_part.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/cmd_part.c +1 -1
index b860624d939c..55995097eb00 100644
@@ -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
#1 lore raw

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 I9a70b19749643876baadb45efbc3decaef8bfee2
Fixes 0798d6fd4191 ("part: Add support for list filtering on

bootable partitions")

---
?common/cmd_part.c | 2 +-
?1 file changed, 1 insertion(+), 1 deletion(-)

common/cmd_part.c +0 -0
index b860624d939c..55995097eb00 100644
@@ -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.
#2 lore raw
In reply to Stephen Warren
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 I9a70b19749643876baadb45efbc3decaef8bfee2
Fixes 0798d6fd4191 ("part: Add support for list filtering on bootable partitions")
Cc 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>