Add NFS_ROOT kernel option, so that we can mount a root file system over NFS.
When using mktemp, make sure the path of the file is in /tmp.
This allows us to run the installer when the root file system is read-only.
Exclude debug kernel from installer ISO.
Create some directories in the STAGEDIR used to create base.ufs.uzip
and in the ISODIR used to create the install ISO image.
By creating these directories in the installer, we can have a read-only
root file system, eliminating the need to have a MFS root during the install.

diff --git a/build/create_iso.sh b/build/create_iso.sh
index dd17633..d614c97 100644
--- a/build/create_iso.sh
+++ b/build/create_iso.sh
@@ -49,7 +49,14 @@ main()

 	cd "$AVATAR_ROOT"

-	mkdir -p ${STAGEDIR}/dev ${ISODIR}/data
+	mkdir -p ${STAGEDIR}/dev
+	mkdir -p ${STAGEDIR}/.mount
+
+	mkdir -p ${ISODIR}/data
+	mkdir -p ${ISODIR}/dev
+	mkdir -p ${ISODIR}/.mount
+	mkdir -p ${ISODIR}/mnt
+	mkdir -p ${ISODIR}/tmp

 	# Create a quick and dirty nano image from the world tree
 	mkdir -p ${INSTALLUFSDIR}

commit 552cc42847831a8c5516cfb6824af5da39ffc008
Author: Craig Rodrigues <rodrigc@ixsystems.com>
Date:   Thu Jul 11 14:11:53 2013 -0700

    Exclude debug kernel from installer ISO.

diff --git a/build/create_iso.sh b/build/create_iso.sh
index 2c15f9e..dd17633 100644
--- a/build/create_iso.sh
+++ b/build/create_iso.sh
@@ -57,7 +57,8 @@ main()

 	# copy /rescue and /boot from the image to the iso
 	tar -cf - -C ${INSTALLUFSDIR} rescue | tar -xf - -C ${STAGEDIR}
-	tar -cf - -C ${INSTALLUFSDIR} boot | tar -xf - -C ${ISODIR}
+	tar -cf - -C ${INSTALLUFSDIR} rescue | tar -xf - -C ${ISODIR}
+	tar -cf - -C ${INSTALLUFSDIR} boot --exclude boot/kernel-debug | tar -xf - -C ${ISODIR}
 	ln -f $IMGFILE $ISODIR/$NANO_LABEL-$NANO_ARCH_HUMANIZED.img.xz

 	echo "#/dev/md0 / ufs ro 0 0" > ${INSTALLUFSDIR}/etc/fstab

commit bb731d0c5778cd6f75e907c3ca0c61dc30900281
Author: Craig Rodrigues <rodrigc@ixsystems.com>
Date:   Thu Jul 11 14:09:21 2013 -0700

    When using mktemp, make sure the path of the file is in /tmp.
    This allows us to run the installer when the root file system is read-only.

diff --git a/nanobsd/Installer/bin/install_worker.sh b/nanobsd/Installer/bin/install_worker.sh
index 13e6430..62c3559 100755
--- a/nanobsd/Installer/bin/install_worker.sh
+++ b/nanobsd/Installer/bin/install_worker.sh
@@ -97,7 +97,7 @@ then
 	error "Could not load the avatar.conf file from the destination directory ($INSTALL_DESTDIR/etc)"
 fi

-if ! stage_log=$(mktemp install_worker.XXXXXX)
+if ! stage_log=$(mktemp /tmp/install_worker.XXXXXX)
 then
 	exit 1
 fi
diff --git a/nanobsd/Installer/lib/functions.sh b/nanobsd/Installer/lib/functions.sh
index 737c3f0..ea868d3 100644
--- a/nanobsd/Installer/lib/functions.sh
+++ b/nanobsd/Installer/lib/functions.sh
@@ -190,7 +190,7 @@ source_conf()
 		return 1
 	fi

-	if ! tmpconf=$(mktemp conf.XXXXXX)
+	if ! tmpconf=$(mktemp /tmp/conf.XXXXXX)
 	then
 		return 1
 	fi

commit f2872191699625a1e7373fe3d185ab7fb181b5c3
Author: Craig Rodrigues <rodrigc@ixsystems.com>
Date:   Thu Jul 11 14:07:18 2013 -0700

    Add NFS_ROOT kernel option, so that we can mount a root file system over NFS.

diff --git a/nanobsd/TRUENAS.amd64 b/nanobsd/TRUENAS.amd64
index 1204c6e..be02032 100644
--- a/nanobsd/TRUENAS.amd64
+++ b/nanobsd/TRUENAS.amd64
@@ -38,6 +38,7 @@ options 	MD_ROOT			# MD is a potential root device
 options 	NFSCL			# New Network Filesystem Client
 options 	NFSD			# New Network Filesystem Server
 options 	NFSLOCKD		# Network Lock Manager
+options 	NFS_ROOT		# NFS usable as /, requires NFSCL
 options 	MSDOSFS			# MSDOS Filesystem
 options 	CD9660			# ISO 9660 Filesystem
 options 	PROCFS			# Process filesystem (requires PSEUDOFS)