grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Add GRUB_DISABLE_UUID.


From: Nicholas Vinson
Subject: Re: [PATCH] Add GRUB_DISABLE_UUID.
Date: Fri, 20 Sep 2019 12:25:53 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0



On 9/20/19 11:03, Didier Spaier wrote:
On 20/09/2019 15:23, Javier Martinez Canillas wrote:
On 9/20/19 2:42 PM, Daniel Kiper wrote:
On Thu, Sep 19, 2019 at 02:20:06PM +0200, Javier Martinez Canillas wrote:
Hello Daniel,

On 9/18/19 2:39 PM, Daniel Kiper wrote:
Adding Nicholas...

On Tue, Sep 17, 2019 at 05:48:45PM +0200, Javier Martinez Canillas wrote:
From: Peter Jones <address@hidden>

This will cause "search --fs-uuid --set=root ..." not to be generated by grub2-mkconfig, and instead simply attempt to use the grub device name
as it understands it.

Signed-off-by: Peter Jones <address@hidden>
Signed-off-by: Javier Martinez Canillas <address@hidden>

We have this functionality in GRUB upstream. Please take a look at
commit 51be3372e (templates: Update grub script template files).
Could you pick it up in RH/Fedora?


That commit does something different if I'm reading it correctly. It's about allowing to set the root kernel command line parameter to a PARTUUID instead of a UUID or a device name, by using the grub-probe --target=partuuid option.

But Peter's patch is about setting the root param to a device name instead
of a UUID.

And also about not adding search commands in the grub.cfg to set the $root
and $boot grub environment variables by searching using a UUID.

Now digging more I found that there's already a GRUB_DISABLE_LINUX_UUID option

There are two variables: GRUB_DISABLE_LINUX_UUID and GRUB_DISABLE_LINUX_PARTUUID.


Yes. I didn't mention the GRUB_DISABLE_LINUX_PARTUUID variable because the search
command only has support to search using the UUID and not the PARTUUID.

It has support to search using the PARTUUID in case of a GPT, cf. commit
f2b9083f859c7dbf44a7a8e96ee0cf202f9a4187

As an aside, it would be very useful to extend this support to dos
partition tables. I believe that all partition tools create a disk
identifier when creating a dos partition table (at least fdisk, cfdisk
and parted do) so if I am not mislead-ed all dos partitions should have
a partuuid in the form DisklabelPartitionnumber.

This would allow e.g. to find the root Linux partitions from a rescue
media, even if the kernel has no associated initrd.

Maybe Jacob could propose a patch for that, as he did for gpt?

I have a patch for that.  I just have not tested it yet.

Thanks,
Nicholas Vinson


for the first part, so we only need to add an option for the second part.

OK.

Since this is not about Linux not using a UUID but grub not using it, I think that we should add another option as this patch does. So GRUB_DISABLE_LINUX_UUID would disable using a UUID for the root param and GRUB_DISABLE_UUID would be about disabling using a UUID to set the $root (and $boot) variables in grub.

GRUB_DISABLE_UUID=true probably should imply GRUB_DISABLE_LINUX_UUID=true also

OK but only if GRUB_DISABLE_LINUX_UUID is not set explicitly. And what
about GRUB_DISABLE_LINUX_PARTUUID?


That's a good question. Would disabling using UUID mean "always use device name for both GRUB and Linux" or "don't use the filesystem UUID for both GRUB and
Linux but allow Linux to use the partition UUID" ?

Peter's patch does the former. And yes, agreed that setting GRUB_DISABLE_LINUX*
to true should only be done if they weren't explicitly set.
I think. But I guess is OK to have separate options and the user could set both
if want to disable using the UUID for Linux and grub.

Another option is to extend GRUB_DISABLE_LINUX_UUID semantics and don't add search commands if this is set to true, but I'm not sure if that's correct.

Hmmm... Probably I prefer former approach...

Agreed. I also prefer to introduce a new variable for this.


Daniel


Best regards,

Best regards,

Didier

_______________________________________________
Grub-devel mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/grub-devel



reply via email to

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