Using beadm to multi-boot

Installing FreeBSD or NextBSD on top of clean FreeBSD 10.x/11.x with zfs boot environments (beadm).

Mashed together from:

zfs set mountpoint=none zroot/usr/src
zfs create -o mountpoint=/usr/src zroot/usr/src_nextbsd
zfs set compression=gzip-9 zroot/usr/src_nextbsd
# This will take a while, open another terminal
git clone http://github.com/nextbsd/nextbsd /usr/src/
setenv BE nextbsd
setenv BE freebsd11
setenv DESTDIR /mnt/be/$BE
mkdir -p $DESTDIR
beadm create $BE
beadm mount $BE $DESTDIR
#
# setenv KERN GENERIC
setenv KERN I7

make buildworld
make buildkernel KERNCONF=$KERN
make installkernel KERNCONF=$KERN DESTDIR=$DESTDIR
make installworld  DESTDIR=$DESTDIR
mergemaster -Ui -m /usr/src/ -D $DESTDIR
cp /etc/resolv.conf $DESTDIR/etc/resolv.conf
mount -t devfs devfs $DESTDIR/dev/
chroot $DESTDIR
# Do anything you need
beadm umount $BE
beadm activate $BE