From 165e9602376b1ee25d8599389e5ae5643dd9754c Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 18 Apr 2024 11:29:40 +0100 Subject: [PATCH] Fix keyboard configuration keyboard-configuration scripts ignores debconf settings if it doesn't detect an attached keyboard. Instead, it sets XKBOPTIONS to lv3:ralt_switch, which is not a desired option. It also considers an empty XKBOPTIONS string to be unset. This workaround sets it to a placeholder value which is removed later. dpkg-reconfigure is run so that debconf-get-selections prints the correct values. --- stage2/01-sys-tweaks/00-debconf | 2 ++ stage2/01-sys-tweaks/01-run.sh | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/stage2/01-sys-tweaks/00-debconf b/stage2/01-sys-tweaks/00-debconf index c13e3b1..884db93 100644 --- a/stage2/01-sys-tweaks/00-debconf +++ b/stage2/01-sys-tweaks/00-debconf @@ -24,3 +24,5 @@ keyboard-configuration keyboard-configuration/ctrl_alt_bksp boolean true # Keyboard layout: # Choices: English (UK), English (UK) - English (UK\, Colemak), English (UK) - English (UK\, Dvorak with UK punctuation), English (UK) - English (UK\, Dvorak), English (UK) - English (UK\, Macintosh international), English (UK) - English (UK\, Macintosh), English (UK) - English (UK\, extended WinKeys), English (UK) - English (UK\, international with dead keys), Other keyboard-configuration keyboard-configuration/variant select ${KEYBOARD_LAYOUT} +# for internal use +keyboard-configuration keyboard-configuration/optionscode string PLACEHOLDER diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 59988b2..897463e 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -67,3 +67,8 @@ usermod --pass='*' root EOF rm -f "${ROOTFS_DIR}/etc/ssh/"ssh_host_*_key* + +sed -i "s/PLACEHOLDER//" "${ROOTFS_DIR}/etc/default/keyboard" +on_chroot << EOF +DEBIAN_FRONTEND=noninteractive dpkg-reconfigure keyboard-configuration +EOF