Hi Alex,
Alexander Eremin wrote:
> On ??, 2009-10-26 at 10:25 +0100, Jan Damborsky wrote:
>>
>> ...
>> 1504 if (errno == ENOTSUP) {
>> 1505
>> 1506 /* EFI label */
>> ...
>> Just checking - is this check reliable ?
> These lines from devinfo
> http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/devinfo/devinfo.c
> Yes, it works:
> Disk c0t3d0 was labeled as EFI before:
>
> <TIMM_I Oct 21 06:08:43> Target type to be created: DISK_LABEL
> <TIDM_I Oct 21 06:08:43> Disk c0t3d0 has an EFI label
> <TIDM_I Oct 21 06:08:43> format: Creating SMI label for c0t3d0
> <TIDM_I Oct 21 06:08:43> dm cmd: printf 'label
> ...
I have taken a look at cmlb module and it returns ENOTSUP
for DKIOCGGEOM ioctl if EFI label is detected:
...
case DKIOCGGEOM:
if (cl->cl_label_from_media == CMLB_LABEL_EFI) {
/* GPT label on disk */
mutex_exit(CMLB_MUTEX(cl));
return (ENOTSUP);
}
break;
...
I have also found following PSARC (Extended VTOC):
http://arc.opensolaris.org/caselog/PSARC/2008/336/20080520_shidokht.yadegari
Based on this, we could alternatively check for return value from DKIOCGEXTVTOC
ioctl and test for ENOTSUP.
At this point I am fine with the current approach - it will be looked
at again and revisited as part of EFI effort.
I'll let other people provide the comments - if no more comments are
provided by the end of this week, please feel free to send me your
changes as usual (taking advantage of 'hg bundle') and I will integrate
them.
Thank you for making those changes,
Jan