Comment 42 for bug 1097570

Indeed you can use BootCurrent (or, as grub already provides that, use $cmdpath or some variation of it) to specify the right device as a basis for where to search for the files.

Rather than simply using search --file --set=root /.disk/info; I think we can make use of hints to specify where to search first. I've experimented with this over the past few days and it looks like it works properly. I've also prepared a patch to grub to provide an extra environment variable "$bootdrive" that would include just the disk specification for the device used for the EFI booting -- in other words, while $cmdpath contains the full path to the directory containing the EFI binaries used to boot ((hd2,gpt2)/EFI/ubuntu); it would contain just the drive without partition specification (hd2 in the same example).

Then, 'search --file --hint=$bootdrive --set=root /.disk/info' appears to return the right paths according to my tests.

I've sent the patch upstream (waiting to see that it was indeed received on the mailing list), and I'll do one final run of testing to make sure this behaves properly before considering an upload first to the current development release (since it does appear to be reproducible there still).