On Wed, 02 Feb 2022 15:00:10 +0000 Maxim Fomin <ma...@fomin.one> wrote:
> ------- Original Message ------- > > > > > > Plainmount can work with '(hdX,gptY)' syntax in config or shell > > > (actually, this > > > > > > is the base syntax) and thus it is not limited to GPT paritions, what is > > > limited > > > > > > is the ability to use UUID - currently only on GPT. If partition scheme > > > does not > > > > > > have UUID then UUID as a convenience feature cannot be supported - > > > inconvenient, > > > > > > but technically fair. I will take a look at MBR UUID and see whether they > > > can be > > > > > > supported. Possible situations (under current implementaion) are follows: > > > > > > a) GPT disk, multi-disk environment, disks map unpredictably: can name > > > partitions > > > > > > by GPT UUID in config file/shell, no problem, ability to name by UUID has > > > value > > > > I agree that searching by partition UUID is useful and desirable. > > > > However, I don't think this is the right approach. GRUB should have > > > > generic searching by partition UUID. There is already a patch for > > > > this[1]. Perhaps you can test/review this patch to help it gain more > > > > visibility and advocate for it being accepted. > > > > Glenn > > > > [1] https://lists.gnu.org/archive/html/grub-devel/2021-04/msg00055.html > > > > Such function (or several functions) should be added into grub 'library', so > it can be > used to search disk by PART UUID in different places. The patch you refer to > seems to > add this functionality only to 'search' grub command via 'void > grub_search_partuuid' > function. Can it be reused on other places? It seems in oder to use it, grub > code must > call 'search' command and receive the result from grub environment variable > which is > not convinient for other grub code interested in this feature. I think the > proper way > to do it is to write some library function which can be used by search, probe > (btw I > borrowed some details from it - so there is code duplication in search/probe), > plainmount commands and other commands in grub. I agree that reducing code duplication would be a good idea. Essentially the grub 'library' you're wanting exists as the kernel code that is always loaded. Would you like to find a good place to put the common partition uuid matching code and send a patch? As far as plainmount is concerned, I wasn't envisioning that it use that code directly and it shouldn't. I was imagining something like this snippet of GRUB script: search --partuuid --set KEYFILEDISK -u $PARTUUID plainmount -k ($KEYFILEDISK)/path/to/keyfile <other options> Glenn _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel