diff options
author | Will Drewry <wad@chromium.org> | 2010-09-01 00:47:07 +0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-09-15 18:14:03 +0400 |
commit | b5af921ec02333e943efb59aca4f56b78fc0e100 (patch) | |
tree | fcf966ccbee9c5f8b8f652100f033bc781b91b91 /block/genhd.c | |
parent | eec7ecfede74bb996060efefd5c157acd5794e8a (diff) | |
download | linux-b5af921ec02333e943efb59aca4f56b78fc0e100.tar.xz |
init: add support for root devices specified by partition UUID
This is the third patch in a series which adds support for
storing partition metadata, optionally, off of the hd_struct.
One major use for that data is being able to resolve partition
by other identities than just the index on a block device. Device
enumeration varies by platform and there's a benefit to being able
to use something like EFI GPT's GUIDs to determine the correct
block device and partition to mount as the root.
This change adds that support to root= by adding support for
the following syntax:
root=PARTUUID=hex-uuid
Signed-off-by: Will Drewry <wad@chromium.org>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/genhd.c')
-rw-r--r-- | block/genhd.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/block/genhd.c b/block/genhd.c index c8da12055264..5c9c503de423 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -642,6 +642,7 @@ void __init printk_all_partitions(void) struct hd_struct *part; char name_buf[BDEVNAME_SIZE]; char devt_buf[BDEVT_SIZE]; + u8 uuid[PARTITION_META_INFO_UUIDLTH * 2 + 1]; /* * Don't show empty devices or things that have been @@ -660,10 +661,14 @@ void __init printk_all_partitions(void) while ((part = disk_part_iter_next(&piter))) { bool is_part0 = part == &disk->part0; - printk("%s%s %10llu %s", is_part0 ? "" : " ", + uuid[0] = 0; + if (part->info) + part_unpack_uuid(part->info->uuid, uuid); + + printk("%s%s %10llu %s %s", is_part0 ? "" : " ", bdevt_str(part_devt(part), devt_buf), (unsigned long long)part->nr_sects >> 1, - disk_name(disk, part->partno, name_buf)); + disk_name(disk, part->partno, name_buf), uuid); if (is_part0) { if (disk->driverfs_dev != NULL && disk->driverfs_dev->driver != NULL) |