I have re-invigorated my NanoBSD work with a fresh FreeBSD 12.1 build.
Here is
my Gist file of a very minimal NanoBSD. Use at your own risk as it is very stripped out.
I like to start minimal and add things back as needed.
This build creates a 768 Megabyte image file with dual OS slices for a USB device.
There is 180 Megabytes free on each OS slice.
You could slim this build even more with a custom kernconf.
So for this config you need to make a separate directory for the build file:
mkdir /usr/src/tools/tools/nanobsd/custom
Now copy the Gist file into
/usr/src/tools/tools/nanobsd/custom/custom.cfg
You run it with this command:
cd /usr/src/tools/tools/nanobsd/custom
sh ../nanobsd.sh -c custom.cfg
You also need (optionally) to create a directory for your desired packages:
mkdir /usr/src/tools/tools/nanobsd/Pkg
In this directory you must place any packages you want pre-installed.
They must be in the *.txz format and you must include all dependencies and put
pkg.txz in there as well.
You can fetch these packages from here:
Use the All directory and place the files in the
/usr/src/tools/tools/nanobsd/Pkg directory
I also include pre-built system config files in an overlay directory. So you need to create this:
mkdir /usr/src/tools/tools/nanobsd/custom/overlay
Treat this directory as your builds uppermost or "/" directory.
For a custom
rc.conf you need to build the directory structure:
mkdir /usr/src/tools/tools/nanobsd/custom/overlay/etc
Now create an rc.conf in this directory. It will be used in your NanoBSD build.
For
loader.conf
mkdir /usr/src/tools/tools/nanobsd/custom/overlay/boot
Now create your custom loader.conf in this directory.
As you can see from the config file the root user 'freebsd' password is created.
A sample
/usr/src/tools/tools/nanobsd/custom/overlay/etc/rc.conf
Code:
hostname="custom"
sshd_enable="YES"
dumpdev="NO"
ifconfig_DEFAULT="DHCP"
A sample
/usr/src/tools/tools/nanobsd/custom/overlay/boot/loader.conf