]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vconsole-setup: use "@kernel" rather than "kernel" as special string to leave keymap...
authorLennart Poettering <lennart@poettering.net>
Thu, 10 Aug 2023 13:12:15 +0000 (15:12 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 10 Aug 2023 19:17:57 +0000 (04:17 +0900)
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

man/vconsole.conf.xml
meson.build
src/vconsole/vconsole-setup.c

index 667105109b1944be10407653281d9a0b5e395704..eb1f20d224fa99bdb4614836d8007643700f0734 100644 (file)
         <term><varname>KEYMAP=</varname></term>
         <term><varname>KEYMAP_TOGGLE=</varname></term>
 
-        <listitem><para>Configures the key mapping table for the keyboard.
-        <varname>KEYMAP=</varname> defaults to <literal>&DEFAULT_KEYMAP;</literal> if not set. Specially,
-        if <literal>kernel</literal> is specified, no keymap will be loaded, i.e. the kernel keymap is used.
-        The <varname>KEYMAP_TOGGLE=</varname> can be used to configure a second toggle keymap and is by default
+        <listitem><para>Configures the key mapping table for the keyboard.  <varname>KEYMAP=</varname>
+        defaults to <literal>&DEFAULT_KEYMAP;</literal> if not set. Specially, if <literal>@kernel</literal>
+        is specified, no keymap will be loaded, i.e. the kernel's default keymap is used.  The
+        <varname>KEYMAP_TOGGLE=</varname> can be used to configure a second toggle keymap and is by default
         unset.</para></listitem>
       </varlistentry>
 
index f37aa0aca5f335d0d71743d09a8e9986999c3018..8f7da1ec6e3412912c37b135ee3f71da1e9e4aaa 100644 (file)
@@ -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)
 
index 73fc0f22da7529c3dd55608c2131cef2284d34a3..17b0f9abfadd49c4e07096990b591a96ca6ac319 100644 (file)
@@ -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;