From bc31d85c6e23d724664e76bcfc3b2eda778012a3 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 17 Jun 2015 12:40:04 +0200 Subject: cdev: Add partuuid string to struct cdev This adds the partuuid string to struct cdev in order to have this available for constructing a suitable Linux root=PARTUUID= option for booting Linux. Signed-off-by: Sascha Hauer --- common/partitions/dos.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'common/partitions/dos.c') diff --git a/common/partitions/dos.c b/common/partitions/dos.c index 37addfd2ef..e0cb35627d 100644 --- a/common/partitions/dos.c +++ b/common/partitions/dos.c @@ -185,6 +185,7 @@ static void dos_partition(void *buf, struct block_device *blk, uint8_t *buffer = buf; int i; struct disk_signature_priv *dsp; + uint32_t signature = get_unaligned_le32(buf + 0x1b8); table = (struct partition_entry *)&buffer[446]; @@ -202,6 +203,9 @@ static void dos_partition(void *buf, struct block_device *blk, pd->parts[n].first_sec = pentry.first_sec; pd->parts[n].size = pentry.size; pd->parts[n].dos_partition_type = pentry.dos_partition_type; + if (signature) + sprintf(pd->parts[n].partuuid, "%08x-%02d", + signature, i + 1); pd->used_entries++; /* * Partitions of type 0x05 and 0x0f (and some more) -- cgit v1.2.3