diff -Nru console-setup-1.142ubuntu8/CHANGES console-setup-1.142ubuntu9/CHANGES --- console-setup-1.142ubuntu8/CHANGES 2017-08-21 16:15:49.000000000 +0100 +++ console-setup-1.142ubuntu9/CHANGES 2017-08-22 13:57:15.000000000 +0100 @@ -1,3 +1,15 @@ +console-setup (1.142ubuntu9) UNRELEASED; urgency=medium + + * debian/console-setup.postinst: Replace the checking of fgconsole in [1-6] + with checking if fgconsole is a tty according to logind. The previous + assumption was that a graphical environment would be on vt7, which isn't + true with gnome-shell any more. + * debian/console-setup.postinst, debian/keyboard-configuration.postinst: + Don't call setupcon --force -k any more - it breaks wayland sessions (LP: + #1710637) + + -- Iain Lane Tue, 22 Aug 2017 13:57:15 +0100 + console-setup (1.142ubuntu8) artful; urgency=medium * Drop upstart system jobs. diff -Nru console-setup-1.142ubuntu8/debian/changelog console-setup-1.142ubuntu9/debian/changelog --- console-setup-1.142ubuntu8/debian/changelog 2017-08-21 16:15:49.000000000 +0100 +++ console-setup-1.142ubuntu9/debian/changelog 2017-08-22 13:57:15.000000000 +0100 @@ -1,3 +1,15 @@ +console-setup (1.142ubuntu9) UNRELEASED; urgency=medium + + * debian/console-setup.postinst: Replace the checking of fgconsole in [1-6] + with checking if fgconsole is a tty according to logind. The previous + assumption was that a graphical environment would be on vt7, which isn't + true with gnome-shell any more. + * debian/console-setup.postinst, debian/keyboard-configuration.postinst: + Don't call setupcon --force -k any more - it breaks wayland sessions (LP: + #1710637) + + -- Iain Lane Tue, 22 Aug 2017 13:57:15 +0100 + console-setup (1.142ubuntu8) artful; urgency=medium * Drop upstart system jobs. diff -Nru console-setup-1.142ubuntu8/debian/console-setup.postinst console-setup-1.142ubuntu9/debian/console-setup.postinst --- console-setup-1.142ubuntu8/debian/console-setup.postinst 2016-09-26 13:24:24.000000000 +0100 +++ console-setup-1.142ubuntu9/debian/console-setup.postinst 2017-08-22 13:57:15.000000000 +0100 @@ -130,16 +130,43 @@ # We redirect the output so that postinst does not block when ScrollLock is on # This works even if we are not on the console setupcon --save-only || true +HAS_RUN_SETUPCON=no if type plymouth >/dev/null && plymouth --ping; then # setting the keymap breaks with plymouth in raw mode, and setting the # font will currently also break if on vgacon : -elif [ -d /lib/debian-installer ] || \ - expr "$(fgconsole 2>/dev/null || true)" : '[1-6]$' >/dev/null; then + +elif [ -d /lib/debian-installer ]; then setupcon --force -else - # setting the font corrupts X - setupcon --force -k + HAS_RUN_SETUPCON=yes +fi + +FGCONSOLE=$(fgconsole 2>/dev/null || true) +SESSIONS=$(loginctl --no-legend --no-pager list-sessions 2>/dev/null | awk '{print $1}' || true) + +# only do setupcon --force if we're on a tty +if [ -n "${FGCONSOLE}" ] && [ -n "${SESSIONS}" ]; then + for session in ${SESSIONS}; do + vt=$(loginctl \ + --no-legend \ + --no-pager \ + --value \ + -p VTNr \ + -p Type \ + show-session \ + "${session}" 2>/dev/null | tr '\n' ' ' || true) + echo "${vt}" | while read -r vtnr type; do + if [ -n "${vtnr}" ] && [ "${vtnr}" -eq "${FGCONSOLE}" ]; then + if [ -n "${type}" ] && [ "${type}" = "tty" ]; then + setupcon --force + HAS_RUN_SETUPCON=yes + fi + fi + done + done +fi + +if [ "${HAS_RUN_SETUPCON}" = "no" ]; then cat >&2 </dev/null; then setxkbmap -option '' -model "$model" "$layout" "$variant" "$options" || true # setting the font corrupts X + # setting up the keyboard breaks wayland if type setupcon >/dev/null 2>&1; then setupcon --save-only - setupcon --force -k cat >&2 </dev/null; then setxkbmap -option '' -model "$model" "$layout" "$variant" "$options" || true # setting the font corrupts X + # setting up the keyboard breaks wayland if type setupcon >/dev/null 2>&1; then setupcon --save-only - setupcon --force -k cat >&2 <