I use a German keyboard layout and a luks-encrypted harddrive on my up-to-date 16.04. I could enter my luks password using my German keyboard layout with no problems until I installed the latest kernel update 4.4.0-34-generic. Now the layout is en_US for the cryptsetup on boot, but after that it's all German (e.g. for login).
I can still select to boot the old kernel 4.4.0-31-generic and have the German keyboard layout on cryptsetup.
I tried adding "KEYMAP=y" to my /etc/initramfs-tools/initramfs.conf and rebuilding my initramfs with "sudo update-initramfs -u", but that did not help.
How can I set a keyboard layout on cryptsetup with the newest kernel?
Best Answer
I had the same problem on a fresh install* of ubuntu 17.10.
This bit of information by F.Raab was proven very useful:
It seems the file
/etc/console-setup/cached.kmap.gz
was missing on my system, and apparently, the responsible programs do not create it.The steps that did work on my system:
cd /etc/console-setup
ls | grep kmap
(search for filenames containing 'kmap' in current folder). I choosecached_UTF-8_del.kmap.gz
.cached.kmap.gz
:sudo cp cached_UTF-8_del.kmap.gz cached.kmap.gz
(except NVIDIA drivers enabled via software & updates and grub quiet splash disabled because of shutdown bug)sudo update-initramfs -u
socached.kmap.gz
can be integrated in the boot sequence.(I tested that
cached.kmap.gz
whas being used by runningstat cached.kmap.gz
before and after step 4 and comparing the access timestamps.)After reboot, cryptsetup would accept my LUKS pasphrase in my preferred keyboard layout, instead of QUERTY.
(That means
cached_UTF-8_del.kmap.gz
already contained the correct layout. If above method does not work for you, you may try your luck with one of the commands at Change keyboard layout (English UK) on command line to English US or https://apps.ubuntu.com/cat/applications/language-selector-gnome/)I'm on kernel
4.13.0-32-generic' (check using
uname -r`). Upgrading the kernel might mitigate the issue as well, but I did not want to do that as I feared that would result in conflicts with the NVIDIA driver again. (Why I had to leave Fedora; after almost every kernel update, my system would turn unstable again, and I don't have the skills and time to solve that.)* except NVIDIA drivers enabled via software & updates and grub quiet splash disabled because of shutdown bug