grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5] probe: Support probing for GPT partition UUID with -g


From: Didier Spaier
Subject: Re: [PATCH v5] probe: Support probing for GPT partition UUID with -g
Date: Mon, 13 May 2019 22:53:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Hello,

On 13/05/2019 22:35, Jacob Kroon wrote:
> Hi Vladimir,
> 
> On Mon, May 13, 2019 at 10:11 PM Vladimir 'phcoder' Serbinenko
> <address@hidden> wrote:
>>
>> Ideally the option shouldn't be specific to GPT as other partmaps also have 
>> stable IDs. I think it's better not to have short option at all
>>
> 
> Ok, I have some questions below.
> 
>> On Mon, 13 May 2019, 20:33 Jacob Kroon, <address@hidden> wrote:
>>>
>>> Linux supports root=PARTUUID=<partuuid> boot argument, so add
>>> support for probing it. Compared to the fs UUID, the partition
>>> UUID does not change when reformatting a partition.
>>>
>>> Signed-off-by: Jacob Kroon <address@hidden>
>>> ---
>>>  docs/grub.texi             |  2 +-
>>>  grub-core/commands/probe.c | 34 ++++++++++++++++++++++++++++++++++
>>>  2 files changed, 35 insertions(+), 1 deletion(-)
>>>
>>> Changes since v4:
>>>  * Do endianess byte-swapping on the fly when formatting string
>>>
>>> diff --git a/docs/grub.texi b/docs/grub.texi
>>> index 308b25074..d85818744 100644
>>> --- a/docs/grub.texi
>>> +++ b/docs/grub.texi
>>> @@ -4771,7 +4771,7 @@ a rest.
>>>  @node probe
>>>  @subsection probe
>>>
>>> address@hidden Command probe address@hidden var] 
>>> @option{--driver}|@option{--partmap}|@option{--fs}|@option{--fs-uuid}|@option{--label}
>>>  device
>>> address@hidden Command probe address@hidden var] 
>>> @option{--driver}|@option{--partmap}|@option{--fs}|@option{--fs-uuid}|@option{--label}|@option{--part-uuid}
>>>  device
>>>  Retrieve device information. If option @option{--set} is given, assign 
>>> result
>>>  to variable @var{var}, otherwise print information on the screen.
>>>  @end deffn
>>> diff --git a/grub-core/commands/probe.c b/grub-core/commands/probe.c
>>> index 95d272287..b26cbe2cc 100644
>>> --- a/grub-core/commands/probe.c
>>> +++ b/grub-core/commands/probe.c
>>> @@ -24,6 +24,7 @@
>>>  #include <grub/device.h>
>>>  #include <grub/disk.h>
>>>  #include <grub/partition.h>
>>> +#include <grub/gpt_partition.h>
>>>  #include <grub/net.h>
>>>  #include <grub/fs.h>
>>>  #include <grub/file.h>
>>> @@ -45,6 +46,7 @@ static const struct grub_arg_option options[] =
>>>      {"fs",             'f', 0, N_("Determine filesystem type."), 0, 0},
>>>      {"fs-uuid",                'u', 0, N_("Determine filesystem UUID."), 
>>> 0, 0},
>>>      {"label",          'l', 0, N_("Determine filesystem label."), 0, 0},
>>> +    {"part-uuid",      'g', 0, N_("Determine GPT partition UUID."), 0, 0},
> 
> Is "part-uuid" ok ? I guess I should remove "GPT" from the help text ?

If I may interfere, lsblk names it PARTUUID (actually the case doesn't matter)
so I'd suggest partuuidn withjout a hyphen.

And yes, this field exists also with a 'dos' partition label (or 'msdos"
as parted calls it), not only a 'gpt'.

I can't say for other partition labels than those two, having only
used these.    

 
> I've seen both 0 and -1 being passed as short option, do they both
> mean "no short option", or is there a preference which to use in this
> case ?
> 
> /Jacob

Best,

Didier



reply via email to

[Prev in Thread] Current Thread [Next in Thread]