All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: Grub-devel Digest, Vol 140, Issue 25
       [not found] <mailman.61.1445097638.27006.grub-devel@gnu.org>
@ 2015-10-19  9:05 ` Stuart Weaver
  2015-10-19 16:39   ` Lennart Sorensen
  0 siblings, 1 reply; 6+ messages in thread
From: Stuart Weaver @ 2015-10-19  9:05 UTC (permalink / raw)
  To: abranches@gmail.com; +Cc: grub-devel@gnu.org

Hi Manoel,

Many thanks for your detailed answer and quick response! I've looked into using this but I don't think it will stop the root problem of GRUB loading the wrong grub.cfg file. Is there a way of using the 'search' command before GRUB has loaded a grub.cfg and therefore use the same command to look for the grub.cfg? 

To reiterate, 

1. If both eMMC and USB are connected and from the BIOS I choose to boot into the USB, I would expect the BIOS to load GRUB and GRUB to load the grub.cfg on the USB... And that is exactly what happens. However...

2. If both eMMC and USB are connected and from the BIOS I choose to boot into the eMMC I would expect the BIOS to load GRUB and GRUB to load the grub.cfg on the eMMC... Unfortunately the BIOS loads GRUB on the eMMC (correct) but GRUB loads the grub.cfg from the USB, not the eMMC.

I would like to keep the two systems as separate as possible and let the BIOS choose which system to boot. Is this possible? 

Regards,
Stuart


>Date: Fri, 16 Oct 2015 22:54:51 +0000
>From: Manoel Rebelo Abranches <abranches@gmail.com>
>To: The development of GNU GRUB <grub-devel@gnu.org>
>Subject: Re: disk/device enumeration within grub
>Message-ID:
>	<CABUX+5up_BEC-
>e9iYay3qa4K+boMvzK=DZUnsvO41nCtfp4ZQw@mail.gmail.com>
>Content-Type: text/plain; charset="utf-8"
>
>As stated in documentation
>http://www.gnu.org/software/grub/manual/grub.html#Multi_002dboot-
>manual-config
>and
>hilighted below, you should use UUID instead of the  hdx.
>
>Argument to search after ?label is FS LABEL. You can also use UUIDs with ?fs-
>uuid UUID instead of ?label LABEL. You could also use direct root=hd0,msdosX
>but this is not recommended due to device name instability.
>
>Regards,
>Manoel R. Abranches
>
>On Fri, Oct 16, 2015 at 11:00 AM Stuart Weaver
><Stuart.Weaver@datapath.co.uk>
>wrote:
>
>> Hi all,
>>
>>
>>
>> My current setup is a device that has eMMC and occasionally a USB both
>> with GRUB installed on them via Yocto. All are EFI on an x64 system.
>>
>>
>>
>> 1.       When the USB is disconnected the device boots into the eMMC
>>
>> 2.       When the USB is connected and chosen via the BIOS, the device
>> boots into the USB
>>
>> 3.       When the USB is connected and eMMC is chosen via the BIOS, GRUB
>> is loaded from the eMMC (checked by deleting the bootx64.efi file on
>> USB) but chooses the USB grub.cfg file and hence boots into USB
>>
>> 4.       When USB boot is disabled in BIOS it will load GRUB from eMMC
>> (checked by deleting the bootx64.efi file on USB) but chooses the USB
>> grub.cfg file and hence boots into USB
>>
>>
>>
>> When I go to the grub commandline I can see that:
>>
>>
>>
>> 1.       When USB is disconnected, eMMC appears as (hd0)
>>
>> 2.       When USB is connected, USB appears as (hd0) and eMMC appears as
>> (hd1)
>>
>>
>>
>> I?ve tried trawling the internet and documentation but can?t seem to
>> find anything detailing how grub enumerates devices. Obviously I would
>> like grub to look for the grub.cfg file from the device it booted from
>> but can?t seem to find a solution at the moment!
>>
>>
>>
>> Could someone detail/point to the process of how grub does the
>> enumeration (is the information passed through from the BIOS?) and
>> whether USB booting can be blocked for the grub that is on the eMMC?
>>
>>
>>
>> Best Regards,
>>
>> Stuart
>>
>>
>___________________________________________________________
>___________
>> This email has been scanned by the Symantec Email Security.cloud service.
>> For more information please visit http://www.symanteccloud.com
>>
>___________________________________________________________
>___________
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> https://lists.gnu.org/mailman/listinfo/grub-devel
>>

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Grub-devel Digest, Vol 140, Issue 25
  2015-10-19  9:05 ` Grub-devel Digest, Vol 140, Issue 25 Stuart Weaver
@ 2015-10-19 16:39   ` Lennart Sorensen
  2015-10-19 16:55     ` Andrei Borzenkov
  0 siblings, 1 reply; 6+ messages in thread
From: Lennart Sorensen @ 2015-10-19 16:39 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: abranches@gmail.com

On Mon, Oct 19, 2015 at 09:05:47AM +0000, Stuart Weaver wrote:
> Hi Manoel,
> 
> Many thanks for your detailed answer and quick response! I've looked into using this but I don't think it will stop the root problem of GRUB loading the wrong grub.cfg file. Is there a way of using the 'search' command before GRUB has loaded a grub.cfg and therefore use the same command to look for the grub.cfg? 
> 
> To reiterate, 
> 
> 1. If both eMMC and USB are connected and from the BIOS I choose to boot into the USB, I would expect the BIOS to load GRUB and GRUB to load the grub.cfg on the USB... And that is exactly what happens. However...
> 
> 2. If both eMMC and USB are connected and from the BIOS I choose to boot into the eMMC I would expect the BIOS to load GRUB and GRUB to load the grub.cfg on the eMMC... Unfortunately the BIOS loads GRUB on the eMMC (correct) but GRUB loads the grub.cfg from the USB, not the eMMC.
> 
> I would like to keep the two systems as separate as possible and let the BIOS choose which system to boot. Is this possible? 

If the BIOS provides a list of disks to GRUB that has the USB as the first
device and eMMC as the second, there isn't much grub can do about it.

In my laptop I have two SATA devices, and the BIOS always provides them to
GRUB in the order of the ports, even though I have it set to boot from the
second one.  It's a bit annoying, but at least it is consistent about it.

Would be nice if yours put the fixed devices before the removable devices,
but some systems are stupid.

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Grub-devel Digest, Vol 140, Issue 25
  2015-10-19 16:39   ` Lennart Sorensen
@ 2015-10-19 16:55     ` Andrei Borzenkov
  2015-10-19 19:10       ` Lennart Sorensen
  0 siblings, 1 reply; 6+ messages in thread
From: Andrei Borzenkov @ 2015-10-19 16:55 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: abranches@gmail.com

19.10.2015 19:39, Lennart Sorensen пишет:
> On Mon, Oct 19, 2015 at 09:05:47AM +0000, Stuart Weaver wrote:
>> Hi Manoel,
>>
>> Many thanks for your detailed answer and quick response! I've looked into using this but I don't think it will stop the root problem of GRUB loading the wrong grub.cfg file. Is there a way of using the 'search' command before GRUB has loaded a grub.cfg and therefore use the same command to look for the grub.cfg?
>>
>> To reiterate,
>>
>> 1. If both eMMC and USB are connected and from the BIOS I choose to boot into the USB, I would expect the BIOS to load GRUB and GRUB to load the grub.cfg on the USB... And that is exactly what happens. However...
>>
>> 2. If both eMMC and USB are connected and from the BIOS I choose to boot into the eMMC I would expect the BIOS to load GRUB and GRUB to load the grub.cfg on the eMMC... Unfortunately the BIOS loads GRUB on the eMMC (correct) but GRUB loads the grub.cfg from the USB, not the eMMC.
>>
>> I would like to keep the two systems as separate as possible and let the BIOS choose which system to boot. Is this possible?
>
> If the BIOS provides a list of disks to GRUB that has the USB as the first
> device and eMMC as the second, there isn't much grub can do about it.
>

GRUB reads grub.cfg either from the device BIOS had booted from (sans 
serious BIOS bugs) or from device where UUID of /boot/grub is found. At 
least if this GRUB was installed by grub-install. So order of devices in 
BIOS is irrelevant.

I asked him to explain how GRUB was installed on both devices but he 
never replied ... besides IIRC original question of about EFI, not BIOS.

> In my laptop I have two SATA devices, and the BIOS always provides them to
> GRUB in the order of the ports, even though I have it set to boot from the
> second one.  It's a bit annoying, but at least it is consistent about it.
>
> Would be nice if yours put the fixed devices before the removable devices,
> but some systems are stupid.
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Grub-devel Digest, Vol 140, Issue 25
  2015-10-19 16:55     ` Andrei Borzenkov
@ 2015-10-19 19:10       ` Lennart Sorensen
  2015-10-20  3:42         ` Andrei Borzenkov
  0 siblings, 1 reply; 6+ messages in thread
From: Lennart Sorensen @ 2015-10-19 19:10 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: abranches@gmail.com

On Mon, Oct 19, 2015 at 07:55:23PM +0300, Andrei Borzenkov wrote:
> GRUB reads grub.cfg either from the device BIOS had booted from (sans
> serious BIOS bugs) or from device where UUID of /boot/grub is found. At
> least if this GRUB was installed by grub-install. So order of devices in
> BIOS is irrelevant.
> 
> I asked him to explain how GRUB was installed on both devices but he never
> replied ... besides IIRC original question of about EFI, not BIOS.

EFI would make a difference.  I would very much expect EFI to tell the
bootloader which device it was started from.

After all EFI isn't BIOS, so if someone says BIOS I am going to assume
that is what they mean. :)

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Grub-devel Digest, Vol 140, Issue 25
  2015-10-19 19:10       ` Lennart Sorensen
@ 2015-10-20  3:42         ` Andrei Borzenkov
  2015-10-20 13:47           ` Lennart Sorensen
  0 siblings, 1 reply; 6+ messages in thread
From: Andrei Borzenkov @ 2015-10-20  3:42 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: abranches@gmail.com

19.10.2015 22:10, Lennart Sorensen пишет:
> On Mon, Oct 19, 2015 at 07:55:23PM +0300, Andrei Borzenkov wrote:
>> GRUB reads grub.cfg either from the device BIOS had booted from (sans
>> serious BIOS bugs) or from device where UUID of /boot/grub is found. At
>> least if this GRUB was installed by grub-install. So order of devices in
>> BIOS is irrelevant.
>>
>> I asked him to explain how GRUB was installed on both devices but he never
>> replied ... besides IIRC original question of about EFI, not BIOS.
>
> EFI would make a difference.  I would very much expect EFI to tell the
> bootloader which device it was started from.
>

Legacy BIOS is expected to do it as well.

> After all EFI isn't BIOS, so if someone says BIOS I am going to assume
> that is what they mean. :)
>

"BIOS" is often colloquially used for "firmware of my system".


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Grub-devel Digest, Vol 140, Issue 25
  2015-10-20  3:42         ` Andrei Borzenkov
@ 2015-10-20 13:47           ` Lennart Sorensen
  0 siblings, 0 replies; 6+ messages in thread
From: Lennart Sorensen @ 2015-10-20 13:47 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: abranches@gmail.com

On Tue, Oct 20, 2015 at 06:42:07AM +0300, Andrei Borzenkov wrote:
> Legacy BIOS is expected to do it as well.

It provides the device number it booted from?  Hmm, yeah I see it is
stored in the DL register.

> "BIOS" is often colloquially used for "firmware of my system".

True, but it isn't, and being a mailing list for a bootloader where the
difference is very important, it is not a good mistake to make.

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-10-20 13:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.61.1445097638.27006.grub-devel@gnu.org>
2015-10-19  9:05 ` Grub-devel Digest, Vol 140, Issue 25 Stuart Weaver
2015-10-19 16:39   ` Lennart Sorensen
2015-10-19 16:55     ` Andrei Borzenkov
2015-10-19 19:10       ` Lennart Sorensen
2015-10-20  3:42         ` Andrei Borzenkov
2015-10-20 13:47           ` Lennart Sorensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.