I wrote a patch a while ago for this. I ended up creating an add-on command, 
that uses the partition UUID/GUID, to search (--pt-uuid) and an accompanying 
module search.pt_uuid. These two commands mirror the search --fs-uuid and 
search.fs_uuid where given a uuid it will return the device. When given a 
disk/partition UUID/GUID that corresponds to a disk that is either a biosdisk 
or efidisk, or a partition with a partmap name of either "msdos" or "gpt" on 
one of the previous disks it will return that device. I checked it against the 
master and it applied cleanly. I can post it in a day.

Best regards,

Matt

-------- Original Message --------
On Apr 12, 2018, 17:21, Pascal Hambourg wrote:

Le 12/04/2018 à 09:17, Urs Ritzmann a écrit :
>
>> From: Pascal Hambourg [mailto:pas...@plouf.fr.eu.org]
>>
>> Le 11/04/2018 à 10:00, Urs Ritzmann a écrit :
>>>
>>> Currently, the filesystem UUID is used in the search. It works, but the fs 
>>> UUID has to be updated after an image update which is a bit
>> ugly. A constant PARTUUID pointing to current image would be more clean.
>>
>> Can't the same UUID be used when creating a new image ?
>
> The same image can be installed to different partitions (e.g. in a fail-safe 
> dual-copy approach, the currently active image always updates another, 
> inactive image, then toggles the boot to the new one).
>
> In case the same image is installed twice (to different partitions), I would 
> end up with both images having the same UUID.

And that would be a bad thing, because UUIDs are supposed to be unique.
You wrote that rewriting the filesystem UUID was a bit ugly, but IMO not
doing it and having duplicate UUIDs is much more ugly.

Looking at the grub-devel mailing list archives, I found out that some
patches have been submitted to add support for partition UUIDs in GRUB.
But I don't know their status nor whether that is exactly the kind of
support that you are looking for. IIUC, the submitter seemed more
interested in using PARTUUID in the Linux kernel root parameter than in
search commands.

_______________________________________________
Help-grub mailing list
Help-grub@gnu.org
https://lists.gnu.org/mailman/listinfo/help-grub
_______________________________________________
Help-grub mailing list
Help-grub@gnu.org
https://lists.gnu.org/mailman/listinfo/help-grub

Reply via email to