From: Lennart Poettering Date: Thu, 10 Aug 2023 13:12:15 +0000 (+0200) Subject: vconsole-setup: use "@kernel" rather than "kernel" as special string to leave keymap... X-Git-Tag: v255-rc1~755 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bf77d59772722e96508df91bd24e1b6940b3edfb;p=thirdparty%2Fsystemd.git vconsole-setup: use "@kernel" rather than "kernel" as special string to leave keymap untouched This is a magic string, and we should avoid stepping into the territory of normal keymap names with that, given that users can pick names otherwise freely. Hence, prefix the name with a special char to avoid any namespace issues. Follow-up for: #28660 --- diff --git a/man/vconsole.conf.xml b/man/vconsole.conf.xml index 667105109b1..eb1f20d224f 100644 --- a/man/vconsole.conf.xml +++ b/man/vconsole.conf.xml @@ -74,10 +74,10 @@ KEYMAP= KEYMAP_TOGGLE= - Configures the key mapping table for the keyboard. - 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 + Configures the key mapping table for the keyboard. KEYMAP= + defaults to &DEFAULT_KEYMAP; if not set. Specially, if @kernel + is specified, no keymap will be loaded, i.e. the kernel's default 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 f37aa0aca5f..8f7da1ec6e3 100644 --- a/meson.build +++ b/meson.build @@ -947,9 +947,9 @@ 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 + # We canonicalize empty keymap to '@kernel', as it makes the default value # in the factory provided /etc/vconsole.conf more obvious. - default_keymap = 'kernel' + default_keymap = '@kernel' endif conf.set_quoted('SYSTEMD_DEFAULT_KEYMAP', default_keymap) diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c index 73fc0f22da7..17b0f9abfad 100644 --- a/src/vconsole/vconsole-setup.c +++ b/src/vconsole/vconsole-setup.c @@ -282,7 +282,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) || streq(map, "kernel")) + if (isempty(map) || streq(map, "@kernel")) return 0; args[i++] = KBD_LOADKEYS;