Alternate keyboard layout regression in late December system-image update

I performed a sudo apt update && sudo apt upgrade sometime this past week (I believe after my December 22 update was still working) which is not applying the XBVARIANT set in /etc/default/keyboard (via sudo dpkg-reconfigure keyboard-configuration). Any pointers on tracing down the regression?

Note: once I boot into sway, it honors the layout set in the sway config

Indeed the keyboard-configuration and along with it the console-setup package saw some new versions in December. Maybe try downgrading to 1.212 and see if that fixes the problem? I’m still on the 1.212 versions myself and do not see the problem. These are the packages that might be responsible and which you might try downgrading:

  • console-setup
  • console-setup-linux
  • keyboard-configuration

I’ll investigate this myself within the next five days (that’s the time we have to file an RC bug before the package migrates to testing).

On the other hand, if you are still at console-setup 1.213 and not on console-setup 1.214, then maybe this is the bug that you see:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1027247

That bug is fixed in 1.214, so if you have 1.213 install, maybe try upgrading instead of downgrading.

Or maybe the problem is elsewhere but this would be my first hunch. :slight_smile:

Thanks for the pointers! I tried both 1.215 (latest as of this) and rolling back to 1.215, but still experience a QWERTY keyboard on the console when I expect a Colemak (as specified and confirmed via sudo dpkg-reconfigure keyboard-configuration).

Rolling back to version 1.212 required me to pull the debs from https://snapshot.debian.org. I believe this is because older versions of “unstable” branch packages are not archived, so they cannot be installed by specifying the version to apt upgrade as the version cannot be found.

Aside: the 1.215 update was included in a larger system update which appeared to lock up the computer (screen frozen with mouse non-responsive). I wait a while and then issue a “reset” via the circle keyboard menu. This has happened once in a while with updates over the last few weeks.

I was able to get the console on the correct keyboard layout by manually executing sudo /lib/console-setup/console-setup.sh in a terminal console. I found that this is supposed to be run every boot by the onshot systemd service console-setup.service.

journalctl --unit console-setup.service output indicates there are some errors when it ran in the past (presumably under the 1.212 or 1.213 versions)

-- Boot 8893594801ec4532944d79e9f3aec6db --
Dec 30 13:03:42 reform systemd[1]: Starting Set console font and keymap...
Dec 30 13:03:46 reform console-setup.sh[441]: /usr/bin/setupcon: 999: cannot open /tmp/tmpkbd.pBPAHQ: >
Dec 30 13:03:46 reform systemd[1]: console-setup.service: Main process exited, code=exited, status=1/F>
Dec 30 13:03:46 reform systemd[1]: console-setup.service: Failed with result 'exit-code'.
Dec 30 13:03:46 reform systemd[1]: Failed to start Set console font and keymap.
Dec 30 13:03:46 reform systemd[1]: console-setup.service: Consumed 2.153s CPU time.

After updating to 1.215 and adding set -x to /lib/console-setup/console-setup.sh the setupcon portion doesn’t even run:

-- Boot e9c90347878f478ca9b0dc1ff4267af5 --
Dec 30 18:38:44 reform systemd[1]: Starting Set console font and keymap...
Dec 30 18:38:44 reform console-setup.sh[442]: + do_configure=no
Dec 30 18:38:44 reform console-setup.sh[444]: + uname
Dec 30 18:38:44 reform console-setup.sh[442]: + [ ! -f /run/console-setup/boot_completed ]
Dec 30 18:38:44 reform console-setup.sh[442]: + mkdir -p /run/console-setup
Dec 30 18:38:44 reform console-setup.sh[442]: +
Dec 30 18:38:44 reform console-setup.sh[442]: + [ /etc/console-setup/cached_setup_terminal.sh -nt /etc>
Dec 30 18:38:44 reform console-setup.sh[442]: + [ /etc/console-setup/cached_setup_terminal.sh -nt /etc>
Dec 30 18:38:44 reform console-setup.sh[442]: + [ no = no ]
Dec 30 18:38:44 reform console-setup.sh[442]: + :
Dec 30 18:38:44 reform systemd[1]: Finished Set console font and keymap.

systemctl restart console-setup.service shows the following log indicating setupcon behavior may have changed which is not compatible with the systemd service environment. Emphasis added:

Dec 30 19:28:45 reform systemd[1]: console-setup.service: Deactivated successfully.
Dec 30 19:28:45 reform systemd[1]: Stopped Set console font and keymap.
Dec 30 19:28:45 reform systemd[1]: Stopping Set console font and keymap...
Dec 30 19:28:45 reform systemd[1]: Starting Set console font and keymap...
Dec 30 19:28:45 reform console-setup.sh[2341]: + do_configure=no
Dec 30 19:28:45 reform console-setup.sh[2342]: + uname
Dec 30 19:28:45 reform console-setup.sh[2341]: + [ ! -f /run/console-setup/boot_completed ]
Dec 30 19:28:45 reform console-setup.sh[2341]: + do_configure=yes
Dec 30 19:28:45 reform console-setup.sh[2341]: + mkdir -p /run/console-setup
Dec 30 19:28:45 reform console-setup.sh[2341]: +
Dec 30 19:28:45 reform console-setup.sh[2341]: + [ /etc/console-setup/cached_setup_terminal.sh -nt /etc/default/keyboard ]
Dec 30 19:28:45 reform console-setup.sh[2341]: + [ /etc/console-setup/cached_setup_terminal.sh -nt /etc/default/console-setup ]
Dec 30 19:28:45 reform console-setup.sh[2341]: + [ yes = no ]
Dec 30 19:28:45 reform console-setup.sh[2341]: + [ -f /etc/default/locale ]
Dec 30 19:28:45 reform console-setup.sh[2341]: + . /etc/default/locale
Dec 30 19:28:45 reform console-setup.sh[2341]: + LANG=en_US.UTF-8
Dec 30 19:28:45 reform console-setup.sh[2341]: + export LANG
Dec 30 19:28:45 reform console-setup.sh[2341]: + setupcon --save
Dec 30 19:28:46 reform console-setup.sh[2344]: **setupcon: We are not on the console, the console is left unconfigured.**
Dec 30 19:28:46 reform systemd[1]: Finished Set console font and keymap.

This appears to be explicit as /lib/console-setup/console-setup.sh contains the following, so I am not sure when setupcon would run…

        # Skip only the first time (i.e. when the system boots)
        [ ! -f /run/console-setup/boot_completed ] || do_configure=yes
        mkdir -p /run/console-setup
        > /run/console-setup/boot_completed

Workaround found: Setting the default value of do_configure to yes (at the top of the script) will cause the script to always execute the setupcon and the keyboard layout is set as expected.

I just did a full apt update, apt upgrade and wanted to report that I cannot reproduce your problem but I see you already diagnosed it!

Can you file this as a bug against the console-setup package on the Debian BTS?