]> git.proxmox.com Git - pve-installer.git/blobdiff - unconfigured.sh
unconfigured: allow pseudo terminals
[pve-installer.git] / unconfigured.sh
index 7d29a2ebfcc92f14ae078c27dc84eec7a5baea54..1d8cf7c8915fb161d0dd6ff66173e313b50bb346 100755 (executable)
@@ -40,6 +40,8 @@ real_reboot() {
 
     umount -l -n /target >/dev/null 2>&1
     umount -l -n /dev
+    umount -l -n /run
+    [ -d /sys/firmware/efi/efivars ] && umount -l -n /sys/firmware/efi/efivars
     umount -l -n /sys
     umount -l -n /proc
 
@@ -62,6 +64,11 @@ export SYSTEMD_IGNORE_CHROOT=1
 
 mount -n -t proc proc /proc
 mount -n -t sysfs sysfs /sys
+if [ -d /sys/firmware/efi ]; then
+    echo "EFI boot mode detected, mounting efivars filesystem"
+    mount -n -t efivarfs efivarfs /sys/firmware/efi/efivars
+fi
+mount -n -t tmpfs tmpfs /run
 
 parse_cmdline
 
@@ -81,6 +88,16 @@ export PREVLEVEL=N
 mkdir -p /dev/shm
 mount -t tmpfs tmpfs /dev/shm
 
+# allow pseudo terminals for debuggin in X
+mkdir -p /dev/pts
+mount -vt devpts devpts /dev/pts -o gid=5,mode=620
+
+if [ $proxdebug -ne 0 ]; then
+    echo "Dropping in debug shell inside chroot before starting installation"
+    echo "type exit or CTRL-D to start installation wizard"
+    debugsh
+fi
+
 # set the hostname 
 hostname proxmox