]> git.proxmox.com Git - pve-installer.git/blobdiff - unconfigured.sh
zfs: fix wrong command reference in error message
[pve-installer.git] / unconfigured.sh
index 1109d916a5e20805a3049ae4fda38624d4e46c49..5123c96d20a99c56a5b88e062d6619fcf32af9eb 100755 (executable)
@@ -24,8 +24,8 @@ eject_and_reboot() {
     iso_dev=$(awk '/ iso9660 / {print $1}' /proc/mounts)
 
     for try in 5 4 3 2 1; do
-        echo "unmounting all"
-        if umount -a; then
+        echo "unmounting ISO"
+        if umount -v -a --types iso9660; then
             break
         fi
         if test -n $try; then
@@ -35,13 +35,17 @@ eject_and_reboot() {
     done
 
     if [ -n "$iso_dev" ]; then
-        eject "$iso_dev"
+        eject "$iso_dev" || true # cannot really work currently, don't care
     fi
 
     umount -l -n /dev
 
     echo "rebooting - please remove the ISO boot media"
     sleep 3
+    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
     echo b > /proc/sysrq-trigger
     sleep 100
 }
@@ -56,12 +60,15 @@ real_reboot() {
     # stop udev (release file handles)
     /etc/init.d/udev stop
 
-    echo -n "Deactivating swap..."
     swap=$(awk '/^\/dev\// { print $1 }' /proc/swaps);
     if [ -n "$swap" ]; then
-       swapoff "$swap"
+        echo -n "Deactivating swap..."
+        swapoff "$swap"
+        echo "done."
     fi
-    echo "done."
+
+    # just to be sure
+    sync
 
     umount -l -n /target >/dev/null 2>&1
     umount -l -n /dev/pts
@@ -188,12 +195,13 @@ 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 &
 
+echo "Starting the installer GUI - see tty2 (CTRL+ALT+F2) for any errors..."
 xinit -- -dpi "$DPI" >/dev/tty2 2>&1
 
 # just to be sure everything is on disk