594167
From 70ff2f68c1cf9bdfe79ab4719ee0a051bbcb22eb Mon Sep 17 00:00:00 2001
594167
From: Frantisek Sumsal <frantisek@sumsal.cz>
594167
Date: Sun, 17 Apr 2022 19:49:17 +0200
594167
Subject: [PATCH] test: resize the terminal automagically with
594167
 INTERACTIVE_DEBUG=yes
594167
594167
(cherry picked from commit 17082e8ac1b5335465876d100774893ba735fca4)
594167
594167
Related: #2087652
594167
---
594167
 test/test-functions | 12 +++++-------
594167
 1 file changed, 5 insertions(+), 7 deletions(-)
594167
594167
diff --git a/test/test-functions b/test/test-functions
594167
index 9e171cba30..42ad16050c 100644
594167
--- a/test/test-functions
594167
+++ b/test/test-functions
594167
@@ -1678,14 +1678,12 @@ install_debug_tools() {
594167
         local getty_override="${initdir:?}/etc/systemd/system/serial-getty@.service.d"
594167
         mkdir -p "$getty_override"
594167
         echo -e "[Service]\nEnvironment=TERM=linux" >"$getty_override/default-TERM.conf"
594167
+        echo 'export TERM=linux' >>"$initdir/etc/profile"
594167
 
594167
-        cat >"$initdir/etc/motd" <
594167
-To adjust the terminal size use:
594167
-    export COLUMNS=xx
594167
-    export LINES=yy
594167
-or
594167
-    stty cols xx rows yy
594167
-EOF
594167
+        if command -v resize >/dev/null; then
594167
+            image_install resize
594167
+            echo "resize" >>"$initdir/etc/profile"
594167
+        fi
594167
     fi
594167
 }
594167