Discussion:
grub boot control from an usb-keyboard.
(too old to reply)
Sthu Deus
2010-11-24 12:50:02 UTC
Permalink
Good day.

Is it possible somehow to switch the grub options (which kernel to
boot) from an USB-keyboard - it is being a laptop (w/ connected to it
keyboard and monitor so that it is always closed - never used
its keyboard/monitor) - for for now I have to edit grub's conf file and
reinstall it every time I want to switch between the booting options.

Thank You for Your time.
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@mx.google.com
Klistvud
2010-11-24 13:20:02 UTC
Permalink
Post by Sthu Deus
Is it possible somehow to switch the grub options (which kernel to
boot) from an USB-keyboard
Grub2: http://grub.enbug.org/USBSupport
Grub Legacy: try toggling the "USB Legacy Support" option (if there is
one) in BIOS; alternatively, update to GRUB2; alternatively, connect
your USB keyboard to the PS/2 port (if there is one) using an
USB-to-PS2 adapter
--
Cheerio,

Klistvud
http://bufferoverflow.tiddlyspot.com
Certifiable Loonix User #481801 Please reply to the list, not to
me.
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@compax
Sthu Deus
2010-11-24 16:10:02 UTC
Permalink
Post by Klistvud
Grub2: http://grub.enbug.org/USBSupport
Sorry, my fault - I did not specify grub's version - it is 2 (1.98,
exactly).

I did not understand - can You explain a bit what is the command line
(used in grub.cfg file) for the kernel to use the USB-keyboard?

- They say that I need to use the parameters at the grub's prompt - but
this is my goal to use USB-keyboard as soon as the menu appears - w/o
at the first use built-in keyboard, then - the USB-one.
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@mx.google.com
Klistvud
2010-11-24 17:20:02 UTC
Permalink
Post by Sthu Deus
Post by Klistvud
Grub2: http://grub.enbug.org/USBSupport
Sorry, my fault - I did not specify grub's version - it is 2 (1.98,
exactly).
I did not understand - can You explain a bit what is the command line
(used in grub.cfg file) for the kernel to use the USB-keyboard?
- They say that I need to use the parameters at the grub's prompt - but
this is my goal to use USB-keyboard as soon as the menu appears - w/o
at the first use built-in keyboard, then - the USB-one.
I just skimmed over the link I gave you. I thought it was dealing with
Grub configuration files, but now I see it's not ...
Essentially, what you want to do is enter the specified commands

insmod uhci; insmod usb_keyboard; terminal_input usb_keyboard

into your Grub2 configuration files, specifically into
/etc/grub.d/00_header. In that file, you'll find listed the Grub
modules that get loaded when Grub starts (around line 47 on my system).
There, (as root) add the three above commands to the existing ones,
thus:

insmod gfxterm
insmod vbe
insmod uhci
insmod usb_keyboard
insmod terminal_input usb_keyboard

Save the file, run update-grub (as root again), and reboot.

Disclaimer: while the above commands should work, there's a good chance
they won't, and I've not tested them personally. Grub2 is still under
heavy development, and the documentation is more or less "in fieri".
There are some reports that USB support in Grub2 is not complete (see
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/432276). In
addition, the Grub2 version shipped with Lenny is a bit long in the
tooth. You'd possibly have more luck if you were using Squeeze.
--
Good luck,

Klistvud
http://bufferoverflow.tiddlyspot.com
Certifiable Loonix User #481801 Please reply to the list, not to
me.
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@compax
Klistvud
2010-11-24 17:40:03 UTC
Permalink
Post by Klistvud
insmod terminal_input usb_keyboard
Sorry. Strike "insmod". That was just a copy+paste typo ...
--
Cheerio,

Klistvud
http://bufferoverflow.tiddlyspot.com
Certifiable Loonix User #481801 Please reply to the list, not to
me.
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@compax
Sthu Deus
2010-11-24 18:40:01 UTC
Permalink
Post by Klistvud
into your Grub2 configuration files, specifically into
/etc/grub.d/00_header. In that file, you'll find listed the Grub
modules that get loaded when Grub starts (around line 47 on my
system). There, (as root) add the three above commands to the
insmod gfxterm
insmod vbe
insmod uhci
insmod usb_keyboard
insmod terminal_input usb_keyboard
This is what I have now at the place in the file:

set gfxmode=640x480
insmod gfxterm
insmod vbe
insmod uhci
insmod usb_keyboard
terminal_input usb_keyboard
terminal gfxterm

Is it correct? - For now it works not - but I set 1 sec to wait - so I
will try latter w/ larger period.
Post by Klistvud
Save the file, run update-grub (as root again), and reboot.
I have two similar files here:

update-grub and
update-grub2

should I use the first one only? - Can You shed some light here?

How I do update my grub2 configuration is

/usr/sbin/grub-install /dev/sda
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@mx.google.com
Klistvud
2010-11-24 22:10:03 UTC
Permalink
Dne, 24. 11. 2010 19:34:38 je Sthu Deus napisal(a):
This is what I have now at the place in the file:

set gfxmode=640x480
insmod gfxterm
insmod vbe
insmod uhci
insmod usb_keyboard
terminal_input usb_keyboard
terminal gfxterm

Is it correct? - For now it works not - but I set 1 sec to wait - so I
will try latter w/ larger period.

As far as I can tell, it should be OK. If I were you, I would set that
to at least 10 seconds until it works, then, once I got it working, I'd
set it back to 1 sec.


Save the file, run update-grub (as root again), and reboot.

I have two similar files here:

update-grub and
update-grub2

should I use the first one only? - Can You shed some light here?

I *think* the second one should be just a softlink to the second one,
or vice versa. I'd try running the first one and then check whether
/boot/grub/grub.cfg has changed. If I remember right, it should now
have the new insmod commands somewhere (it's what update-grub does,
essentially -- it parses the various scripts in /etc/grub.d and builds
the new /boot/grub/grub.cfg from them).


How I do update my grub2 configuration is

/usr/sbin/grub-install /dev/sda

You shouldn't have to do that anymore. That was only needed the first
time you installed Grub2 onto your MBR; given that you obviously have
Grub installed now, you only need to run 'update-grub'. That will
re-configure Grub in a relatively safe way, that is, without
re-installing it. So, I wouldn't reccommend running grub-install, no.

Again, what we're doing here is pretty much guesswork, so there's no
guarantee we will be able to make it work. But there's no harm in
trying, right?

P.S. Sorry for the messed-up formatting, my mail client is having a fit.
--
Cheerio,

Klistvud
http://bufferoverflow.tiddlyspot.com
Certifiable Loonix User #481801 Please reply to the list, not to
me.
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@compax
Sthu Deus
2010-11-25 06:50:02 UTC
Permalink
Post by Klistvud
As far as I can tell, it should be OK. If I were you, I would set
that to at least 10 seconds until it works, then, once I got it
working, I'd set it back to 1 sec.
Save the file, run update-grub (as root again), and reboot.
So I have done. But it still no luck.
Post by Klistvud
I *think* the second one should be just a softlink to the second
I thought the same - but it is not - that's why I asked here.
Post by Klistvud
Again, what we're doing here is pretty much guesswork, so there's no
guarantee we will be able to make it work. But there's no harm in
trying, right?
Absolutely!
Post by Klistvud
P.S. Sorry for the messed-up formatting, my mail client is having a fit.
Please, do not worry. Thank You for Your time.
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@mx.google.com
Klistvud
2010-11-25 10:00:02 UTC
Permalink
Post by Sthu Deus
Post by Klistvud
I *think* the second one should be just a softlink to the second
I thought the same - but it is not - that's why I asked here.
Well, if you just took the trouble, you would see that update-grub2 is
a shell one-liner which executes update-grub. So OK, it's not a
symlink, but it might as well be. I think that you're safe either way.
When you installed Grub2, it should have automatically uninstalled Grub
Legacy, so there's no fear of having both on your system and
potentially mixing the two.

Run update-grub, and check whether it modified the insmod lines in your
grub.cfg. If it did, as it should, then just reboot and see whether
your keyboard works now.
--
Cheerio,

Klistvud
http://bufferoverflow.tiddlyspot.com
Certifiable Loonix User #481801 Please reply to the list, not to
me.
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@compax
Sthu Deus
2010-11-25 16:30:03 UTC
Permalink
Post by Klistvud
Well, if you just took the trouble, you would see that update-grub2
is a shell one-liner which executes update-grub. So OK, it's not a
symlink, but it might as well be. I think that you're safe either
way. When you installed Grub2, it should have automatically
uninstalled Grub Legacy, so there's no fear of having both on your
system and potentially mixing the two.
I thought the same - but booting is essential therefore I prefered to
ask first.
Post by Klistvud
Run update-grub, and check whether it modified the insmod lines in
your grub.cfg. If it did, as it should, then just reboot and see
whether your keyboard works now.
And so I did. - But no luck. Probably, I have to wait for D6 - may
there grub2 will be able to use USB-keyboard, if no more ideas.

Thanks for Your answers, once again.
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@mx.google.com
Andrei Popescu
2010-11-24 23:50:02 UTC
Permalink
Post by Sthu Deus
update-grub and
update-grub2
should I use the first one only? - Can You shed some light here?
If you just cat update-grub2 it will be obvious ;)

Regards,
Andrei
--
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
Sthu Deus
2010-11-25 06:00:02 UTC
Permalink
Post by Andrei Popescu
If you just cat update-grub2 it will be obvious ;)
Not to me :)
- As it comes from grub2 package.
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@mx.google.com
Andrei Popescu
2010-11-25 11:10:02 UTC
Permalink
Post by Klistvud
I just skimmed over the link I gave you. I thought it was dealing
with Grub configuration files, but now I see it's not ...
Essentially, what you want to do is enter the specified commands
insmod uhci; insmod usb_keyboard; terminal_input usb_keyboard
into your Grub2 configuration files, specifically into
/etc/grub.d/00_header. In that file, you'll find listed the Grub
modules that get loaded when Grub starts (around line 47 on my
system). There, (as root) add the three above commands to the
insmod gfxterm
insmod vbe
insmod uhci
insmod usb_keyboard
insmod terminal_input usb_keyboard
Save the file, run update-grub (as root again), and reboot.
Just a side-note. If one just wants to 'insmod' additional modules for
grub2 it is possible to add them in /etc/default/grub:

GRUB_PRELOAD_MODULES="uhci usb_keyboard"

(I don't like changing too many files, /etc/default/grub is already
customized on my systems due to GRUB_GFXPAYLOAD_LINUX)

Regards,
Andrei
--
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
Klistvud
2010-11-25 15:10:01 UTC
Permalink
Post by Andrei Popescu
Just a side-note. If one just wants to 'insmod' additional modules for
GRUB_PRELOAD_MODULES="uhci usb_keyboard"
(I don't like changing too many files, /etc/default/grub is already
customized on my systems due to GRUB_GFXPAYLOAD_LINUX)
Regards,
Andrei
--
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
Good point! Is there any chance of /etc/default/grub being overwritten
when the Grub package is updated?
--
Cheerio,

Klistvud
http://bufferoverflow.tiddlyspot.com
Certifiable Loonix User #481801 Please reply to the list, not to
me.
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@compax
Tom H
2010-11-26 03:10:02 UTC
Permalink
Good point! Is there any chance of /etc/default/grub being overwritten when
the Grub package is updated?
You're prompted whether to install the maintainer's version or keep
your own (or compare them...).
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/AANLkTinpdoFQ1eTV0HcLUe7GLmzGm1YYMRh+***@mail.gmail.com
Loading...