[pve-devel] [PATCH installer v2] set console keymap on language selection
Stoiko Ivanov
s.ivanov at proxmox.com
Mon Jul 20 18:31:16 CEST 2020
This is an enhancement for #2804
Having a shell waiting on vt3, it improves user experience if it has the
same keyboard map as the X11 installer.
This is accomplished by setting the contents of '/etc/default/keyboard' and
then running `setupcon`. Simply calling `loadkeys` would not work, since the
keymaps in debian are generated from the x11 definitions by ckbcomp and then
saved in '/etc/console-setup/'.
Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
v1->v2:
* incorporated Thomas' feedback, making the whitespace prefix stripping more
robust (Thanks!)
* took a look at the generated file instead of only testing the keyboard layout
(hence the 'gm' flags for the substition)
proxinstall | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/proxinstall b/proxinstall
index 556c509..edbb10e 100755
--- a/proxinstall
+++ b/proxinstall
@@ -2668,8 +2668,19 @@ sub create_country_view {
if (my $kmap = $cmap->{kmaphash}->{$sel}) {
my $xkmap = $cmap->{kmap}->{$kmap}->{x11};
my $xvar = $cmap->{kmap}->{$kmap}->{x11var};
- syscmd ("setxkbmap $xkmap $xvar") if !$opt_testmode;
$keymap = $kmap;
+
+ if (! $opt_testmode) {
+ syscmd ("setxkbmap $xkmap $xvar");
+ my $kbd_config = qq{
+ XKBLAYOUT="$xkmap"
+ XKBVARIANT="$xvar"
+ BACKSPACE="guess"
+ };
+ $kbd_config =~ s/^\s+//gm;
+ write_config($kbd_config, '/etc/default/keyboard');
+ syscmd ("setupcon");
+ }
}
});
--
2.20.1
More information about the pve-devel
mailing list