On Tue, Aug 3, 2010 at 12:17 PM, Kay Sievers <kay.sievers@vrfy.org> wrote:
Cool. So I'd like this as well (at least the UUID part), and I'd like
this to be available for other consumers in the kernel, like
dm_get_device() or at least for mapped device targets to implement
support for themselves. (I have a separate patch for
mimicking md= for device mapper devices which I should probably post
to the lists again soon.)
Yeah - when I use this function, I end up doing a walk over all the
block devices, checking if they are whole disk entries, then calling
the efi_partition_by_guid() function. (Or the walker which I posted
separately.) It's not ideal but it has the smallest impact on the
existing code. (Not having disk_type available is irritating though.)
Would the type GUID and unique GUID be viable additions to a more
public struct? If they were CONFIG_EFI_PARTITION guarded, then they
wouldn't waste memory for systems without GPT support, but it seems a
bit specific. Also, I don't think it'd make sense to put it in the
partition struct as that represents the on-disk format for some tables
(from a quick scan over the code). However, hd_struct looks the
sanest to me.
I'd be happy to pull together a potential change that exposes this
data once after disk (re)scan, but I'd hate to do so in a way that'd
be fundamentally unacceptable (but I don't want to end up down the
deep hole of adding support across all the part tables either if I can
:).
So I could see something like:
struct hd_struct {
...
#ifdef CONFIG_EFI_PARTITION
efi_guid_t type_guid;
efi_guid_t uuid;
u16 label[72 / ...];
};
Alternatively, a slightly more generic option might be:
#ifdef CONFIG_PARTITION_INFO
/* ASCII hex-formatted uuids inclusive of hyphens */
u8 type_guid[MAX_HD_STRUCT_UUID_SIZE];
u8 uuid[MAX_HD_STRUCT_UUID_SIZE];
u16 label[MAX_HD_STRUCT_NAME + sizeof(u16)];
#endif
Any way, if any of this seems slightly palatable, let me know. I'd
love to make this data accessible to the rest of the kernel.
thanks!
will
--