Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LUKS unlock screen always uses en-US keyboard layout #3

Open
rugk opened this issue Jul 7, 2019 · 36 comments
Open

LUKS unlock screen always uses en-US keyboard layout #3

rugk opened this issue Jul 7, 2019 · 36 comments
Labels
bug Something isn't working f39 Related to Fedora 39 f40 Related to Fedora 40 kinoite Also affect Fedora Kinoite upstream Issue reported, fixed or related to upstream projects

Comments

@rugk
Copy link

rugk commented Jul 7, 2019

Workaround:

Run:

rpm-ostree initramfs-etc --track=/etc/vconsole.conf

and reboot.


Original issue text

Despite of what anaconda says in it's installer, actually the LUKS unlock screen seems to ignore my keyboard layout selected at installation time at all (in contrast to Fedora Workstation) and just use some default en_US (I guess).

This is a serious issue, as it affects the first-time user experience of many Silverblue users and may actually lock users out and leave a very bad experience when they try Silverblue for the first time.
Also, obviously, AFAIK once you've installed your system like that, it's hard to change afterwards.

@rugk rugk changed the title LUKS unlock screen always uses en_US keyboard layout LUKS unlock screen always uses en-US keyboard layout Jul 7, 2019
@aruiz
Copy link

aruiz commented Jul 11, 2019

I actually saw this happening on a RHEL8 install.

@rugk
Copy link
Author

rugk commented Jul 11, 2019

Well, then report it there? It's another project, after all?

@cgwalters
Copy link

xref https://discussion.fedoraproject.org/t/bug-dm-crypt-password-saved-in-qwerty/1204 in particular this.

@cgwalters
Copy link

In general with server-side initramfs by default (as rpm-ostree does) all client-side changes need to either be reflected instead in the kernel commandline - or my ideal here would be to generate an "overlay" initramfs. This came up in another thread; I think most bootloaders support multiple.
(Alternatively, rpm-ostree could learn how to concatenate such an overlay into one initramfs, avoiding the full rpm-ostree initramfs --enable slowness)

The thread claims even rpm-ostree initramfs --enable isn't picking up the vconsole.conf modifications, which seems like a bug in rpm-ostree (or dracut).

@jwrdegoede
Copy link

Since silverblue is using a server-side generated, generic initrd, there is no /etc/vconsole.conf in the initrd (as that is only included in a host-only initrd). As mentioned one solution would be to set the keymap on the kernel commandline using vconsole.keymap=..., see man vconsole.conf

@cgwalters
Copy link

And to elaborate on the above, to change the kernel command line you should use rpm-ostree kargs.

@jwrdegoede
Copy link

I've been thinking about this some more. Also because of: https://bugzilla.redhat.com/show_bug.cgi?id=1405539, which is part of: https://fedoraproject.org/wiki/Fedora_Program_Management/Prioritized_bugs_and_issues

I believe that specifying the keymap on the kernel commandline is probably the right thing to do for both regular fedora and silverblue. But if we do this I wonder if runtime keymap changes will still work (rather then only work after reboot) as systemd-vconsole-setup gives higher prio to the kernel commandline then the configfile.

I've started a discussion about this on the systemd-devel mailinglist:
https://lists.freedesktop.org/archives/systemd-devel/2019-July/043176.html

@jwrdegoede
Copy link

So the initial discussion (from Jul 30) on the systemd list ended with the conclusion that passing "rd.vconsole.keymap=foo" on the kernel-commandline should work.

Now the question is how do we get that on the kernel commandline when changing the layout. I've started a new discussion about having systemd-localed somehow update the commandline for this on the sytemd-devel mailinglist:
https://lists.freedesktop.org/archives/systemd-devel/2019-September/043465.html

One option which is being suggested there is to not use the kernel cmdline but instead use an extra initrd with just /etc/vconsole.conf in there, which overwrites the /etc/vconsole.conf in the main initrd.

For silverblue this would require some place to write this initrd too; in theory this can be a single initrd shared between all the kernels and we could provide an empty one in the initial install.

The kernel-cmdline plan would mean either updating the grubenv, which we already do for boot fail detection; or doing a read/write/modify of all the /boot/loader/entries/*.conf BLS files to append or update the option there.

From a regular Fedora pov, all of the above would work. @cgwalters you wrote above that from a silverblue pov you would prefer an overlay initramfs for this? Is that still the case?

@cgwalters
Copy link

or doing a read/write/modify of all the /boot/loader/entries/*.conf BLS files to append or update the option there.

I don't think we want to change all entries; just the new one. As a general rule, rpm-ostree prefers to keep your "deployment" immutable, and create new deployments for changes. This ensures you always have a rollback to your previous working state.

Also particularly for rpm-ostree, remember that each deployment has its own /etc, and hence you can also revert from the bootloader to previous /etc changes as well.

(All of this is a great illustration of how fundamental of a change ostree is to the operating system, and requires careful thinking about how things that operate on top work to achieve its goals)

@cgwalters you wrote above that from a silverblue pov you would prefer an overlay initramfs for this?

Yeah that's probably the simplest model. It would meld nicely actually with the general philosophy of rpm-ostree that we prefer layering over overrides. Something like rpm-ostree initramfs --enable-layered or something, and in that model we just scrape any config files from /etc and don't even run dracut?

@patrakov
Copy link

Won't layering completely defeat the purpose of signatures in the secure boot scenario?

@jwrdegoede
Copy link

jwrdegoede commented Sep 26, 2019 via email

@jwrdegoede
Copy link

Ok, so there seems to be consensus that the best way to handle this is using an overlay initramfs. So my plan for regular Fedora for this is as follows:

  1. Have a /boot/initramfs-config.img which for now will just contain /etc/vconsole.conf (chances are this will get more files added over time)
  2. Modify mkbls from /usr/lib/kernel/install.d/20-grub.install to add an initrd line for this image to the generated bls .conf file if the image is present
  3. Add a new update-config-initramfs command to the install-kernel script, which generates /boot/initramfs-config.img
  4. Make systemd-localed call update-config-initramfs on locale (and keymap) setting changes

Would this also work for silverblue (with perhaps some work on the SB side) ?

@cgwalters
Copy link

All changes to the kernel and initramfs must go through rpm-ostree.

@cgwalters
Copy link

The main ugly thing I think in this is that what we really want to do is have a mechanism that lets us know precisely when we need to create an overlay. I suppose to start we could go with just a list of files in /etc that are relevant maintained in...dracut?

Then it'd be pretty easy to add rpm-ostree initramfs --cond-enable-overlay as well as auto-detect this situation at upgrade time, and do 1-3. Then the implementation of 4) would just be a DBus call too.

One pattern I've been thinking about supporting is where we try to define interfaces that work on yum-based as well as rpm-ostree based systems. For rpm-ostree we can wrap/replace.

@jwrdegoede
Copy link

The idea for regular Fedora at least would be that the tooling making changes to files under /etc which need to be part of the config overlay initrd would trigger the re-generation from the tooling.

E.g. systemd-localed would call some external helper to regenerate the initrd when the keymap gets changed through localectl (or other users of the localed DBUS API).

Note that we are currently still discussing the localed integration on the systemd-devel list and how we are going to do this is not entirely clear yet. It seems that Lennart does not like the config overlay initrd idea.

It would be useful if you can subscribe to systemd-devel and follow the discussion there directly; and comment if it is heading in a direction which is troublesome for rpm-ostree:
https://lists.freedesktop.org/archives/systemd-devel/2019-September/043465.html

@cgwalters
Copy link

Per the thread...I think what we really want to encourage for LUKS is binding to the TPM, so there's no prompt. But anyways, since the solutions in that thread require new bootloader support, we can't rely on it anytime soon.

(Further, requiring bootloader changes runs straight into ostreedev/ostree#1873 )

So in coreos/rpm-ostree#1930 we're going to add rpm-ostree support for overlay initramfs.

@cgwalters
Copy link

Closing this in favor of coreos/rpm-ostree#1930 since it isn't just a Silverblue issue - it affects all rpm-ostree using systems, including Fedora CoreOS, Fedora IoT etc.

@cgwalters
Copy link

Hm, I would close if I had permissions, which I apparently don't.

@rugk
Copy link
Author

rugk commented Nov 26, 2019

ok okay, do it for you 😄

@cgwalters
Copy link

See coreos/rpm-ostree#2170

@piotrcki
Copy link

Hello,

I still have this issue today. After the initial install process, the prompt is set up to QWERTY despite another keyboard layout choice during the installation.

Although it can be solved through rpm-ostree initramfs --enable, this is still a big issue because.

  1. The first unlock is still a pain.
  2. It is not obvious that unlock fails because of the keyboard layout.
  3. Not everyone knows what an initramfs is, and this knowledge should not be expected from users.

Because of 1. and 3., coreos/rpm-ostree#2170 doesn't seem to be the right fix (even if it's good to have it) and I suggest to re-open this ticket.

@travier
Copy link
Member

travier commented Apr 19, 2021

Maybe this could be redirected to Anaconda where the setup could happen during the installation process.

@cgwalters
Copy link

Yeah, this needs to be an Anaconda bug now.

@travier travier added upstream Issue reported, fixed or related to upstream projects kinoite Also affect Fedora Kinoite labels Dec 5, 2022
@alex27riva
Copy link

Hi everyone, this issue is still not fixed in Fedora Silverblue 38.

@travier
Copy link
Member

travier commented Apr 20, 2023

We don't keep all issues that have a bug reported upstream open in this repo.

I'm going to re-open it as it's a common enough issue that we can keep it open.

@travier travier reopened this Apr 20, 2023
@travier travier added f37 Related to Fedora 37 f38 Related to Fedora 38 f39 Related to Fedora 39 labels Apr 20, 2023
@yodatak
Copy link

yodatak commented Apr 23, 2023

Ben Cotton 2023-04-19 14:54:04 UTC

In today's prioritized bugs meeting, we agreed to accept this as a prioritized bug. Using the wrong keyboard layout during the boot process is a bad user experience
https://meetbot.fedoraproject.org/fedora-meeting-1/2023-04-19/fedora_prioritized_bugs_and_issues.2023-04-19-14.00.log.html#l-44

🎉 Thanks a lot !

@erlefloch
Copy link

This issue should be displayed on https://fedoraproject.org/silverblue/download/ , this would have saved me some time !
Or at least mention it in https://docs.fedoraproject.org/en-US/fedora-silverblue/installation/#known-limitations

@miabbott
Copy link
Member

This issue should be displayed on https://fedoraproject.org/silverblue/download/ , this would have saved me some time !

Or at least mention it in https://docs.fedoraproject.org/en-US/fedora-silverblue/installation/#known-limitations

Care to submit a PR with your suggestion?

https://github.com/fedora-silverblue/silverblue-docs

@hadess
Copy link

hadess commented Oct 3, 2023

I ran into this today, and the problem seems to be compounded by the fact that the target that systemd relies on to read the password will only run a few times before going into a failure state and never asking for a password again. This is visible in the debug output, but the spinner in graphical mode just spins forever.

@travier travier added the f40 Related to Fedora 40 label Oct 10, 2023
@travier
Copy link
Member

travier commented Nov 10, 2023

Another (maybe easier) option is to add arguments to the kernel command line to set the keymap. For example from https://www.freedesktop.org/software/systemd/man/latest/vconsole.conf.html:

... vconsole.keymap=fr

@travier travier removed the f37 Related to Fedora 37 label Nov 24, 2023
fiftydinar added a commit to fiftydinar/gidro-os that referenced this issue Dec 10, 2023
@jbethune
Copy link

jbethune commented Jan 24, 2024

Since silverblue is using a server-side generated, generic initrd, there is no /etc/vconsole.conf in the initrd (as that is only included in a host-only initrd). As mentioned one solution would be to set the keymap on the kernel commandline using vconsole.keymap=..., see man vconsole.conf

Just an idea: Would it be possible to store the keyboard layout choice in a file that lies on the unencrypted /boot partition? I assume that the data from /boot is not stored in the immutable distro image.

@travier
Copy link
Member

travier commented Mar 14, 2024

This is tracked in https://gitlab.com/fedora/ostree/sig/-/issues/6

@travier travier added f41 Related to Fedora 41 and removed f38 Related to Fedora 38 f41 Related to Fedora 41 labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working f39 Related to Fedora 39 f40 Related to Fedora 40 kinoite Also affect Fedora Kinoite upstream Issue reported, fixed or related to upstream projects
Projects
None yet
Development

No branches or pull requests