Source string Read only

(itstool) path: callout/para

77/770
Context English State
Two image partitions: <literal>code#1</literal> and <literal>code#2</literal>.
The configuration file partition, which can be mounted under the <filename>/cfg</filename> directory at run time.
These partitions are normally mounted read-only.
The <filename>/etc</filename> and <filename>/var</filename> directories are <citerefentry><refentrytitle>md</refentrytitle><manvolnum>4</manvolnum></citerefentry> (malloc) disks.
The configuration file partition persists under the <filename>/cfg</filename> directory. It contains files for <filename>/etc</filename> directory and is briefly mounted read-only right after the system boot, therefore it is required to copy modified files from <filename>/etc</filename> back to the <filename>/cfg</filename> directory if changes are expected to persist after the system restarts.
Making Persistent Changes to <filename>/etc/resolv.conf</filename>
<prompt>#</prompt> <userinput>vi /etc/resolv.conf</userinput>
[...]
<prompt>#</prompt> <userinput>mount /cfg</userinput>
<prompt>#</prompt> <userinput>cp /etc/resolv.conf /cfg</userinput>
<prompt>#</prompt> <userinput>umount /cfg</userinput>
The partition containing <filename>/cfg</filename> should be mounted only at boot time and while overriding the configuration files.
Keeping <filename>/cfg</filename> mounted at all times is not a good idea, especially if the <application>NanoBSD</application> system runs off a mass storage medium that may be adversely affected by a large number of writes to the partition (like when the filesystem syncer flushes data to the system disks).
Building a NanoBSD Image
A <application>NanoBSD</application> image is built using a simple <filename>nanobsd.sh</filename> shell script, which can be found in the <filename><replaceable>/usr</replaceable>/src/tools/tools/nanobsd</filename> directory. This script creates an image, which can be copied on the storage medium using the <citerefentry><refentrytitle>dd</refentrytitle><manvolnum>1</manvolnum></citerefentry> utility.
The necessary commands to build a <application>NanoBSD</application> image are:
<prompt>#</prompt> <userinput>cd /usr/src/tools/tools/nanobsd</userinput> <co xml:id="nbsd-cd"/>
<prompt>#</prompt> <userinput>sh nanobsd.sh</userinput> <co xml:id="nbsd-sh"/>
<prompt>#</prompt> <userinput>cd /usr/obj/nanobsd.full</userinput> <co xml:id="nbsd-cd2"/>
<prompt>#</prompt> <userinput>dd if=_.disk.full of=/dev/da0 bs=64k</userinput> <co xml:id="nbsd-dd"/>
Change the current directory to the base directory of the <application>NanoBSD</application> build script.
Start the build process.
Change the current directory to the place where the built images are located.
Install <application>NanoBSD</application> onto the storage medium.
Customizing a NanoBSD Image
This is probably the most important and most interesting feature of <application>NanoBSD</application>. This is also where you will be spending most of the time when developing with <application>NanoBSD</application>.
Invocation of the following command will force the <filename>nanobsd.sh</filename> to read its configuration from <filename>myconf.nano</filename> located in the current directory:
<prompt>#</prompt> <userinput>sh nanobsd.sh -c myconf.nano</userinput>
Customization is done in two ways:
Configuration options
Custom functions
Configuration Options
buildworld
installworld
With configuration settings, it is possible to configure options passed to both the <_:buildtarget-1/> and <_:buildtarget-2/> stages of the <application>NanoBSD</application> build process, as well as internal options passed to the main build process of <application>NanoBSD</application>. 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 FreeBSD even more, until it will consists 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:
<literal>NANO_NAME</literal> — Name of build (used to construct the workdir names).
<literal>NANO_SRC</literal> — Path to the source tree used to build the image.

Loading…

No matching activity found.

Browse all component changes

Glossary

English English
No related strings found in the glossary.

Source information

Source string comment

(itstool) path: callout/para

Flags
read-only
Source string location
article.translate.xml:187
String age
a year ago
Source string age
a year ago
Translation file
articles/nanobsd.pot, string 35