grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: Re: Set a bootdrive environment variable.
Date: Fri, 5 Jun 2015 06:58:48 +0300	[thread overview]
Message-ID: <20150605065848.3298f738@opensuse.site> (raw)
In-Reply-To: <55707151.7060506@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4043 bytes --]

В Thu, 04 Jun 2015 17:40:01 +0200
Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:

> What's the problem with extracting this from $prefix ? This seems to be
> a better match if what you want is location of GRUB.

The original problem was that this information was needed to set
$prefix so it cannot be extracted from it :)

It can be extracted from $cmdpath but then it requires regexp in early
config and feels backwards in general.

> On 31.05.2015 08:42, Andrei Borzenkov wrote:
> > В Wed, 27 May 2015 08:55:09 -0400
> > Mathieu Trudel-Lapierre <mathieu.tl@gmail.com> пишет:
> > 
> >> On Wed, May 27, 2015 at 12:04 AM, Andrei Borzenkov <arvidjaar@gmail.com>
> >> wrote:
> >>
> >>> В Tue, 26 May 2015 12:46:07 -0400
> >>> Mathieu Trudel-Lapierre <mathieu.tl@gmail.com> пишет:
> >>>
> >>>> 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.
> >>
> > 
> > That depends on your image. If image defines prefix and drive and/or
> > partition is missing (e.g. (,msdos1)) missing parts are derived from
> > whatever firmware provides (effectively what ends up in $cmdpath) and
> > should be set for any boot media.
> > 
> > Although I just hit a system (Fujitsu Lifebook S761) which passes bogus
> > device path to image that does not match any existing handle, so both
> > $cmdpath and $root are not set.
> > 
> >> 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).
> >>
> > 
> > The problem is that $cmdpath had been around for long enough. If
> > $cmdpath is used only after loading normal (that are cases I'm aware
> > of) we can make it compatibility variable set by normal without causing
> > more core bloat.
> > 
> >>
> >> 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
> > 
> > 
> > _______________________________________________
> > Grub-devel mailing list
> > Grub-devel@gnu.org
> > https://lists.gnu.org/mailman/listinfo/grub-devel
> > 
> 
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2015-06-05  3:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-26 16:46 Mathieu Trudel-Lapierre
2015-05-26 16:46 ` [PATCH] Set a bootdrive environment variable Mathieu Trudel-Lapierre
2015-05-27  4:04 ` Andrei Borzenkov
2015-05-27 12:55   ` Mathieu Trudel-Lapierre
2015-05-31  6:42     ` Andrei Borzenkov
2015-06-04 15:40       ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-06-05  3:58         ` Andrei Borzenkov [this message]
2015-07-06 19:44       ` Mathieu Trudel-Lapierre
2015-07-07  3:48         ` Andrei Borzenkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150605065848.3298f738@opensuse.site \
    --to=arvidjaar@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).