#!/bin/bash set -ex # Sanitize the PATH export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/opt/bin" # be idempotent if ! test -e /native-install ; then exit 0 fi # f-i's /etc/fstab is more accurate than native-install's mv /etc/fstab /etc/fstab.freebsd # ttyv0 is sysinstall, ttyv1 is tar/cpio, ttyv3 is a chrooted shell # ttyv2 will be for native-install if ! /native-install /dev/ttyv2 2>/tmp/native-install.log ; then echo native-install exitted with non-zero status, spawning debug shell > /dev/ttyv2 bash /dev/ttyv2 2>/dev/ttyv2 fi # restore f-i's /etc/fstab, and add linprocfs mv /etc/fstab.freebsd /etc/fstab echo "null /proc linprocfs rw 0 0" >> /etc/fstab echo "null /sys linsyscfs rw 0 0" >> /etc/fstab echo "null /dev/fd fdescfs rw 0 0" >> /etc/fstab # cleanup rm -rf /stand /native-install `which $0`