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.
This commit is contained in:
Serge Schneider 2024-04-18 11:29:40 +01:00
parent c70f96f146
commit 165e960237
2 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -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