mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fix partuuid format
@ 2025-02-26 14:29 Oliver ROHE
  2025-02-28  9:44 ` Sascha Hauer
  2025-02-28  9:46 ` Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Oliver ROHE @ 2025-02-26 14:29 UTC (permalink / raw)
  To: barebox

root=PARTUUID=SSSSSSSS-PP

Where SSSSSSSS is a zero-filled 32-bit MBR disk signature,
and PP is a zero-filled partition number in hexadecimal format.

Signed-off-by: Oliver Rohe <oliver.rohe@wago.com>

diff --git a/common/partitions/dos.c b/common/partitions/dos.c
index 95b71af7ff8..6204fdabc81 100644
--- a/common/partitions/dos.c
+++ b/common/partitions/dos.c
@@ -172,7 +172,7 @@ static void dos_extended_partition(struct block_device *blk, struct dos_partitio
                pentry->size = get_unaligned_le32(&table[0].partition_size);
                pentry->dos_partition_type = table[0].type;
                pentry->num = partno;
-               sprintf(pentry->partuuid, "%08x-%02u", signature, partno + 1);
+               sprintf(pentry->partuuid, "%08x-%02x", signature, partno + 1);

                list_add_tail(&pentry->list, &dpd->pd.partitions);

@@ -270,7 +270,7 @@ static struct partition_desc *dos_partition(void *buf, struct block_device *blk)
                extract_flags(&table[i], pentry);
                pentry->num = i;

-               sprintf(pentry->partuuid, "%08x-%02d", signature, i + 1);
+               sprintf(pentry->partuuid, "%08x-%02x", signature, i + 1);
                dpd->signature = signature;

                if (is_extended_partition(pentry)) {
diff --git a/scripts/kernel-install.c b/scripts/kernel-install.c
index 240122f2d22..05e464d114c 100644
--- a/scripts/kernel-install.c
+++ b/scripts/kernel-install.c
@@ -1370,7 +1370,7 @@ int main(int argc, char *argv[])
                        goto out;
                }

-               append_option("root=PARTUUID=%08X-%02d", nt_disk_signature, root_partition_num);
+               append_option("root=PARTUUID=%08X-%02X", nt_disk_signature, root_partition_num);
        }

        if (list) {
--
2.25.1

Internal



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix partuuid format
  2025-02-26 14:29 [PATCH] fix partuuid format Oliver ROHE
@ 2025-02-28  9:44 ` Sascha Hauer
  2025-02-28  9:46 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2025-02-28  9:44 UTC (permalink / raw)
  To: barebox, Oliver ROHE


On Wed, 26 Feb 2025 14:29:48 +0000, Oliver ROHE wrote:
> root=PARTUUID=SSSSSSSS-PP
> 
> Where SSSSSSSS is a zero-filled 32-bit MBR disk signature,
> and PP is a zero-filled partition number in hexadecimal format.
> 
> 

Applied, thanks!

[1/1] fix partuuid format
      https://git.pengutronix.de/cgit/barebox/commit/?id=faa88fc2d97b (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix partuuid format
  2025-02-26 14:29 [PATCH] fix partuuid format Oliver ROHE
  2025-02-28  9:44 ` Sascha Hauer
@ 2025-02-28  9:46 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2025-02-28  9:46 UTC (permalink / raw)
  To: Oliver ROHE; +Cc: barebox

Hi Oliver,

On Wed, Feb 26, 2025 at 02:29:48PM +0000, Oliver ROHE wrote:
> root=PARTUUID=SSSSSSSS-PP
> 
> Where SSSSSSSS is a zero-filled 32-bit MBR disk signature,
> and PP is a zero-filled partition number in hexadecimal format.

Thanks for fixing this. This doesn't seem to be documented in Linux, so
I digged in the code and added this to the commit message:

| This is not explicitly documented in Linux, but can be seen in [1].
| 
| [1] https://github.com/torvalds/linux/blob/76544811c850a1f4c055aa182b513b7a843868ea/block/partitions/msdos.c#L108

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-28  9:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-26 14:29 [PATCH] fix partuuid format Oliver ROHE
2025-02-28  9:44 ` Sascha Hauer
2025-02-28  9:46 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox