Main index | Section 8 | Options |
The following options are available:
| Skip the build stages (both for kernel and world). |
| |
Specify the configuration file to use. | |
| Skip the code slice extraction. |
| Display usage information. |
| Skip the disk image build stage. |
| Skip the installkernel stage of the build. |
| Skip the buildkernel stage of the build. |
| Do not cleanup before each build stage. This suppresses the normal cleanup work done before the buildworld stage and adds -DNO_CLEAN to the make command line used for each build stage (world and kernel). |
| Make output more quiet. |
| Make output more verbose. |
| Skip the buildworld stage of the build. |
| Make native-xtools. |
The features of NanoBSD include:
The /etc and /var directories are md(4) (malloc backed) disks.
The configuration file partition persists under the /cfg directory. It contains files for /etc directory and is briefly mounted read-only right after the system boot, therefore it is required to copy modified files from /etc back to the /cfg directory if changes are expected to persist after the system restarts.
The necessary commands to build and install a NanoBSD image are:
cd /usr/src/tools/tools/nanobsd sh nanobsd.sh cd /usr/obj/nanobsd.full dd if=_.disk.full of=/dev/da0 bs=64k
Customization is done in two ways:
With configuration settings, it is possible to configure options passed to both the buildworld and installworld stages of the NanoBSD build process, as well as internal options passed to the main build process of NanoBSD. Through these options it is possible to cut the system down, so it will fit on as little as 64MB. You can use the configuration options to trim down the system even more, until it will consist of just the kernel and two or three files in the userland.
The configuration file consists of configuration options, which override the default values. The most important directives are:
NANO_NAME | |
Build name (used to construct the working directory names). | |
NANO_SRC | |
Path to the source tree used to build the image. | |
NANO_KERNEL | |
Name of the kernel configuration file used to build the kernel. | |
NANO_ARCH | |
Machine processor architecture to build. Defaults to output of uname -p. | |
NANO_BOOT0CFG | |
Controls the options passed to boot0cfg(8); these dictate boot0 behaviour. | |
NANO_BOOTLOADER | |
The boot0 loader to use relative to the NANO_WORLDDIR variable. This defaults to boot/boot0sio and should be overridden to boot/boot0 to provide a VGA console. | |
CONF_BUILD | |
Options passed to the buildworld stage of the build. | |
CONF_INSTALL | |
Options passed to the installworld stage of the build. | |
CONF_WORLD | |
Options passed to both the buildworld and installworld stages of the build. | |
FlashDevice | |
Defines the type of media to use. Check the FlashDevice.sub file for more details. | |
For more configuration options, please check the nanobsd.sh script.
To build NanoBSD image using the nanobsd.conf configuration file, use the following command:
sh nanobsd.sh -c nanobsd.conf
It is possible to fine-tune NanoBSD using shell functions in the configuration file. The following example illustrates the basic model of custom functions:
cust_foo () ( echo "bar=topless" > \ ${NANO_WORLDDIR}/etc/foo ) customize_cmd cust_foo
There are a few pre-defined customization functions ready for use:
cust_comconsole | Disables getty(8) on the virtual syscons(4) or vt(4) terminals ( /dev/ttyv*) and enables the use of the first serial port as the system console. |
cust_allow_ssh_root | |
Allow root to log in via sshd(8). | |
cust_install_files | Installs files from the nanobsd/Files directory, which contains some useful scripts for system administration. |
src/tools/tools/nanobsd | |
Base directory of the NanoBSD build script. | |
vi /etc/resolv.conf amp;... mount /cfg cp /etc/resolv.conf /cfg umount /cfg
A more useful example of a customization function is the following, which changes the default size of the /etc directory from 5MB to 30MB:
cust_etc_size () ( cd ${NANO_WORLDDIR}/conf echo 30000 > default/etc/md_size ) customize_cmd cust_etc_size
NANOBSD (8) | May 19, 2016 |
Main index | Section 8 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | Using Unix is the computing equivalent of listening only to music by David Cassidy | ” |
— Rob Pike |