[systemd-devel] Make systemd-localed modify the kernel commandline for the initrd keymap?

Hans de Goede hdegoede at redhat.com
Wed Sep 25 14:50:54 UTC 2019


Hi all,

Currently, at least in Fedora, but I do not believe that this problem is
unique to Fedora, there are 2 problems with keymap handling in the initrd.

1: If the keymap in vconsole.conf is changed then this does not apply to the
initrd without rebuilding it. This means that any changes are only applied
after installing a new kernel
This has been reported a long time ago
  https://bugzilla.redhat.com/show_bug.cgi?id=1405539
and is also listed on the list of Fedora high prio bugs:
  https://fedoraproject.org/wiki/Fedora_Program_Management/Prioritized_bugs_and_issues

2: With silverblue, which ships with a generic pre-generated initrd we end up
with always using the keymap as defined when building the initrd on the
buildsys (KEYMAP=us), also see:
  https://github.com/fedora-silverblue/issue-tracker/issues/3

Now arguably 1. could be fixed by regenerating the initrd, but that is tricky,
because if some component has changed on the system since the last time the
initrd was generated this will change more then just the embedded vconsole.conf
possibly stopping the system from booting (this should never happen, but
in reality this is a real risk).

Also do we want localed to trigger initrd rebuilds? And if we do not want
that, then should tools calling the localed DBUS API do this?
If all the tools need to do that then it seems to me that the API is
incomplete / not fully functional, so that seems undesirable.

And for 2. we really do not want to rebuild the initrd ever, and for the
"normal" distro case at least for Fedora we also want to move to
pre-generated initrds so that we can sign them, etc.

TL;DR: IMHO regenerating the initrd is not the answer here.

I believe that the best alternative is to have localed append / update
a rd.vconsole.keymap=foo argument to the kernel commandline, to override
the vconsole.conf KEYMAP setting, but only in the initrd (so that later
runtime changes when booted still work).

The way I see this working is that localed does a read-modify-write of
all the BLS .conf files under /boot/loader/entries and updates their
"options" line to have rd.vconsole.keymap=foo appended or updated if
already present.

I'm willing to write localed patches implementing this (targetting Fedora 32)
but before I spend time on this, it would be good to have consensus that
this is the best way to handle this. Note I'm open to other suggestions.

Regards,

Hans


More information about the systemd-devel mailing list