Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 256332 - Only prompt for root password for boot problems AFTER keymaps is loaded
Summary: Only prompt for root password for boot problems AFTER keymaps is loaded
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Roy Marples
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-25 16:39 UTC by haarp
Modified: 2009-04-25 11:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description haarp 2009-01-25 16:39:36 UTC
When the system has problems booting (like corrupted /var/lib/init.d in my case), Gentoo has the ability to fall back to a simple shell to fix the error. For that it prompts for the root password.
I, being an user of the dreaded German keyboard layout, am using some chars I don't know the American layout equivalent of. Even looking them up and trying to type them in fails for some reason.
So, there's no other option but to boot another OS to fix the problem. Incredibly annoying.
How to fix? Make sure the keymaps service is loaded before prompting for the password to ensure that the user's keyboard layout is loaded.
Comment 1 Roy Marples 2009-02-23 14:02:43 UTC
I suppose that we should have a toggle in /etc/rc.conf - rc_secure_shell=YES/NO and document what happens if set to YES. We should default it to NO as there is no guarantee user has correct keymap loaded even if the keymaps service starts.
Comment 2 Roy Marples 2009-04-24 11:52:48 UTC
http://roy.marples.name/projects/openrc/changeset/1553/trunk

We no longer drop to sulogin by default. This is configurable by setting rc_shell in /etc/rc.conf
Comment 3 haarp 2009-04-25 10:29:30 UTC
Thanks for fixing.
What exactly does this mean? What does it drop to instead? It does support the user's layout by default, right?
Comment 4 Roy Marples 2009-04-25 10:49:19 UTC
(In reply to comment #3)
> Thanks for fixing.
> What exactly does this mean? What does it drop to instead?

By default it just drops to /bin/sh, or whatever rc_shell is set to in /etc/rc.conf

> It does support the user's layout by default, right?

Only if it's loaded by that point, which is not always the case.
It maybe preferable to build the keymap into the kernel directly if that's possible.
Comment 5 Roy Marples 2009-04-25 10:50:53 UTC
I guess the "fix" here is that you can see what you're typing as there's no longer a password to enter by default.
We also cannot load the keymap by default either as it could be corrupt and make things worse or not even available.
Comment 6 haarp 2009-04-25 10:54:39 UTC
Ah, I see. So we essentially replaced the passworded login with a non-password one? That's not exactly having the cake and eating it too :)
How about a prompt after sulogin/sh asking whether the user wants to load his/her keymap?
Comment 7 Roy Marples 2009-04-25 11:06:31 UTC
Hmm, this code is only called when the user requests a shell during an interactive startup. At no other point do we drop to a shell. So if the user decides to drop to shell before keymap has loaded it's his/her choice.

With baselayout-1, sulogin was called in a lot of other places (like maybe say with your /var/lib/init.d corruption), and this is no longer the case. OpenRC is also more ressilient things like this.

In other words, if you don't think my fix is enough for you, then you'll need to find a way of loading the keymap before OpenRC starts (possible) or build it into the kernel (dunno if this is possible).

The final alternative is to open a new bug at http://roy.marples.name/projects/openrc asking if it's possible to save the last loaded correct keyboard mapping by the keymaps script and load it before OpenRC starts on next boot. We do the same with the consolefont, so it maybe possible.