diff --git a/man/vconsole.conf.xml b/man/vconsole.conf.xml index b03a3de0407..667105109b1 100644 --- a/man/vconsole.conf.xml +++ b/man/vconsole.conf.xml @@ -75,9 +75,10 @@ KEYMAP_TOGGLE= Configures the key mapping table for the keyboard. - KEYMAP= defaults to &DEFAULT_KEYMAP; if not set. The - KEYMAP_TOGGLE= can be used to configure a second toggle keymap and is by - default unset. + KEYMAP= defaults to &DEFAULT_KEYMAP; if not set. Specially, + if kernel is specified, no keymap will be loaded, i.e. the kernel keymap is used. + The KEYMAP_TOGGLE= can be used to configure a second toggle keymap and is by default + unset. diff --git a/meson.build b/meson.build index 9d10d76d9f9..0e1eecfd209 100644 --- a/meson.build +++ b/meson.build @@ -947,6 +947,11 @@ nspawn_locale = get_option('nspawn-locale') conf.set_quoted('SYSTEMD_NSPAWN_LOCALE', nspawn_locale) default_keymap = get_option('default-keymap') +if default_keymap == '' + # We canonicalize empty keymap to 'kernel', as it makes the default value + # in the factory provided /etc/vconsole.conf more obvious. + default_keymap = 'kernel' +endif conf.set_quoted('SYSTEMD_DEFAULT_KEYMAP', default_keymap) localegen_path = get_option('localegen-path') diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c index dd6e884335b..921e587e948 100644 --- a/src/vconsole/vconsole-setup.c +++ b/src/vconsole/vconsole-setup.c @@ -281,7 +281,7 @@ static int keyboard_load_and_wait(const char *vc, Context *c, bool utf8) { map_toggle = context_get_config(c, VC_KEYMAP_TOGGLE); /* An empty map means kernel map */ - if (isempty(map)) + if (isempty(map) || streq(map, "kernel")) return 0; args[i++] = KBD_LOADKEYS;