NanoBSD

Not sure if NanoBSD can be discussed here since certain derivativates are deemed off-topic.... but I'll ask anyway...

I've seen NanoBSD mentioned quite regularly but have no real idea about what it is. Can I create a NanoBSD build and install it on a separate partition and boot it up using Grub, just so that I can
find out something about it? And can I boot it up via PXE?
 
I have built NanoBSD for microSD, SD Card, USB stick and Hard Drive.

You need to specify in your own custom.cfg what medium you are using. NANO_DRIVE= is the directive.

Here is a sample of what I use for my FreeBSD WAP on a Checkpoint U5
/usr/src/tools/tools/nanobsd/checkpoint/checkpoint.cfg
Code:
NANO_ARCH=i386
NANO_KERNEL=GENERIC
NANO_DRIVE=ada0
NANO_NAME=checkpoint
NANO_BOOTLOADER="/boot/boot0"
NANO_BOOT_MBR="/boot/boot0"
NANO_BOOT0CFG="-o packet -s 2 ${NANO_DRIVE}"
customize_cmd cust_pkgng
NANO_PACKAGE_LIST="pkg dnsmasq"

. common        # Pull in common definitions, keep last
I use a modified 'common' file in the same directory.
 
I should mention that the handbook is dated on this topic. Your best approach is to investigate the /tools/tools/nanobsd/embedded/ directory.
This is work that uses the top level scripts but has a heirachy of its own.
On top of that it adds support for NanoBSD on supported Arm boards as you can see from the cfg files it that directory.

After reading the NanoBSD handbook article, checkout this file for embedded usage:
/usr/src/tools/tools/nanobsd/embedded/README
All the work is nicely documented so you must read the comments too.
Especially nanobsd.sh, default.sh and common

There is also a tweak needed for cust_pkgng function. Here is the PR report and fix:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219405
 
  • Thanks
Reactions: gfx
The handbook is really dated regarding NanoBSD, specially the example on section 2.4.3 - Using nc(1) - that should be adjusted to reflect the new behavior of nc regarding the disconnection after reaching EOF, both on server and client side.

That example, updated to FreeBSD 11, should be:
Code:
myhost# nc -l -N 2222 < _.disk.image

# nc -d myhost 2222 | sh update

Note that we are calling update instead of updatep1 or updatep2 because update is capable of determining automatically which slice should be overwritten.
 
Back
Top