dracut icon indicating copy to clipboard operation
dracut copied to clipboard

Keymap problem

Open pandom79 opened this issue 3 years ago • 9 comments

Describe the bug It looks like that dracut cannot set properly keymap.

Distribution used Slackware

Dracut version 057

Init system Runit

To Reproduce I generate the kernel image and reboot the system. When I enter the luks password then the keymap is not correct.

Expected behavior Keymap properly set.

Additional context Before enter luks password, I see the following msg for three times: loadkeys: /usr/share/kbd/i386/qwerty/it.map:31: cannot open include file linux-with-alt-and-altgr I have this file in /usr/share/kbd/keymaps/i386/include/linux-with-alt-and-altgr.inc

How could i resolve it? Best regards

pandom79 avatar Aug 20 '22 15:08 pandom79

@pandom79

You can try to add /usr/share/kbd/i386/qwerty/it.map into your dracut.conf and regenerate initramfs.

https://man7.org/linux/man-pages/man5/dracut.conf.5.html#:~:text=install_optional_items

LaszloGombos avatar Aug 20 '22 17:08 LaszloGombos

@LaszloGombos It's already there.

lsinitrd initramfs-5.19.2.efi | grep map
objcopy: /dev/null: file truncated
drwxr-xr-x   1 root     root            0 Aug 20 17:01 lib/modules/5.19.2/kernel/drivers/base/regmap
-rw-r--r--   1 root     root        15632 Aug 17 20:47 lib/modules/5.19.2/kernel/drivers/base/regmap/regmap-i2c.ko
-rw-r--r--   1 root     root         9368 Aug 17 20:47 lib/modules/5.19.2/kernel/drivers/input/matrix-keymap.ko
-rw-r--r--   1 root     root        11008 Aug 17 20:47 lib/modules/5.19.2/kernel/drivers/input/sparse-keymap.ko
-r-xr-xr-x   1 root     root        31192 Aug 12  2021 lib64/libdevmapper-event.so.1.02
-rwxr-xr-x   1 root     root       362192 Aug 12  2021 lib64/libdevmapper.so.1.02
lrwxrwxrwx   1 root     root           26 Aug 20 17:01 usr/lib64/libdevmapper-event.so -> libdevmapper-event.so.1.02
lrwxrwxrwx   1 root     root           38 Aug 20 17:01 usr/lib64/libdevmapper-event.so.1.02 -> ../../lib64/libdevmapper-event.so.1.02
drwxr-xr-x   1 root     root            0 Aug 20 17:01 usr/share/kbd/keymaps
drwxr-xr-x   1 root     root            0 Aug 20 17:01 usr/share/kbd/keymaps/i386
drwxr-xr-x   1 root     root            0 Aug 20 17:01 usr/share/kbd/keymaps/i386/qwerty
-rw-r--r--   1 root     root         4912 Feb 13  2021 usr/share/kbd/keymaps/i386/qwerty/it.map
lrwxrwxrwx   1 root     root           22 Aug 20 17:01 usr/share/keymaps -> /usr/share/kbd/keymaps
-rw-r--r--   1 root     root        26362 Jul  9 10:52 usr/share/plymouth/themes/spinner/keymap-render.png
lrwxrwxrwx   1 root     root           22 Aug 20 17:01 usr/share/unimaps -> /usr/share/kbd/unimaps

pandom79 avatar Aug 20 '22 18:08 pandom79

@pandom79 Thanks. Sorry I misunderstood the problem.

Make sure linux-with-alt-and-altgr.inc is also included in your initramfs and try again.

LaszloGombos avatar Aug 20 '22 20:08 LaszloGombos

@pandom79 Thanks. Sorry I misunderstood the problem.

Make sure linux-with-alt-and-altgr.inc is also included in your initramfs and try again.

I added "install_items+=" /usr/share/kbd/keymaps/i386/include/linux-with-alt-and-altgr.inc " in dracut.conf and the error is changed. It wants linux-keys-bare.inc, now. Probably, I will should add this file and perhaps others as well. For this reason, I wonder if this is bug. Anyway, is there a way to add to initramfs a whole folder or files list ? It seems that I can only add a single file at time.

pandom79 avatar Aug 20 '22 23:08 pandom79

@pandom79

For this reason, I wonder if this is bug.

Yes, this is likely a bug, but we need more information to determine if this is a bug in dracut upstream, or some other tool or in your distro.

It is good to confirm a workaround before start discussing a possible permanent solution.

Perhaps easiest is to uncompress the initramfs created by dracut and use your shell to add the missing files and recompress. Here is some help - https://access.redhat.com/solutions/24029

LaszloGombos avatar Aug 20 '22 23:08 LaszloGombos

Perhaps easiest is to uncompress the initramfs created by dracut and use your shell to add the missing files and recompress. Here is some help - https://access.redhat.com/solutions/24029

I followed this guide but, for some reason, it doesn't work getting a kernel panic. Maybe I did something wrong ... Anyway, I added the following files in dracut conf and it worked :+1: install_items+=" /usr/share/kbd/keymaps/i386/include/compose.inc /usr/share/kbd/keymaps/i386/include/linux-keys-bare.inc /usr/share/kbd/keymaps/i386/include/linux-keys-extd.inc /usr/share/kbd/keymaps/i386/include/linux-with-alt-and-altgr.inc /usr/share/kbd/keymaps/i386/include/linux-with-modeshift-altgr.inc /usr/share/kbd/keymaps/i386/include/linux-with-two-alt-keys.inc /usr/share/kbd/keymaps/i386/include/qwerty-layout.inc " I think that they should be added by dracut itself since are required.

pandom79 avatar Aug 21 '22 09:08 pandom79

Maybe this is a duplicate of #1859?

aafeijoo-suse avatar Aug 22 '22 07:08 aafeijoo-suse

Anyway, is there a way to add to initramfs a whole folder or files list ?

You can generate it on the fly, f.e. like:

install_items+="$(find /usr/share/kbd/keymaps/i386 -type f | xargs -ri echo -n "{} ")"

(there might be an easier way; but this just works)

pvalena avatar Aug 31 '22 11:08 pvalena

Should be already fixed in https://github.com/dracutdevs/dracut/pull/1856

pvalena avatar Aug 31 '22 11:08 pvalena