From 499099d7c324fa36fd73c9e3ea978794b564434d Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Fri, 9 Jun 2023 12:13:53 +0200 Subject: autologin: call setterm --resize only when supported --- share/customize-autologin.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/customize-autologin.sh b/share/customize-autologin.sh index 5f87168..da386b5 100755 --- a/share/customize-autologin.sh +++ b/share/customize-autologin.sh @@ -11,7 +11,8 @@ set -eu TARGET=$1 -cat >"$TARGET/etc/profile.d/resize_serial_term.sh" <<'EOF' +if dpkg --compare-versions "$(dpkg-query --root "$TARGET" -f '${Version}' -W util-linux)" ge 2.33; then + cat >"$TARGET/etc/profile.d/resize_serial_term.sh" <<'EOF' if test -n "${TERM-}" && test -n "${PS1-}"; then case "$(tty)" in /dev/tty[0-9]*) @@ -23,6 +24,7 @@ if test -n "${TERM-}" && test -n "${PS1-}"; then esac fi EOF +fi if test "$(dpkg-query --root "$TARGET" -f '${db:Status-Status}' -W systemd-sysv 2>/dev/null)" = installed; then UNIT=serial-getty@.service -- cgit v1.2.3