]> git.proxmox.com Git - pve-installer.git/blobdiff - unconfigured.sh
common: add ZFS `arc_max` installer setup option
[pve-installer.git] / unconfigured.sh
index 4b61c81de5188db6bb8144647cc266613faccfc0..ba9b9e33722df2d674eca9e171c0b8b322b6b0cc 100755 (executable)
@@ -6,11 +6,15 @@ 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
             ;;
         esac
     done;
@@ -42,7 +46,7 @@ eject_and_reboot() {
 
     echo "rebooting - please remove the ISO boot media"
     sleep 3
-    reboot -f
+    reboot -nf
     sleep 5
     echo "trigger reset system request"
     # we do not expect the reboot above to fail, so rather to avoid kpanic when pid 1 exits
@@ -132,6 +136,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
 
@@ -183,10 +188,12 @@ fi
 # we use a trimmed down debootstrap so make busybox tools available to compensate that
 busybox --install -s || true
 
+setupcon || echo "setupcon failed, TUI rendering might be garbled - $?"
+
 if [ $proxdebug -ne 0 ]; then
     /sbin/agetty -o '-p -- \\u' --noclear tty9 &
     printf "\nDropping in debug shell before starting installation\n"
-    echo "type exit or CTRL-D to continue and start the installation wizard"
+    echo "type 'exit' or press CTRL + D to continue and start the installation wizard"
     debugsh || true
 fi
 
@@ -195,13 +202,21 @@ echo -n "Attempting to get DHCP leases... "
 dhclient -v
 echo "done"
 
-echo -n "Starting chrony for opportunistic time-sync... "
+echo "Starting chrony for opportunistic time-sync... "
 chronyd || echo "starting chrony failed ($?)"
 
 echo "Starting a root shell on tty3."
 setsid /sbin/agetty -a root --noclear tty3 &
 
-xinit -- -dpi "$DPI" >/dev/tty2 2>&1
+/usr/bin/proxmox-low-level-installer dump-env
+
+if [ $proxtui -ne 0 ]; then
+    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