Merge pull request #25805 from yuwata/locale-xkb-save-vconsole
locale: also save X11 keyboard settings to /etc/vconsole.conf
This commit is contained in:
@@ -223,7 +223,7 @@ wait_vconsole_setup() {
|
||||
}
|
||||
|
||||
test_vc_keymap() {
|
||||
local i output
|
||||
local i output vc
|
||||
|
||||
if [[ -z "$(localectl list-keymaps)" ]]; then
|
||||
echo "No vconsole keymap installed, skipping test."
|
||||
@@ -240,14 +240,15 @@ test_vc_keymap() {
|
||||
# clear previous conversion from VC -> X11 keymap
|
||||
systemctl stop systemd-localed.service
|
||||
wait_vconsole_setup
|
||||
rm -f /etc/X11/xorg.conf.d/00-keyboard.conf /etc/default/keyboard
|
||||
rm -f /etc/vconsole.conf /etc/X11/xorg.conf.d/00-keyboard.conf /etc/default/keyboard
|
||||
|
||||
# set VC keymap
|
||||
assert_rc 0 localectl set-keymap "$i"
|
||||
output=$(localectl)
|
||||
|
||||
# check VC keymap
|
||||
assert_in "KEYMAP=$i" "$(cat /etc/vconsole.conf)"
|
||||
vc=$(cat /etc/vconsole.conf)
|
||||
assert_in "KEYMAP=$i" "$vc"
|
||||
assert_in "VC Keymap: $i" "$output"
|
||||
|
||||
# check VC -> X11 keymap conversion
|
||||
@@ -256,16 +257,31 @@ test_vc_keymap() {
|
||||
assert_in "X11 Model: pc105\+inet" "$output"
|
||||
assert_not_in "X11 Variant:" "$output"
|
||||
assert_in "X11 Options: terminate:ctrl_alt_bksp" "$output"
|
||||
|
||||
assert_in "XKB_LAYOUT=us" "$vc"
|
||||
assert_in "XKB_MODEL=pc105\+inet" "$vc"
|
||||
assert_not_in "XKB_VARIANT" "$vc"
|
||||
assert_in "XKB_OPTIONS=terminate:ctrl_alt_bksp" "$vc"
|
||||
elif [[ "$i" == "us-acentos" ]]; then
|
||||
assert_in "X11 Layout: us" "$output"
|
||||
assert_in 'X11 Model: pc105$' "$output"
|
||||
assert_in "X11 Variant: intl" "$output"
|
||||
assert_in "X11 Options: terminate:ctrl_alt_bksp" "$output"
|
||||
|
||||
assert_in "XKB_LAYOUT=us" "$vc"
|
||||
assert_in "XKB_MODEL=pc105$" "$vc"
|
||||
assert_in "XKB_VARIANT=intl" "$vc"
|
||||
assert_in "XKB_OPTIONS=terminate:ctrl_alt_bksp" "$vc"
|
||||
elif [[ "$i" =~ ^us-.* ]]; then
|
||||
assert_in "X11 Layout: .unset." "$output"
|
||||
assert_not_in "X11 Model:" "$output"
|
||||
assert_not_in "X11 Variant:" "$output"
|
||||
assert_not_in "X11 Options:" "$output"
|
||||
|
||||
assert_not_in "XKB_LAYOUT" "$vc"
|
||||
assert_not_in "XKB_MODEL" "$vc"
|
||||
assert_not_in "XKB_VARIANT" "$vc"
|
||||
assert_not_in "XKB_OPTIONS" "$vc"
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -304,6 +320,12 @@ XKBOPTIONS=terminate:ctrl_alt_bksp"
|
||||
assert_in 'Option "XkbModel" "pc105\+inet"' "$output"
|
||||
assert_in 'Option "XkbVariant" "intl"' "$output"
|
||||
assert_in 'Option "XkbOptions" "terminate:ctrl_alt_bksp"' "$output"
|
||||
|
||||
output=$(cat /etc/vconsole.conf)
|
||||
assert_in 'XKB_LAYOUT=us' "$output"
|
||||
assert_in 'XKB_MODEL=pc105\+inet' "$output"
|
||||
assert_in 'XKB_VARIANT=intl' "$output"
|
||||
assert_in 'XKB_OPTIONS=terminate:ctrl_alt_bksp' "$output"
|
||||
fi
|
||||
|
||||
output=$(localectl)
|
||||
@@ -328,6 +350,12 @@ XKBVARIANT=intl"
|
||||
assert_in 'Option "XkbModel" "pc105\+inet"' "$output"
|
||||
assert_in 'Option "XkbVariant" "intl"' "$output"
|
||||
assert_not_in 'Option "XkbOptions"' "$output"
|
||||
|
||||
output=$(cat /etc/vconsole.conf)
|
||||
assert_in 'XKB_LAYOUT=us' "$output"
|
||||
assert_in 'XKB_MODEL=pc105\+inet' "$output"
|
||||
assert_in 'XKB_VARIANT=intl' "$output"
|
||||
assert_not_in 'XKB_OPTIONS' "$output"
|
||||
fi
|
||||
|
||||
output=$(localectl)
|
||||
@@ -351,6 +379,12 @@ XKBMODEL=pc105+inet"
|
||||
assert_in 'Option "XkbModel" "pc105\+inet"' "$output"
|
||||
assert_not_in 'Option "XkbVariant"' "$output"
|
||||
assert_not_in 'Option "XkbOptions"' "$output"
|
||||
|
||||
output=$(cat /etc/vconsole.conf)
|
||||
assert_in 'XKB_LAYOUT=us' "$output"
|
||||
assert_in 'XKB_MODEL=pc105\+inet' "$output"
|
||||
assert_not_in 'XKB_VARIANT' "$output"
|
||||
assert_not_in 'XKB_OPTIONS' "$output"
|
||||
fi
|
||||
|
||||
output=$(localectl)
|
||||
@@ -373,6 +407,12 @@ XKBMODEL=pc105+inet"
|
||||
assert_not_in 'Option "XkbModel"' "$output"
|
||||
assert_not_in 'Option "XkbVariant"' "$output"
|
||||
assert_not_in 'Option "XkbOptions"' "$output"
|
||||
|
||||
output=$(cat /etc/vconsole.conf)
|
||||
assert_in 'XKB_LAYOUT=us' "$output"
|
||||
assert_not_in 'XKB_MODEL' "$output"
|
||||
assert_not_in 'XKB_VARIANT' "$output"
|
||||
assert_not_in 'XKB_OPTIONS' "$output"
|
||||
fi
|
||||
|
||||
output=$(localectl)
|
||||
@@ -383,7 +423,7 @@ XKBMODEL=pc105+inet"
|
||||
|
||||
# gets along without config file
|
||||
systemctl stop systemd-localed.service
|
||||
rm -f /etc/X11/xorg.conf.d/00-keyboard.conf /etc/default/keyboard
|
||||
rm -f /etc/vconsole.conf /etc/X11/xorg.conf.d/00-keyboard.conf /etc/default/keyboard
|
||||
output=$(localectl)
|
||||
assert_in "X11 Layout: .unset." "$output"
|
||||
assert_not_in "X11 Model:" "$output"
|
||||
|
||||
Reference in New Issue
Block a user