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

Lennart Poettering mzerqung at 0pointer.de
Fri Sep 27 11:49:54 UTC 2019


On Mi, 25.09.19 16:50, Hans de Goede (hdegoede at redhat.com) wrote:

> 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.

Hmm, why do you need a correct initrd in the early boot? I can see two
reasons:

1. full disk encryption with the user typing in the password on the
   kbd. But isn't the answer to this to link the root OS to the tpm
   instead, and use user-keyed crypto only for $HOME? The OS itself
   doesn't need to be protected after all, everbody should have the
   same files there anyway, it's $HOME that needs protection.

2. debugging in the initrd. Does this really matter though? Aren't
   people who can usefully debug the initrd also smart enough to load the
   kbd mappings themselves (or work with american keybindings for a bit)?

Aren't you making something here a problem that actually doesn't
matter much?

That said, if it is worth fixing this, why stop at the initrd here,
shouldn't the bootloader get right keymaps too? After all, most boot
loaders I know have a line editor...

Which hence raises the question: isn't this something the boot loader
should manage initially, and then just pass to the kernel/initrd?
i.e. on EFI systems, shouldn't this just be an efi var, that the boot
ldr can read, and then pass on to the kernel (or alternatively, read
by the initrd?) Alternatively, if you care about non-EFI, isn't this
also something you want to tell the boot ldr about, and then have the
boot loader pass to the kernel, maybe via a struct boot_param entry?
(or simply by appending something to the kernel cmdline if that
doesn't fly).

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

Yeah, leave the initrd alone, it should be immutable outside of kernel
updates, I am sure.

> 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.

I'd be happy to merge patches that just use an EFI variable for this,
so that boot loader, initrd and GNOME can all make use of this.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list