#!/bin/bash # var to determine package source PKGSRC=net date > /etc/vagrant_box_build_time # launch automated install su -c 'aif -p automatic -c aif.cfg' # copy over the vbox version file /bin/cp -f /root/.vbox_version /mnt/root/.vbox_version # chroot into the new system mount -o bind /dev /mnt/dev mount -o bind /sys /mnt/sys mount -t proc none /mnt/proc chroot /mnt < /etc/sudoers root ALL=(ALL) ALL %wheel ALL=(ALL) NOPASSWD: ALL EOF # set up user accounts passwd</dev/null # set up networking [[ $PKGSRC == 'net' ]] && sed -i 's/^\(interface=*\)/\1eth0/' /etc/rc.conf # leave the chroot ENDCHROOT # take down network to prevent next postinstall.sh from starting too soon /etc/rc.d/network stop # and reboot! reboot