]> git.proxmox.com Git - pve-installer.git/blobdiff - unconfigured.sh
unconfigured: make agetty listen on tty9
[pve-installer.git] / unconfigured.sh
index ad5d20aff48b4363b1e2511bc010ed7cdca54a3e..3bf5367050cb1b5784a1e1ffa1a8139c3f81773c 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
 
@@ -57,8 +59,16 @@ echo "Starting Proxmox installation"
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
 
+# ensure udev isn't snippy and ignores our request
+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
 
@@ -75,6 +85,20 @@ export RUNLEVEL=S
 export PREVLEVEL=N
 /etc/init.d/udev start
 
+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
+    /sbin/agetty -o '-p -- \\u' --noclear tty9 &
+    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
 
@@ -95,6 +119,7 @@ fi
 
 echo "Installation done, rebooting... "
 #mdadm -S /dev/md0 >/dev/tty2 2>&1
+kill $(pidof dhclient) 2>&1 > /dev/null
 real_reboot
 
 # never reached