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

Re: Boot Order



On Sun, 2018-02-25 at 17:03 -0500, Dan Norton wrote:
> On Sat, 24 Feb 2018 14:59:44 -0500
> Dan Norton <dnorton@mindspring.com> wrote:
> 
> > On Sat, 24 Feb 2018 18:37:02 +0100
> > Ben Hutchings <ben@decadent.org.uk> wrote:
> > 
> > > On Fri, 2018-02-23 at 22:18 -0500, Dan Norton wrote:  
> > > > Installing either stretch or buster via netinst results in changes
> > > > to the bios menu. Under "UEFI Boot Sources" the term "Hard Drive"
> > > > is replaced with "debian" and this entry is put first in the boot
> > > > order.
> > > > 
> > > > The PC is:
> > > > Hewlett-Packard HP Pro 3400 Series MT/2ABF, BIOS 7.16 03/23/2012
> > > > 
> > > > Please tell me the justification for putting "debian" in the menu
> > > > and having it boot first, ahead of CD/DVD/USB. Thanks.    
> > > 
> > > If there are multiple bootable operating systems on local hard
> > > drives, I think the installer sets Debian to be higher priority
> > > than the other operating systems.
> > >   
> > 
> > In my case, there are multiple debian installations and the installer
> > positions the last installation at the top of the *grub* menu. This
> > makes sense. But why change the *bios* menu? With the variability in
> > manufacturers bios code, changing the bios menu seems like a risky,
> > tricky, and tedious undertaking. AFAICT it's instigated by the
> > installer and presumably a necessary thing. I've searched for the
> > rationale, but have missed it, if it's out there. Can you refer me to
> > something?
> > 
> > > But as far as I am aware, the relative priority of boot entries on
> > > removable vs hard drives is solely controlled by the BIOS/UEFI
> > > firmware.
> > >   
> > 
> > That just doesn't seem logical. There was a perfectly good priority,
> > before installs of Debian, I think it went:
> > 
> > UEFI Boot Sources
> >   ATAPI CD/DVD Drive
> >   USB Floppy/CD
> >   Hard Drive
> >   USB Hard Drive
> > Legacy Boot Sources
> >   ATAPI CD/DVD Drive
> >   USB Floppy/CD
> >   Hard Drive
> >     SATA0
> > 
> > After installing stretch, it changed to:
> > 
> > UEFI Boot Sources
> >   debian
> >   ATAPI CD/DVD Drive
> >   USB Floppy/CD
> >   USB Hard Drive
> > Legacy Boot Sources
> >   [...]
> > 
> > If done by firmware, wouldn't grub or the installer have to tell
> > the firmware to put "debian" in the bios menu and make it first? In
> > its past life, this PC ran Windows 7 but in order to boot from
> > mountable media there was no need for the user to change the boot
> > order.
> > 
> 
> There is a description of sorts for UEFI and bios booting in [1] and in
> the section on "The UEFI boot manager" it says "Linux distributions
> contain a tool called efibootmgr which is used to manipulate the
> configuration of the UEFI boot manager"
> 
> $ man efibootmgr
> 
> DESCRIPTION
>        ...This application can create and destroy boot entries, change
>        the boot order, ... and more.
> OPTIONS
>        [...]
>        -c | --create
>               Create new variable bootnum and add to bootorder
>        [...]
>        -L | --label LABEL
>               Boot manager display label (defaults to "Linux")
> 
> Debian Code Search for "efibootmgr" shows that grub2 code calls it and
> uses the -c and -L options, among others.
> 
> I was not able to figure out how "Linux" is replaced by "debian"

I think it is usually `grub-install` which calls `efibootmgr` and it
seems to pass `"-L", efi_distributor` where `efi_distributor` would be
"debian" in the case of grub packaged for Debian.

>  but it
> looks like this is what is changing the boot order but I still don't
> know *why* - any hints?

I suspect there may be a general assumption (I don't mean within Debian
or Grub but in the world at large) that if you install something new
then it is what you want to boot in the future. The vast majority of
systems only boot a single operation system and I could see system
manufacturers and/or consumer OS producers with a lot of clout deciding
that booting from a CD by default is more likely to confuse the average
user than be what they actually wanted and be happy to require
documentation to "Press F?? and choose CD" for the uncommon case.

`efibootmgr` doesn't appear to have any options to control the
placement of the new option within the boot order when using `-c`, only
a separate option to change the order after the fact -- I wonder if
this is actually a property of the UEFI firmware on your system, or
even of the UEFI specification? It seems to me that if such control was
possible at the firmware level then `efibootmgr` would expose it (it is
a pretty low level tool). You could file a wishlist bug against that
package to discuss or you could speak to the `efibootmgr` upstream
about it on their own support channels, I bet they would know for sure
(whereas I think you'd be lucky to find anyone around here who could do
more than speculate as I am doing).

BTW I suspect the "Hard Drive" you saw before you installed was simply
the name either HP or MS chose for "Windows boot loader", in an attempt
to optimise understanding for non-technical people.

It appears that one can use `efibootmgr -o` to reset the boot order to
whatever they like, so if you just want to move on you could use that
to fix things to however you want it.

Ian.


Reply to: