Whitespace cleanup (translators can ignore):
Wrap long lines, replace spaces with tabs and fix bad tag indentation.
This commit is contained in:
parent
e38d299c76
commit
f600cc91d0
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=44936
1 changed files with 127 additions and 109 deletions
|
@ -1,9 +1,10 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V5.0-Based Extension//EN"
|
||||
"http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd">
|
||||
<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en">
|
||||
<info><title>Introduction to NanoBSD</title>
|
||||
|
||||
<article xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
|
||||
xml:lang="en"> <info>
|
||||
<title>Introduction to NanoBSD</title>
|
||||
|
||||
<authorgroup>
|
||||
<author><personname><firstname>Daniel</firstname><surname>Gerzo</surname></personname></author>
|
||||
|
@ -24,10 +25,11 @@
|
|||
<releaseinfo>$FreeBSD$</releaseinfo>
|
||||
|
||||
<abstract>
|
||||
<para>This document provides information about
|
||||
the <application>NanoBSD</application> tools, which can be used to
|
||||
create &os; system images for embedded applications, suitable for
|
||||
use on a Compact Flash card (or other mass storage medium).</para>
|
||||
<para>This document provides information about the
|
||||
<application>NanoBSD</application> tools, which can be used to
|
||||
create &os; system images for embedded applications, suitable
|
||||
for use on a Compact Flash card (or other mass storage
|
||||
medium).</para>
|
||||
</abstract>
|
||||
</info>
|
||||
|
||||
|
@ -37,47 +39,50 @@
|
|||
<indexterm><primary>NanoBSD</primary></indexterm>
|
||||
|
||||
<para><application>NanoBSD</application> is a tool currently
|
||||
developed by &a.phk.email;. It creates a &os; system image for embedded
|
||||
applications, suitable for use on a Compact Flash card (or other
|
||||
mass storage medium).</para>
|
||||
developed by &a.phk.email;. It creates a &os; system image for
|
||||
embedded applications, suitable for use on a Compact Flash card
|
||||
(or other mass storage medium).</para>
|
||||
|
||||
<para>It can be used to build specialized install images, designed for
|
||||
easy installation and maintenance of systems commonly
|
||||
called <quote>computer appliances</quote>. Computer appliances have
|
||||
their hardware and software bundled in the product, which means all
|
||||
applications are pre-installed. The appliance is plugged into an
|
||||
existing network and can begin working (almost) immediately.</para>
|
||||
<para>It can be used to build specialized install images, designed
|
||||
for easy installation and maintenance of systems commonly called
|
||||
<quote>computer appliances</quote>. Computer appliances have
|
||||
their hardware and software bundled in the product, which means
|
||||
all applications are pre-installed. The appliance is plugged
|
||||
into an existing network and can begin working (almost)
|
||||
immediately.</para>
|
||||
|
||||
<para>The features of <application>NanoBSD</application> include:</para>
|
||||
<para>The features of <application>NanoBSD</application>
|
||||
include:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>Ports and packages work as in &os; — Every single
|
||||
application can be installed and used in
|
||||
a <application>NanoBSD</application> image, the same way as in
|
||||
application can be installed and used in a
|
||||
<application>NanoBSD</application> image, the same way as in
|
||||
&os;.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>No missing functionality — If it is possible to do
|
||||
something with &os;, it is possible to do the same thing with
|
||||
<application>NanoBSD</application>, unless the specific feature
|
||||
or features were explicitly removed from
|
||||
the <application>NanoBSD</application> image when it was
|
||||
something with &os;, it is possible to do the same thing
|
||||
with <application>NanoBSD</application>, unless the specific
|
||||
feature or features were explicitly removed from the
|
||||
<application>NanoBSD</application> image when it was
|
||||
created.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Everything is read-only at run-time — It is safe to
|
||||
pull the power-plug. There is no necessity to run
|
||||
&man.fsck.8; after a non-graceful shutdown of the system.</para>
|
||||
<para>Everything is read-only at run-time — It is safe
|
||||
to pull the power-plug. There is no necessity to run
|
||||
&man.fsck.8; after a non-graceful shutdown of the
|
||||
system.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Easy to build and customize — Making use of just one
|
||||
shell script and one configuration file it is possible to
|
||||
build reduced and customized images satisfying any arbitrary set of
|
||||
requirements.</para>
|
||||
<para>Easy to build and customize — Making use of just
|
||||
one shell script and one configuration file it is possible
|
||||
to build reduced and customized images satisfying any
|
||||
arbitrary set of requirements.</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</sect1>
|
||||
|
@ -121,7 +126,8 @@
|
|||
are expected to persist after the system restarts.</para>
|
||||
|
||||
<example>
|
||||
<title>Making Persistent Changes to <filename>/etc/resolv.conf</filename></title>
|
||||
<title>Making Persistent Changes to
|
||||
<filename>/etc/resolv.conf</filename></title>
|
||||
|
||||
<screen>&prompt.root; <userinput>vi /etc/resolv.conf</userinput>
|
||||
[...]
|
||||
|
@ -136,24 +142,24 @@
|
|||
only at boot time and while overriding the configuration
|
||||
files.</para>
|
||||
|
||||
<para>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).</para>
|
||||
<para>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).</para>
|
||||
</note>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Building a NanoBSD Image</title>
|
||||
|
||||
<para>A <application>NanoBSD</application> image is built using a
|
||||
simple <filename>nanobsd.sh</filename> shell script, which can
|
||||
be found in the
|
||||
<para>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 &man.dd.1; utility.</para>
|
||||
directory. This script creates an image, which can be copied
|
||||
on the storage medium using the &man.dd.1; utility.</para>
|
||||
|
||||
<para>The necessary commands to build a
|
||||
<application>NanoBSD</application> image are:</para>
|
||||
|
@ -165,8 +171,9 @@
|
|||
|
||||
<calloutlist>
|
||||
<callout arearefs="nbsd-cd">
|
||||
<para>Change the current directory to the base directory of the
|
||||
<application>NanoBSD</application> build script.</para>
|
||||
<para>Change the current directory to the base directory of
|
||||
the <application>NanoBSD</application> build
|
||||
script.</para>
|
||||
</callout>
|
||||
|
||||
<callout arearefs="nbsd-sh">
|
||||
|
@ -174,8 +181,8 @@
|
|||
</callout>
|
||||
|
||||
<callout arearefs="nbsd-cd2">
|
||||
<para>Change the current directory to the place where the built
|
||||
images are located.</para>
|
||||
<para>Change the current directory to the place where the
|
||||
built images are located.</para>
|
||||
</callout>
|
||||
|
||||
<callout arearefs="nbsd-dd">
|
||||
|
@ -215,20 +222,21 @@
|
|||
<sect3>
|
||||
<title>Configuration Options</title>
|
||||
|
||||
<para>With configuration settings, it is possible to configure options
|
||||
passed to both the <buildtarget>buildworld</buildtarget>
|
||||
and <buildtarget>installworld</buildtarget> 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 &os; even
|
||||
more, until it will consists of just the kernel and two or three
|
||||
files in the userland.</para>
|
||||
<para>With configuration settings, it is possible to configure
|
||||
options passed to both the
|
||||
<buildtarget>buildworld</buildtarget> and
|
||||
<buildtarget>installworld</buildtarget> 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 &os; even more, until it will consists of just the
|
||||
kernel and two or three files in the userland.</para>
|
||||
|
||||
<para>The configuration file consists of configuration options,
|
||||
which override the default values. The most important
|
||||
directives are:</para>
|
||||
<para>The configuration file consists of configuration
|
||||
options, which override the default values. The most
|
||||
important directives are:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
|
@ -237,35 +245,39 @@
|
|||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><literal>NANO_SRC</literal> — Path to the source
|
||||
tree used to build the image.</para>
|
||||
<para><literal>NANO_SRC</literal> — Path to the
|
||||
source tree used to build the image.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><literal>NANO_KERNEL</literal> — Name of kernel
|
||||
configuration file used to build kernel.</para>
|
||||
<para><literal>NANO_KERNEL</literal> — Name of
|
||||
kernel configuration file used to build kernel.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><literal>CONF_BUILD</literal> — Options passed
|
||||
to the <buildtarget>buildworld</buildtarget> stage of the build.</para>
|
||||
to the <buildtarget>buildworld</buildtarget> stage of
|
||||
the build.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><literal>CONF_INSTALL</literal> — Options passed
|
||||
to the <buildtarget>installworld</buildtarget> stage of the build.</para>
|
||||
<para><literal>CONF_INSTALL</literal> — Options
|
||||
passed to the <buildtarget>installworld</buildtarget>
|
||||
stage of the build.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><literal>CONF_WORLD</literal> — Options passed to both
|
||||
the <buildtarget>buildworld</buildtarget> and
|
||||
the <buildtarget>installworld</buildtarget> stage of the build.</para>
|
||||
<para><literal>CONF_WORLD</literal> — Options passed
|
||||
to both the <buildtarget>buildworld</buildtarget> and
|
||||
the <buildtarget>installworld</buildtarget> stage of the
|
||||
build.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><literal>FlashDevice</literal> — Defines what type of
|
||||
media to use. Check <filename>FlashDevice.sub</filename>
|
||||
for more details.</para>
|
||||
<para><literal>FlashDevice</literal> — Defines what
|
||||
type of media to use. Check
|
||||
<filename>FlashDevice.sub</filename> for more
|
||||
details.</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</sect3>
|
||||
|
@ -275,19 +287,18 @@
|
|||
|
||||
<para>It is possible to fine-tune
|
||||
<application>NanoBSD</application> using shell functions in
|
||||
the configuration file. The following example illustrates the
|
||||
basic model of custom functions:</para>
|
||||
the configuration file. The following example illustrates
|
||||
the basic model of custom functions:</para>
|
||||
|
||||
<programlisting>cust_foo () (
|
||||
<programlisting>cust_foo () (
|
||||
echo "bar=baz" > \
|
||||
${NANO_WORLDDIR}/etc/foo
|
||||
)
|
||||
customize_cmd cust_foo</programlisting>
|
||||
|
||||
<para>A more useful example of a customization function is the
|
||||
following, which changes the default size of the
|
||||
<filename>/etc</filename> directory
|
||||
from 5MB to 30MB:</para>
|
||||
<para>A more useful example of a customization function is the
|
||||
following, which changes the default size of the
|
||||
<filename>/etc</filename> directory from 5MB to 30MB:</para>
|
||||
|
||||
<programlisting>cust_etc_size () (
|
||||
cd ${NANO_WORLDDIR}/conf
|
||||
|
@ -295,20 +306,22 @@ customize_cmd cust_foo</programlisting>
|
|||
)
|
||||
customize_cmd cust_etc_size</programlisting>
|
||||
|
||||
<para>There are a few default pre-defined customization functions
|
||||
ready for use:</para>
|
||||
<para>There are a few default pre-defined customization
|
||||
functions ready for use:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><literal>cust_comconsole</literal> — Disables
|
||||
&man.getty.8; on the VGA devices
|
||||
(the <filename>/dev/ttyv*</filename> device nodes) and enables
|
||||
the use of the COM1 serial port as the system console.</para>
|
||||
&man.getty.8; on the VGA devices (the
|
||||
<filename>/dev/ttyv*</filename> device nodes) and
|
||||
enables the use of the COM1 serial port as the system
|
||||
console.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><literal>cust_allow_ssh_root</literal> — Allow
|
||||
<systemitem class="username">root</systemitem> to login via &man.sshd.8;.</para>
|
||||
<systemitem class="username">root</systemitem> to login
|
||||
via &man.sshd.8;.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
@ -324,9 +337,10 @@ customize_cmd cust_etc_size</programlisting>
|
|||
<sect3>
|
||||
<title>Adding Packages</title>
|
||||
|
||||
<para>Packages can be added to a <application>NanoBSD</application>
|
||||
image using a custom function. The following function will install
|
||||
all the packages located in
|
||||
<para>Packages can be added to a
|
||||
<application>NanoBSD</application> image using a custom
|
||||
function. The following function will install all the
|
||||
packages located in
|
||||
<filename>/usr/src/tools/tools/nanobsd/packages</filename>:</para>
|
||||
|
||||
<programlisting>install_packages () (
|
||||
|
@ -341,8 +355,9 @@ customize_cmd install_packages</programlisting>
|
|||
<sect3>
|
||||
<title>Configuration File Example</title>
|
||||
|
||||
<para>A complete example of a configuration file for building a
|
||||
custom <application>NanoBSD</application> image can be:</para>
|
||||
<para>A complete example of a configuration file for building
|
||||
a custom <application>NanoBSD</application> image can
|
||||
be:</para>
|
||||
|
||||
<programlisting>NANO_NAME=custom
|
||||
NANO_SRC=/usr/src
|
||||
|
@ -399,25 +414,27 @@ customize_cmd cust_nobeastie</programlisting>
|
|||
<sect2>
|
||||
<title>Updating NanoBSD</title>
|
||||
|
||||
<para>The update process of <application>NanoBSD</application> is
|
||||
relatively simple:</para>
|
||||
<para>The update process of <application>NanoBSD</application>
|
||||
is relatively simple:</para>
|
||||
|
||||
<procedure>
|
||||
<step>
|
||||
<para>Build a new <application>NanoBSD</application> image, as
|
||||
usual.</para>
|
||||
<para>Build a new <application>NanoBSD</application> image,
|
||||
as usual.</para>
|
||||
</step>
|
||||
|
||||
<step>
|
||||
<para>Upload the new image into an unused partition of a
|
||||
running <application>NanoBSD</application> appliance.</para>
|
||||
running <application>NanoBSD</application>
|
||||
appliance.</para>
|
||||
|
||||
<para>The most important difference of this step from the
|
||||
initial <application>NanoBSD</application> installation is that
|
||||
now instead of using <filename>_.disk.full</filename>
|
||||
(which contains an image of the entire disk),
|
||||
the <filename>_.disk.image</filename> image is installed (which
|
||||
contains an image of a single system partition).</para>
|
||||
initial <application>NanoBSD</application> installation is
|
||||
that now instead of using <filename>_.disk.full</filename>
|
||||
(which contains an image of the entire disk), the
|
||||
<filename>_.disk.image</filename> image is installed
|
||||
(which contains an image of a single system
|
||||
partition).</para>
|
||||
</step>
|
||||
|
||||
<step>
|
||||
|
@ -431,18 +448,18 @@ customize_cmd cust_nobeastie</programlisting>
|
|||
|
||||
<step>
|
||||
<para>If anything goes wrong, reboot back into the previous
|
||||
partition (which contains the old, working image), to restore system
|
||||
functionality as fast as possible. Fix any problems of the new
|
||||
build, and repeat the process.</para>
|
||||
partition (which contains the old, working image), to
|
||||
restore system functionality as fast as possible. Fix any
|
||||
problems of the new build, and repeat the process.</para>
|
||||
</step>
|
||||
</procedure>
|
||||
|
||||
<para>To install new image onto the running
|
||||
<application>NanoBSD</application> system, it is possible to use
|
||||
either the <filename>updatep1</filename> or
|
||||
<application>NanoBSD</application> system, it is possible to
|
||||
use either the <filename>updatep1</filename> or
|
||||
<filename>updatep2</filename> script located in the
|
||||
<filename>/root</filename> directory, depending
|
||||
from which partition is running the current system.</para>
|
||||
<filename>/root</filename> directory, depending from which
|
||||
partition is running the current system.</para>
|
||||
|
||||
<para>According to which services are available on host serving
|
||||
new <application>NanoBSD</application> image and what type of
|
||||
|
@ -471,8 +488,8 @@ get _.disk.image "| sh updatep1"</userinput></screen>
|
|||
<sect3>
|
||||
<title>Using &man.nc.1;</title>
|
||||
|
||||
<para>Try this example if the remote host is not running neither
|
||||
&man.ftpd.8; or &man.sshd.8; service:</para>
|
||||
<para>Try this example if the remote host is not running
|
||||
neither &man.ftpd.8; or &man.sshd.8; service:</para>
|
||||
|
||||
<procedure>
|
||||
<step>
|
||||
|
@ -488,6 +505,7 @@ get _.disk.image "| sh updatep1"</userinput></screen>
|
|||
firewall.</para>
|
||||
</note>
|
||||
</step>
|
||||
|
||||
<step>
|
||||
<para>Connect to the host serving new image and execute
|
||||
<filename>updatep1</filename> script:</para>
|
||||
|
|
Loading…
Reference in a new issue