All of lore.kernel.org
 help / color / mirror / Atom feed
* Boot GRUB from USB - potential problem
@ 2012-12-16 16:54 Aleš Nesrsta
  2012-12-18 20:35 ` Phillip Susi
  0 siblings, 1 reply; 5+ messages in thread
From: Aleš Nesrsta @ 2012-12-16 16:54 UTC (permalink / raw)
  To: grub-devel

Hi,

I found something not really bad but probably also not good, related to
booting of GRUB from USB device.
I expect it is probably (very) low priority thing.
Sorry if it was discussed before, I didn't notice it.

Consider this situation:
- You have ordinary PC which (BIOS) supports boot from USB drive (such
as flash disk etc.)
- You boot GRUB on this PC from some USB device into command line
environment
- You do "insmod ehci" (or load any other USB module - uhci or ohci - it
depends what USB host controller Your PC has)
- immediately after issuing the command above the GRUB freezes

Why?
Because loading of GRUB USB driver stops BIOS support of USB device from
which You have booted GRUB, i.e. GRUB has no longer access to any of its
files.
(It cannot be done in any other way because USB host controller cannot
be shared by BIOS and GRUB together.)
(I don't know how it happens on EFI boot but I am afraid it will result
in the same situation.)


In fact, it is logical behavior - but:

1.
Somebody may see it as a bug - maybe it should be mentioned somewhere in
GRUB documentation - ?

2.
This behavior of GRUB prevents using of any additional USB device in
GRUB if GRUB is booted from USB device and the additional device is not
supported by BIOS. Such device could be e.g. USB/serial converter.
 -> I have no idea how to solve it if somebody will need such situation,
e.g. to debug something via serial line or connect some modem/terminal
via serial line.
(Maybe some RAM disk could be used where all GRUB files will be loaded
before real "start" of GRUB? I.e. do boot of GRUB in the little bit
similar way like Linux does? Maybe something like this is currently
possible in GRUB - ? - sorry, I don't know GRUB too deeply...)


BR,
Ales



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

* Re: Boot GRUB from USB - potential problem
  2012-12-16 16:54 Boot GRUB from USB - potential problem Aleš Nesrsta
@ 2012-12-18 20:35 ` Phillip Susi
  2012-12-18 22:09   ` Aleš Nesrsta
  0 siblings, 1 reply; 5+ messages in thread
From: Phillip Susi @ 2012-12-18 20:35 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Aleš Nesrsta

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/16/2012 11:54 AM, Aleš Nesrsta wrote:
> Hi,
> 
> I found something not really bad but probably also not good,
> related to booting of GRUB from USB device. I expect it is probably
> (very) low priority thing. Sorry if it was discussed before, I
> didn't notice it.
> 
> Consider this situation: - You have ordinary PC which (BIOS)
> supports boot from USB drive (such as flash disk etc.) - You boot
> GRUB on this PC from some USB device into command line environment 
> - You do "insmod ehci" (or load any other USB module - uhci or ohci
> - it depends what USB host controller Your PC has) - immediately
> after issuing the command above the GRUB freezes
> 
> Why? Because loading of GRUB USB driver stops BIOS support of USB
> device from which You have booted GRUB, i.e. GRUB has no longer
> access to any of its files.

GRUB only needs access to files when you tell it to load them.  You
can load other grub modules you need before ehci, or change the path
grub will load them from after loading ehci by setting the root and
prefix variables.



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJQ0NOBAAoJEJrBOlT6nu75LOwIAL0l3msEhg0QtvFU6o9pXyzw
XlinEIsoCeGJ8oQ0x965nfuaSfpdQvlypbSYf8gDBTxYdmJ0iKehmLqDRePGjQPV
w3QuSPg8H0pI4tKRwEC2LU6dlhlG3yqp2gxSAk0OuUK7BvULclkwnBkwnGsEs0Cc
0MWEdfpKgblWi6PFH5bEUNIqVlfSpwOVZ7Kh+bbqKScdOFno9Ed0ypG+tkr6YLvO
QH8zcGrxG9OaXRlSCx47TQd7rmwctktBn3jf8T8YErF3FefXzthunHpppo5sWpd8
YgskiLNp3wCsv9+5MjWG+JbfbX0qyJ4WXP9kkJfVr+f4TFHkRs3c1/NkMwobXsE=
=RU2P
-----END PGP SIGNATURE-----


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

* Re: Boot GRUB from USB - potential problem
  2012-12-18 20:35 ` Phillip Susi
@ 2012-12-18 22:09   ` Aleš Nesrsta
  2012-12-19 15:07     ` Phillip Susi
  0 siblings, 1 reply; 5+ messages in thread
From: Aleš Nesrsta @ 2012-12-18 22:09 UTC (permalink / raw)
  To: The development of GNU GRUB

Phillip Susi píše v Út 18. 12. 2012 v 15:35 -0500:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 12/16/2012 11:54 AM, Aleš Nesrsta wrote:
> > Hi,
> > 
> > I found something not really bad but probably also not good,
> > related to booting of GRUB from USB device. I expect it is probably
> > (very) low priority thing. Sorry if it was discussed before, I
> > didn't notice it.
> > 
> > Consider this situation: - You have ordinary PC which (BIOS)
> > supports boot from USB drive (such as flash disk etc.) - You boot
> > GRUB on this PC from some USB device into command line environment 
> > - You do "insmod ehci" (or load any other USB module - uhci or ohci
> > - it depends what USB host controller Your PC has) - immediately
> > after issuing the command above the GRUB freezes
> > 
> > Why? Because loading of GRUB USB driver stops BIOS support of USB
> > device from which You have booted GRUB, i.e. GRUB has no longer
> > access to any of its files.
> 
> GRUB only needs access to files when you tell it to load them.  You
> can load other grub modules you need before ehci, or change the path
> grub will load them from after loading ehci by setting the root and
> prefix variables.

Thanks for reply. But it is not exact true that GRUB loads some file
exactly only when I want to do it - USB part of GRUB loads some modules
automaticaly, e.g. usb.c loads module usbms or usb_keyboard or
usbserial_xxx when related device is connected.

For example:
I boot GRUB from some USB disk. This disk is mapped to GRUB as hd0 (by
BIOS) and there is no another disk - i.e., I cannot copy files to some
another disk and change GRUB environment variables. (Additionaly, AFAIK,
GRUB cannot copy files because it has RO access to all disks - or?)
When I load EHCI driver by "insmod ehci" command, driver immediately
invalidates device hd0. EHCI detects new connected device (the booting
USB disk) after some short time (before "insmod ehci" returns to command
prompt) and USB subsystem wants load usbms module (to create disk usb0)
- but it cannot, because hd0 is not accessible. So, GRUB freezes before
return to command prompt.
(There is question, if GRUB freezes "itself" after unsuccessful loading
of usbms module (why?) or if GRUB freezes because of calling some BIOS
disk function (related to "detached" EHCI USB host controller and boot
USB disk) which freezes "inside" BIOS when trying to load usbms module.
But it is probably not so important yet.)

Probably the only one possibility is to load all necessary USB GRUB
modules manually before issuing "insmod ehci" as You recommend. I will
try if it is working in this way, it could be usable.

BR,
Ales




> 
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.17 (MingW32)
> Comment: Using GnuPG with undefined - http://www.enigmail.net/
> 
> iQEcBAEBAgAGBQJQ0NOBAAoJEJrBOlT6nu75LOwIAL0l3msEhg0QtvFU6o9pXyzw
> XlinEIsoCeGJ8oQ0x965nfuaSfpdQvlypbSYf8gDBTxYdmJ0iKehmLqDRePGjQPV
> w3QuSPg8H0pI4tKRwEC2LU6dlhlG3yqp2gxSAk0OuUK7BvULclkwnBkwnGsEs0Cc
> 0MWEdfpKgblWi6PFH5bEUNIqVlfSpwOVZ7Kh+bbqKScdOFno9Ed0ypG+tkr6YLvO
> QH8zcGrxG9OaXRlSCx47TQd7rmwctktBn3jf8T8YErF3FefXzthunHpppo5sWpd8
> YgskiLNp3wCsv9+5MjWG+JbfbX0qyJ4WXP9kkJfVr+f4TFHkRs3c1/NkMwobXsE=
> =RU2P
> -----END PGP SIGNATURE-----
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel




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

* Re: Boot GRUB from USB - potential problem
  2012-12-18 22:09   ` Aleš Nesrsta
@ 2012-12-19 15:07     ` Phillip Susi
  2012-12-19 21:23       ` Aleš Nesrsta
  0 siblings, 1 reply; 5+ messages in thread
From: Phillip Susi @ 2012-12-19 15:07 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Aleš Nesrsta

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/18/2012 5:09 PM, Aleš Nesrsta wrote:
> Probably the only one possibility is to load all necessary USB
> GRUB modules manually before issuing "insmod ehci" as You
> recommend. I will try if it is working in this way, it could be
> usable.

You can also put the modules into a ramdisk and load that.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJQ0dgUAAoJEJrBOlT6nu75vDEH/A5xqOyePzqep4pAaBaSNtOm
0p5+1a/qIA7okBoSnV85YIyB0LcsvMBGu0UZ+o6aumiHNvwEcEQDfj+fVycv6uyD
fmMMaS+RG3ZNwZ0XGjDffXuUZYAbuT1s2j5HR73V7VXfAUwaZaaeH8DUIrESUbgl
iaWyzGZQZLinLQWzJGJ8o2Y7pvr6WAcvKum7VtZaWU+ji9EN5UdlFAyE1WxVJrTQ
x3OD3FeSbbL9zJlrmSsrkvV2rBcqshHKprPE2A0yg5s3Pj6OJJ70t5Opoox6d+f/
HOSIqQdMAr9CnTYkBU3r4Y8LoOIz8RBjnF7B1JjEn6un6H5h5yz/xNlvsx7ThVo=
=A+2p
-----END PGP SIGNATURE-----


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

* Re: Boot GRUB from USB - potential problem
  2012-12-19 15:07     ` Phillip Susi
@ 2012-12-19 21:23       ` Aleš Nesrsta
  0 siblings, 0 replies; 5+ messages in thread
From: Aleš Nesrsta @ 2012-12-19 21:23 UTC (permalink / raw)
  To: The development of GNU GRUB

> On 12/18/2012 5:09 PM, Aleš Nesrsta wrote:
> > Probably the only one possibility is to load all necessary USB
> > GRUB modules manually before issuing "insmod ehci" as You
> > recommend. I will try if it is working in this way, it could be
> > usable.
> 
> You can also put the modules into a ramdisk and load that.
> 
Thanks for advice, I will try ramdisk also.

Today I tried pre-loading of all necessary USB modules followed by
loading of ehci module. It works with some exceptions - I cannot issue
some commands like e.g. "ls" after loading ehci module.
It is probably because such commands lists or try access to all disks -
and GRUB freezes when it tries to access BIOS boot disk (even if I have
correctly set new values in root, prefix and locale_dir to USB disk
newly created by USB modules).

I tried to do "rmmod biosdisk" - it helps, GRUB does not freeze with
"ls" command after that. But GRUB looks little bit unstable since then -
it does sometimes something wrong...

But, generally, it works. It is fine that I found there exists some
way(s) how to solve booting from USB devices together with use of GRUB
USB driver when it will be necessary - that is all what I wanted to
know.

BR,
Ales



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

end of thread, other threads:[~2012-12-19 21:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-16 16:54 Boot GRUB from USB - potential problem Aleš Nesrsta
2012-12-18 20:35 ` Phillip Susi
2012-12-18 22:09   ` Aleš Nesrsta
2012-12-19 15:07     ` Phillip Susi
2012-12-19 21:23       ` Aleš Nesrsta

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.