grub-devel
[Top][All Lists]
Advanced

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

Re: Set a bootdrive environment variable.


From: Mathieu Trudel-Lapierre
Subject: Re: Set a bootdrive environment variable.
Date: Wed, 27 May 2015 08:55:09 -0400

On Wed, May 27, 2015 at 12:04 AM, Andrei Borzenkov <address@hidden> wrote:
В Tue, 26 May 2015 12:46:07 -0400
Mathieu Trudel-Lapierre <address@hidden> пишет:

> I've been playing with fixing Ubuntu bug 1097570; trying to debug a script we
> use for the EFI images which detects where to boot from based on the location
> of a .disk/info file.
>
> Turns out this mostly works, except for the fact that grub appears to always
> list devices in a specific order, which interferes with the detection if more
> than one device contains that file.
>
> I think I can make this work appropriately provided we:
>   - Use hints for search --file;
>   - Have some value to pass to --hint= designating the boot drive.
>

If you always want to use the same device GRUB was booted from why do
you need to search for anything at all?

My understanding from why the search was used is that $root may not have been set for all types of devices (i.e. CDs), and the same built grub images (for EFI) were used on bootable USB and CDs since they are both built from a single ISO.

In retrospect, having a properly set $cmdpath (or $grub_bootdev or whatever), probably makes this unnecessary.
 
> Included is a patch that adds a "bootdrive" variable alongside cmdpath; which
> contains just the drive designation for the boot device, to be used as such:
>
> search --set=root --hint=$bootdrive --file .disk/info
>
> I'd much appreciate review on that patch :)
>

You can extract it from $cmdpath using regexp already. In retrospect
having separate variables for device and path would be more flexible;
but $drive is not appropriate name as it can refer to network as well.
Something like $grub_bootdev and $grub_bootpath.

That was one of the reasons I wanted review on it, so thanks!

I'm happy to change it to $grub_bootdev or whatever else if we feel having separate variable for this in indeed a good idea (and I'll add what's needed to get $grub_bootpath).


Mathieu Trudel-Lapierre <mathieu.tl@gmail.com>
Freenode: cyphermox, Jabber: mathieu.tl@gmail.com
4096R/EE018C93 1967 8F7D 03A1 8F38 732E  FF82 C126 33E1 EE01 8C93

reply via email to

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