| Summary: | Dracut try to source undefined KEYMAP from /etc/sysconfig/keyboard | ||
|---|---|---|---|
| Product: | Mageia | Reporter: | Raphael Gertz <mageia> |
| Component: | RPM Packages | Assignee: | Mageia tools maintainers <mageiatools> |
| Status: | NEW --- | QA Contact: | |
| Severity: | normal | ||
| Priority: | Normal | CC: | davidwhodgins |
| Version: | 9 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Source RPM: | dracut-057-4.mga9.src.rpm | CVE: | |
| Status comment: | |||
|
Description
Raphael Gertz
2024-01-10 18:18:17 CET
It seems that it's a regression when moving to systemd because a behaviour defined in /usr/lib/dracut/modules.d/10i18n/README is not valid anymore with systemd vconsole service: « KEYTABLE - base name for keyboard translation table; if UNICODE is true, Unicode version will be loaded. Overrides KEYMAP. » I am unsure if it's possible to try to load the same variable from various files in i18n_vars definition and which one is elected in case of diverging duplicate definition I am unsure how to makes sure dracut include i18n stuff, on a chroot install, it include nothing. I am sure to have experienced the bug where systemd vconsole service fails because keymap is not included in initrd. It was both time with a fr locale and keyboard with a luks encrypted / It seems that the problem reside with dracut, the i18n_vars do not set the configuration of /etc/vconsole.conf and /etc/locale.conf inside the initrd. It will only serve to include the keymap and font files plus maybe files related to other variables. I replayed generating a host only initrd in various configuration:
Without change to /etc/dracut.conf.d/50-mageia.conf and no extra config in /etc/dracut.conf.d with a fr-latin9 configured keyboard, country to FR and lang to fr_FR.UTF-8, I get:
# DRACUT_SKIP_FORCED_NON_HOSTONLY=1 mkinitrd -f /boot/initrd-$(uname -r).img $(uname -r)
# cat /tmp/dracut.*/initramfs/etc/vconsole.conf
KEYMAP="fr-latin9.uni"
EXT_KEYMAPS=" "
UNICODE="1"
FONT="lat0-16"
# cat /tmp/dracut.*/initramfs/etc/locale.conf
LANG="fr_FR.UTF-8"
# tree /tmp/dracut.*/initramfs/usr/lib/kbd
/tmp/dracut.SW9dIY/initramfs/usr/lib/kbd
└── consolefonts
├── eurlatgr.psfu
└── lat0-16.psfu
It will fail to loadkeys fr later in the boot process.
With omit_dracutmodules=" network ":
# tree /tmp/dracut.*/initramfs/usr/lib/kbd
/tmp/dracut.EkNcyt/initramfs/usr/lib/kbd
└── consolefonts
├── eurlatgr.psfu
└── lat0-16.psfu
Same result it will fail to load the required fr-latin9 keymap.
With omit_dracutmodules=" network " + i18n_vars="/etc/vconsole.conf:FONT,KEYMAP /etc/locale.conf:LANG":
# tree /tmp/dracut.*/initramfs/usr/lib/kbd
/tmp/dracut.nrK4Ey/initramfs/usr/lib/kbd
├── consolefonts
│ ├── eurlatgr.psfu
│ └── lat0-16.psfu
└── keymaps
└── i386
└── azerty
└── fr-latin9.map
Not sure it has ever worked in the first place, we may want to replace i18n_vars to this value in /etc/dracut.conf.d/50-mageia.conf
In summary, i18n_vars is not used to set the configuration inside the initrd, but only as /etc/vconsole.conf and /etc/locale.conf are included as is. It seems smart to change /etc/dracut.conf.d/50-mageia.conf to i18n_vars="/etc/vconsole.conf:FONT,KEYMAP /etc/locale.conf:LANG" to makes keymap load succeed. To get vconsole.service working on my install I changed ... $ cat /etc/vconsole.conf FONT=lat0-16 FONT_UNIMAP=/usr/share/kbd/unimaps/cp437AB.uni KEYMAP=us The font comes from ... $ rpm -q -f /usr/lib/kbd/consolefonts/lat0-16.psfu.gz kbd-2.5.1-1.mga9 The unimap comes from ... $ rpm -q -f /usr/share/kbd/unimaps/cp437AB.uni hxtools-20221120-2.mga9 The keymap comes from ... $ rpm -q -f /usr/lib/kbd/keymaps/i386/qwerty/us.map.gz kbd-2.5.1-1.mga9 Assigning to the Mageia tools group as this should be configured during installation. CC:
(none) =>
davidwhodgins |