diff options
author | Karel Zak | 2013-06-13 15:11:04 +0200 |
---|---|---|
committer | Karel Zak | 2013-06-13 15:16:56 +0200 |
commit | d67cc2889a0527b26d7bb8c76f2acac46751d673 (patch) | |
tree | db3bf14bd4d4d92029b8c56f2de692cb35996c90 /libblkid/src/partitions/dos.c | |
parent | libblkid: split blkid_parttable_set_id() (diff) | |
download | kernel-qcow2-util-linux-d67cc2889a0527b26d7bb8c76f2acac46751d673.tar.gz kernel-qcow2-util-linux-d67cc2889a0527b26d7bb8c76f2acac46751d673.tar.xz kernel-qcow2-util-linux-d67cc2889a0527b26d7bb8c76f2acac46751d673.zip |
libblkid: support pseudo PARTUUID= for MBR
# blkid /dev/sdb1
dev/sdb1: TYPE="ext2" PARTUUID="54e743a7-01"
the PARTUUID is generated from MBR Id and partition number. The same
method uses Linux kernel for root=PARTUUID= on systems with MBR.
Note that the patch also removes 0x prefix from PTUUID.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/partitions/dos.c')
-rw-r--r-- | libblkid/src/partitions/dos.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libblkid/src/partitions/dos.c b/libblkid/src/partitions/dos.c index a9c79c34a..a8c6276a7 100644 --- a/libblkid/src/partitions/dos.c +++ b/libblkid/src/partitions/dos.c @@ -103,6 +103,7 @@ static int parse_dos_extended(blkid_probe pr, blkid_parttable tab, blkid_partition_set_type(par, p->sys_type); blkid_partition_set_flags(par, p->boot_ind); + blkid_partition_gen_uuid(par); ct_nodata = 0; } /* The first nested ext.partition should be a link to the next @@ -185,7 +186,7 @@ static int probe_dos_pt(blkid_probe pr, id = dos_parttable_id(data); if (id) - snprintf(idstr, sizeof(idstr), "0x%08x", id); + snprintf(idstr, sizeof(idstr), "%08x", id); /* * Well, all checks pass, it's MS-DOS partiton table @@ -232,6 +233,7 @@ static int probe_dos_pt(blkid_probe pr, blkid_partition_set_type(par, p->sys_type); blkid_partition_set_flags(par, p->boot_ind); + blkid_partition_gen_uuid(par); } /* Linux uses partition numbers greater than 4 |