]> git.proxmox.com Git - pve-installer.git/blobdiff - unconfigured.sh
unconfigured.sh: set terminal size for serial install
[pve-installer.git] / unconfigured.sh
index ce72da99298c9911250ab26d3104e768e6431410..a361a20c6f297aceceb5fadd6d2782a504823f70 100755 (executable)
@@ -6,11 +6,18 @@ trap "err_reboot" ERR
 
 parse_cmdline() {
     proxdebug=0
+    proxtui=0
     # shellcheck disable=SC2013 # per word splitting is wanted here
     for par in $(cat /proc/cmdline); do
         case $par in
             proxdebug)
-            proxdebug=1
+                proxdebug=1
+            ;;
+            proxtui)
+                proxtui=1
+            ;;
+            console=ttyS*)
+                serial=1
             ;;
         esac
     done;
@@ -132,6 +139,7 @@ if [ -d /sys/firmware/efi ]; then
     mount -n -t efivarfs efivarfs /sys/firmware/efi/efivars
 fi
 mount -n -t tmpfs tmpfs /run
+mkdir -p /run/proxmox-installer
 
 parse_cmdline
 
@@ -203,8 +211,20 @@ chronyd || echo "starting chrony failed ($?)"
 echo "Starting a root shell on tty3."
 setsid /sbin/agetty -a root --noclear tty3 &
 
-echo "Starting the installer GUI - see tty2 (CTRL+ALT+F2) for any errors..."
-xinit -- -dpi "$DPI" >/dev/tty2 2>&1
+/usr/bin/proxmox-low-level-installer dump-env
+
+if [ $proxtui -ne 0 ]; then
+    if [ "$serial" -ne 0 ]; then
+        echo "Setting terminal size to 80x24 for serial install"
+        stty columns 80 rows 25
+    fi
+
+    echo "Starting the TUI installer"
+    /usr/bin/proxmox-tui-installer 2>/dev/tty2
+else
+    echo "Starting the installer GUI - see tty2 (CTRL+ALT+F2) for any errors..."
+    xinit -- -dpi "$DPI" >/dev/tty2 2>&1
+fi
 
 # just to be sure everything is on disk
 sync