summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2023-06-09 12:13:53 +0200
committerHelmut Grohne <helmut@subdivi.de>2023-06-09 12:15:33 +0200
commit499099d7c324fa36fd73c9e3ea978794b564434d (patch)
treef3ada618a21561b9f135aeb01ab87ae936c0ec43
parent95c7df2d210c1033ff8c4e2b6408def1c5037a5b (diff)
downloaddebvm-499099d7c324fa36fd73c9e3ea978794b564434d.tar.gz
autologin: call setterm --resize only when supported
-rwxr-xr-xshare/customize-autologin.sh4
1 files changed, 3 insertions, 1 deletions
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