]> git.proxmox.com Git - pve-installer.git/blobdiff - unconfigured.sh
unconfigured: reboot cleaner, avoid sysrq if possible
[pve-installer.git] / unconfigured.sh
index 27a08a8d4a48f03fee3129945da53b42649d568f..4b61c81de5188db6bb8144647cc266613faccfc0 100755 (executable)
@@ -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 -f
+    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
 }
@@ -63,6 +67,9 @@ real_reboot() {
         echo "done."
     fi
 
+    # just to be sure
+    sync
+
     umount -l -n /target >/dev/null 2>&1
     umount -l -n /dev/pts
     umount -l -n /dev/shm