Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-doc
Path: blob/main/documentation/content/en/articles/nanobsd/_index.po
18096 views
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR The FreeBSD Project
# This file is distributed under the same license as the FreeBSD Documentation package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: FreeBSD Documentation VERSION\n"
"POT-Creation-Date: 2026-02-22 15:58+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:1
#: documentation/content/en/articles/nanobsd/_index.adoc:46
#, no-wrap
msgid "This document provides information about the NanoBSD tools, which can be used to create FreeBSD system images for embedded applications, suitable for use on a USB key, memory card or other mass storage media."
msgstr ""

#. type: Title ==
#: documentation/content/en/articles/nanobsd/_index.adoc:1
#: documentation/content/en/articles/nanobsd/_index.adoc:11
#: documentation/content/en/articles/nanobsd/_index.adoc:52
#, no-wrap
msgid "Introduction to NanoBSD"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:44
msgid "Abstract"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:48
msgid "'''"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:56
msgid ""
"NanoBSD is a tool developed by {phk} and now maintained by {imp}.  It "
"creates a FreeBSD system image for embedded applications, suitable for use "
"on a USB key, memory card or other mass storage media."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:60
msgid ""
"It can be used to build specialized install images, designed for easy "
"installation and maintenance of systems commonly called \"computer "
"appliances\".  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."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:62
msgid "The features of NanoBSD include:"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:64
msgid ""
"Ports and packages work as in FreeBSD - Every single application can be "
"installed and used in a NanoBSD image, the same way as in FreeBSD."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:65
msgid ""
"No missing functionality - If it is possible to do something with FreeBSD, "
"it is possible to do the same thing with NanoBSD, unless the specific "
"feature or features were explicitly removed from the NanoBSD image when it "
"was created."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:66
msgid ""
"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."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:67
msgid ""
"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."
msgstr ""

#. type: Title ==
#: documentation/content/en/articles/nanobsd/_index.adoc:69
#, no-wrap
msgid "NanoBSD Howto"
msgstr ""

#. type: Title ===
#: documentation/content/en/articles/nanobsd/_index.adoc:72
#, no-wrap
msgid "The Design of NanoBSD"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:76
msgid ""
"Once the image is present on the medium, it is possible to boot NanoBSD.  "
"The mass storage medium is divided into three parts by default:"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:78
msgid "Two image partitions: `code#1` and `code#2`."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:79
msgid ""
"The configuration file partition, which can be mounted under the "
"[.filename]#/cfg# directory at run time."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:81
msgid "These partitions are normally mounted read-only."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:83
msgid ""
"The [.filename]#/etc# and [.filename]#/var# directories are man:md[4] "
"(malloc) disks."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:86
msgid ""
"The configuration file partition persists under the [.filename]#/cfg# "
"directory.  It contains files for [.filename]#/etc# directory and is briefly "
"mounted read-only right after the system boot, therefore it is required to "
"copy modified files from [.filename]#/etc# back to the [.filename]#/cfg# "
"directory if changes are expected to persist after the system restarts."
msgstr ""

#. type: Block title
#: documentation/content/en/articles/nanobsd/_index.adoc:87
#, no-wrap
msgid "Making Persistent Changes to [.filename]#/etc/resolv.conf#"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:98
#, no-wrap
msgid ""
"# vi /etc/resolv.conf\n"
"[...]\n"
"# mount /cfg\n"
"# cp /etc/resolv.conf /cfg\n"
"# umount /cfg\n"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:105
msgid ""
"The partition containing [.filename]#/cfg# should be mounted only at boot "
"time and while overriding the configuration files."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:107
msgid ""
"Keeping [.filename]#/cfg# mounted at all times is not a good idea, "
"especially if the NanoBSD 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)."
msgstr ""

#. type: Title ===
#: documentation/content/en/articles/nanobsd/_index.adoc:109
#, no-wrap
msgid "Building a NanoBSD Image"
msgstr ""

#. type: delimited block = 4
#: documentation/content/en/articles/nanobsd/_index.adoc:113
msgid ""
"The source code of FreeBSD is required to build NanoBSD.  To obtain the "
"source code:"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:117
#, no-wrap
msgid "# git clone https://git.FreeBSD.org/src.git /usr/src\n"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:120
msgid ""
"For more details, follow the steps extref:{handbook}cutting-edge#updating-"
"src-obtaining-src[here]."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:123
msgid ""
"A NanoBSD image is built using a simple [.filename]#nanobsd.sh# shell "
"script, which can be found in the [.filename]#/usr/src/tools/tools/nanobsd# "
"directory.  This script creates an image, which can be copied on the storage "
"medium using the man:dd[1] utility."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:125
msgid "The necessary commands to build a NanoBSD image are:"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:132
#, no-wrap
msgid ""
"# cd /usr/src/tools/tools/nanobsd <.>\n"
"# sh nanobsd.sh <.>\n"
"# cd /usr/obj/nanobsd.full <.>\n"
"# dd if=_.disk.full of=/dev/da0 bs=64k <.>\n"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:135
msgid ""
"Change the current directory to the base directory of the NanoBSD build "
"script."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:137
msgid "Start the build process."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:139
msgid ""
"Change the current directory to the place where the built images are located."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:141
msgid "Install NanoBSD onto the storage medium."
msgstr ""

#. type: Title ====
#: documentation/content/en/articles/nanobsd/_index.adoc:142
#, no-wrap
msgid "Options When Building a NanoBSD Image"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:146
msgid ""
"When building a NanoBSD image, several build options can be passed to "
"[.filename]#nanobsd.sh# on the command line.  These options can have a "
"significant impact on the build process."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:148
msgid "Some options are for verbosity purposes:"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:150
msgid "`-h`: prints the help summary page."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:151
msgid "`-q`: makes output quieter."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:152
msgid "`-v`: makes output more verbose."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:155
msgid ""
"Some other options can be used to restrict the building process.  Sometimes "
"it is not necessary to rebuild everything from sources, especially if an "
"image has already been built, and only little change is made."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:157
msgid "`-k`: do not build the kernel."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:158
msgid "`-w`: do not build world."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:159
msgid "`-b`: do not build either kernel and world."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:160
msgid ""
"`-i`: do not build a disk image at all. As a file will not be created, it "
"will not be possible to man:dd[1] it to a storage media."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:161
msgid ""
"`-f`: do not build a disk image of the first partition (which is useful for "
"upgrade purposes)."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:162
msgid ""
"`-p`: do not prepare the image. Skip running customization and early-"
"customization scripts for incremental image refinement from world, kernel, "
"or packages."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:163
msgid ""
"`-n`: add `-DNO_CLEAN` to `buildworld`, `buildkernel`. Also, all the files "
"that have already been built in a previous run are kept."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:166
msgid ""
"A configuration file can be used to tweak as many elements as desired.  Load "
"it with `-c`"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:168
msgid "The last options are:"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:170
msgid ""
"`-K`: do not install a kernel. A disk image without a kernel will not be "
"able to achieve a normal boot sequence."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:171
msgid "`-W`: do not install world."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:172
msgid "`-B`: do not install either kernel and world."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:173
msgid ""
"`-I`: build a disk image from an existing build or install. Do not build or "
"install kernel, world, and the etc configuration file, just create the disk "
"image."
msgstr ""

#. type: Title ====
#: documentation/content/en/articles/nanobsd/_index.adoc:174
#, no-wrap
msgid "The Complete Image Building Process"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:179
msgid ""
"The complete image building process is going through a lot of steps.  The "
"exact steps taken will depend on the chosen options when starting the "
"script.  Assuming the script is run with no particular options, this is what "
"will happen."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:181
msgid ""
"`run_early_customize`: Commands that are defined in a supplied configuration "
"file."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:182
msgid ""
"`clean_build`: Just cleans the build environment by deleting the previously "
"built files."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:183
msgid ""
"`make_conf_build`: Assemble make.conf from the `CONF_WORLD` and `CONF_BUILD` "
"variables."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:184
msgid "`build_world`: Build world."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:185
msgid "`build_kernel`: Build the kernel files."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:186
msgid "`clean_world`: Clean the destination directory."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:187
msgid ""
"`make_conf_install`: Assemble make.conf from the `CONF_WORLD` and "
"`CONF_INSTALL` variables."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:188
msgid "`install_world`: Install all files built during `buildworld`."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:189
msgid ""
"`install_etc`: Install the necessary files in the [.filename]#/etc# "
"directory, based on the `make distribution` command."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:190
msgid ""
"`setup_nanobsd_etc`: The first configuration specific to NanoBSD takes place "
"at this stage. The [.filename]#/etc/diskless# is created and the root "
"filesystem is defined as read-only."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:191
msgid "`install_kernel`: The kernel and modules files are installed."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:192
msgid ""
"`run_customize`: All the customizing routines defined by the user will be "
"called."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:193
msgid ""
"`setup_nanobsd`: A special configuration directory layout is setup. The "
"[.filename]#/usr/local/etc# gets moved to [.filename]#/etc/local# and a "
"symbolic link is created back from [.filename]#/etc/local# to [.filename]#/"
"usr/local/etc#."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:194
msgid "`prune_usr`: The empty directories from [.filename]#/usr# are removed."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:195
msgid ""
"`run_late_customize`: The very last custom scripts can be run at this point."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:196
msgid "`fixup_before_diskimage`: List all installed files in a metalog."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:197
msgid ""
"`create_diskimage`: Creates the actual disk image, based on the disk "
"geometries provides parameters."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:198
msgid "`last_orders`: Does nothing for now."
msgstr ""

#. type: Title ===
#: documentation/content/en/articles/nanobsd/_index.adoc:199
#, no-wrap
msgid "Customizing a NanoBSD Image"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:203
msgid ""
"This is probably the most important and most interesting feature of "
"NanoBSD.  This is also where you will be spending most of the time when "
"developing with NanoBSD."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:205
msgid ""
"Invocation of the following command will force the [.filename]#nanobsd.sh# "
"to read its configuration from [.filename]#myconf.nano# located in the "
"current directory:"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:209
#, no-wrap
msgid "# sh nanobsd.sh -c myconf.nano\n"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:212
msgid "Customization is done in two ways:"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:214
msgid "Configuration options"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:215
msgid "Custom functions"
msgstr ""

#. type: Title ====
#: documentation/content/en/articles/nanobsd/_index.adoc:216
#, no-wrap
msgid "Configuration Options"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:221
msgid ""
"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 FreeBSD even more, until it will consists of just the kernel and "
"two or three files in the userland."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:224
msgid ""
"The configuration file consists of configuration options, which override the "
"default values.  The most important directives are:"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:226
msgid "`NANO_NAME` - Name of build (used to construct the workdir names)."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:227
msgid "`NANO_SRC` - Path to the source tree used to build the image."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:228
msgid "`NANO_KERNEL` - Name of kernel configuration file used to build kernel."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:229
msgid "`CONF_BUILD` - Options passed to the `buildworld` stage of the build."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:230
msgid ""
"`CONF_INSTALL` - Options passed to the `installworld` stage of the build."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:231
msgid ""
"`CONF_WORLD` - Options passed to both the `buildworld` and the "
"`installworld` stage of the build."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:232
msgid ""
"`FlashDevice` - Defines what type of media to use. Check "
"[.filename]#FlashDevice.sub# for more details."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:234
msgid ""
"There are many more configuration options that could be relevant depending "
"upon the kind of NanoBSD that is desired."
msgstr ""

#. type: Title =====
#: documentation/content/en/articles/nanobsd/_index.adoc:235
#, no-wrap
msgid "General Customization"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:238
msgid ""
"There are three stages, by design, at which it is possible to make changes "
"that affect the building process, just by setting up a variable in the "
"provided configuration file:"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:240
msgid "`run_early_customize`: before anything else happens."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:241
msgid "`run_customize`: after all the standard files have been laid out."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:242
msgid ""
"`run_late_customize`: at the very end of the process, just before the actual "
"NanoBSD image is built."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:244
msgid ""
"To customize a NanoBSD image, at any of these steps, it is best to add a "
"specific value to one of the corresponding variables."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:247
msgid ""
"The `NANO_EARLY_CUSTOMIZE` variable is used at the first step of the "
"building process.  At this point, there is no example as to what can be done "
"using that variable, but it may change in the future."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:250
msgid ""
"The `NANO_CUSTOMIZE` variable is used after the kernel, world and etc "
"configuration files have been installed, and the etc files have been setup "
"as to be a NanoBSD installation.  So it is the correct step in the building "
"process to tweak configuration options and add packages, like in the "
"cust_nobeastie example."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:254
msgid ""
"The `NANO_LATE_CUSTOMIZE` variable is used just before the disk image is "
"created, so it is the very last moment to change anything.  Remember that "
"the `setup_nanobsd` routine already executed and that the [.filename]#etc#, "
"[.filename]#conf# and [.filename]#cfg# directories and subdirectories are "
"already modified, so it is not time to change them at this point.  Rather, "
"it is possible to add or remove specific files."
msgstr ""

#. type: Title =====
#: documentation/content/en/articles/nanobsd/_index.adoc:255
#, no-wrap
msgid "Booting Options"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:259
msgid ""
"There are also variables that can change the way the NanoBSD image boots.  "
"Two options are passed to man:boot0cfg[8] to initialize the boot sector of "
"the disk image:"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:261
msgid "`NANO_BOOT0CFG`"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:262
msgid "`NANO_BOOTLOADER`"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:267
msgid ""
"With `NANO_BOOTLOADER` a bootloader file can be chosen.  The most common "
"possible options are between [.filename]#boot0sio# and [.filename]#boot0# "
"depending on whether the appliance has a serial port or not.  It is best to "
"avoid supplying a different bootloader, but it is possible.  To do so, it is "
"best to have checked the extref:{handbook}boot[FreeBSD Handbook] chapter on "
"the boot process."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:274
msgid ""
"With `NANO_BOOT0CFG`, the booting process can be tweaked, like selecting on "
"which partition the NanoBSD image will actually boot.  It is best to check "
"the man:boot0cfg[8] page before changing the default value of this "
"variable.  One option that could be interesting to change is the timeout of "
"the booting procedure.  To do so, the `NANO_BOOT0CFG` variable can be "
"changed to `\"-o packet -s 1 -m 3 -t 36\"`.  That way the booting process "
"would start after approximately 2 seconds; because it is rare that waiting "
"10 seconds before actually booting is desired."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:277
msgid ""
"Good to know: the `NANO_BOOT2CFG` variable is only used in the "
"`cust_comconsole` routine that can be called at the `NANO_CUSTOMIZE` step if "
"the appliance has a serial port and all console input and output has to take "
"place through it.  Be sure to check the relevant parameters of the serial "
"port, as setting a bad parameter value can make it useless."
msgstr ""

#. type: Title =====
#: documentation/content/en/articles/nanobsd/_index.adoc:278
#, no-wrap
msgid "Disk Image Creation"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:282
msgid ""
"In the end of the boot process is the disk image creation.  With this step, "
"the NanoBSD script provides a file that can simply be copied onto a disk for "
"the appliance, and that will make it boot and start."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:284
msgid ""
"There are many variables that need to be set just right for the script to "
"produce a usable disk image."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:286
msgid ""
"The `NANO_DRIVE` variable must be set to the drive name of the media at "
"runtime. Usually, the default value `ada0`, which represents the first `IDE`/"
"`ATA`/`SATA` device on the appliance is expected to be the correct one, but "
"a different type of storage could also be used - like a USB key, in which "
"case, it would rather be `da0`."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:287
msgid ""
"The `NANO_MEDIASIZE` variable must be set to the size (in 512-byte sectors) "
"of the storage media that will be used. If you set it wrong, it is possible "
"that the NanoBSD image will not boot at all, and a message at boot time will "
"be warning about incorrect disk geometry."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:289
msgid ""
"The [.filename]#/etc#, [.filename]#/var#, and [.filename]#/tmp# directories "
"are allocated as man:md[4] (malloc) disks at boot time; so their sizes can "
"be tailored to suit the appliance needs. The `NANO_RAM_ETCSIZE` variable "
"sets the size of the [.filename]#/etc#; and the `NANO_RAM_TMPVARSIZE` "
"variable sets the size of both the [.filename]#/var# and [.filename]#/tmp# "
"directory, as [.filename]#/tmp# is symbolically linked to [.filename]#/var/"
"tmp#. By default, both malloc disks sizes are set at 20MB each. They can "
"always be changed, but usually the [.filename]#/etc# does not grow too much "
"in size, so 20MB is a good starting point, whereas the [.filename]#/var# and "
"especially [.filename]#/tmp# can grow much larger if not careful about it. "
"For memory constrained systems, smaller filesystem sizes may be chosen."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:290
msgid ""
"As NanoBSD is mainly designed to build a system image for an appliance, it "
"is assumed that the storage media used will be relatively small. For that "
"reason, the filesystem that is laid out is configured to have a small block "
"size (4Kb) and a small fragment size (512b). The configuration options of "
"the filesystem can be modified through the `NANO_NEWFS` variable, but the "
"syntax must respect the man:newfs[8] command format. Also, by default, the "
"filesystem has Soft Updates enabled. The extref:{handbook}[FreeBSD Handbook] "
"can be checked about this."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:291
msgid ""
"The different partition sizes can be set through the use of `NANO_CODESIZE`, "
"`NANO_CONFSIZE`, and `NANO_DATASIZE` as a multiple of 512-byte sectors. "
"`NANO_CODESIZE` defines the size of the first two image partitions: `code#1` "
"and `code#2`. They have to be big enough to hold all the files that will be "
"produced as a result of the `buildworld` and `buildkernel` processes. "
"`NANO_CONFSIZE` defines the size of the configuration file partition, so it "
"does not need to be very big; but do not make it so small that it will not "
"hold all configuration files. Finally, `NANO_DATASIZE` defines the size of "
"an optional partition, that can be used on the appliance. The last partition "
"can be used, for example, to keep files created on the fly on disk."
msgstr ""

#. type: Title ====
#: documentation/content/en/articles/nanobsd/_index.adoc:292
#, no-wrap
msgid "Custom Functions"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:296
msgid ""
"It is possible to fine-tune NanoBSD using shell functions in the "
"configuration file.  The following example illustrates the basic model of "
"custom functions:"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:304
#, no-wrap
msgid ""
"cust_foo () (\n"
"\techo \"bar=baz\" > \\\n"
"\t\t${NANO_WORLDDIR}/etc/foo\n"
")\n"
"customize_cmd cust_foo\n"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:307
msgid ""
"A more useful example of a customization function is the following, which "
"changes the default size of the [.filename]#/etc# directory from 5MB to 30MB:"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:315
#, no-wrap
msgid ""
"cust_etc_size () (\n"
"\tcd ${NANO_WORLDDIR}/conf\n"
"\techo 30000 > default/etc/md_size\n"
")\n"
"customize_cmd cust_etc_size\n"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:318
msgid ""
"There are a few default pre-defined customization functions ready for use:"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:320
msgid ""
"`cust_comconsole` - Disables man:getty[8] on the VGA devices (the "
"[.filename]#/dev/ttyv*# device nodes) and enables the use of the COM1 serial "
"port as the system console."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:321
msgid "`cust_allow_ssh_root` - Allow `root` to login via man:sshd[8]."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:322
msgid ""
"`cust_install_files` - Installs files from the [.filename]#nanobsd/Files# "
"directory, which contains some useful scripts for system administration."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:323
msgid ""
"`cust_pkgng` - Installs packages from the [.filename]#nanobsd/Pkg# directory "
"(needs also pkg-* package to bootstrap)."
msgstr ""

#. type: Title ====
#: documentation/content/en/articles/nanobsd/_index.adoc:324
#, no-wrap
msgid "Adding Packages"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:327
msgid ""
"Packages can be added to a NanoBSD image, to provide specific "
"functionalities on the appliance. To do so, either:"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:329
msgid "Add the `cust_pkgng` to the `NANO_CUSTOMIZE` variable, or"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:330
msgid ""
"Add a `'customize_cmd cust_pkgng'` command in a customized configuration "
"file."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:333
msgid ""
"Both methods achieve the same result: launching the `cust_pkgng` routine.  "
"This routine will go through `NANO_PACKAGE_DIR` directory to find either all "
"packages or just the list of packages in the `NANO_PACKAGE_LIST` variable."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:339
msgid ""
"It is common, when installing applications through pkg on a standard FreeBSD "
"environment, that the install process puts configuration files, in the "
"[.filename]#usr/local/etc# directory, and startup scripts in the "
"[.filename]#/usr/local/etc/rc.d# directory.  So, after the required packages "
"have been installed, they need to be configured in order for them to start "
"right out of the box.  To do so, the necessary configuration files have to "
"be installed in the correct directories.  This can be achieved by writing "
"dedicated routines or the generic `cust_install_files` routine can be used "
"to lay out files properly from the [.filename]#/usr/src/tools/tools/nanobsd/"
"Files# directory.  Usually a statement, sometimes multiple statements, in "
"the [.filename]#/etc/rc.conf# also needs to be added for each package."
msgstr ""

#. type: Title ====
#: documentation/content/en/articles/nanobsd/_index.adoc:340
#, no-wrap
msgid "Configuration File Example"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:343
msgid ""
"A complete example of a configuration file for building a custom NanoBSD "
"image can be:"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:350
#, no-wrap
msgid ""
"NANO_NAME=custom\n"
"NANO_SRC=/usr/src\n"
"NANO_KERNEL=MYKERNEL\n"
"NANO_IMAGES=2\n"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:356
#, no-wrap
msgid ""
"CONF_BUILD='\n"
"WITHOUT_KLDLOAD=YES\n"
"WITHOUT_NETGRAPH=YES\n"
"WITHOUT_PAM=YES\n"
"'\n"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:372
#, no-wrap
msgid ""
"CONF_INSTALL='\n"
"WITHOUT_ACPI=YES\n"
"WITHOUT_BLUETOOTH=YES\n"
"WITHOUT_FORTRAN=YES\n"
"WITHOUT_HTML=YES\n"
"WITHOUT_LPR=YES\n"
"WITHOUT_MAN=YES\n"
"WITHOUT_SENDMAIL=YES\n"
"WITHOUT_SHAREDOCS=YES\n"
"WITHOUT_EXAMPLES=YES\n"
"WITHOUT_INSTALLLIB=YES\n"
"WITHOUT_CALENDAR=YES\n"
"WITHOUT_MISC=YES\n"
"WITHOUT_SHARE=YES\n"
"'\n"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:383
#, no-wrap
msgid ""
"CONF_WORLD='\n"
"WITHOUT_BIND=YES\n"
"WITHOUT_MODULES=YES\n"
"WITHOUT_KERBEROS=YES\n"
"WITHOUT_GAMES=YES\n"
"WITHOUT_RESCUE=YES\n"
"WITHOUT_LOCALES=YES\n"
"WITHOUT_SYSCONS=YES\n"
"WITHOUT_INFO=YES\n"
"'\n"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:385
#, no-wrap
msgid "FlashDevice SanDisk 1G\n"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:390
#, no-wrap
msgid ""
"cust_nobeastie() (\n"
"\ttouch ${NANO_WORLDDIR}/boot/loader.conf\n"
"\techo \"beastie_disable=\\\"YES\\\"\" >> ${NANO_WORLDDIR}/boot/loader.conf\n"
")\n"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:395
#, no-wrap
msgid ""
"customize_cmd cust_comconsole\n"
"customize_cmd cust_install_files\n"
"customize_cmd cust_allow_ssh_root\n"
"customize_cmd cust_nobeastie\n"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:399
msgid ""
"All the build and install compilation options can be found in the "
"man:src.conf[5] man page, but not all options can or should be used when "
"building a NanoBSD image.  The build and install options should be defined "
"according to the needs of the image being built."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:403
msgid ""
"For example, the ftp client and server might not be needed.  Adding "
"`WITHOUT_FTP=TRUE` to a configuration file in the `CONF_BUILD` section will "
"avoid having them built.  Also, if the NanoBSD appliance will not be used to "
"build programs then it is possible to add the `WITHOUT_BINUTILS=TRUE` in the "
"`CONF_INSTALL` section; but not in the `CONF_BUILD` section as they will be "
"used to build the NanoBSD image."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:405
msgid ""
"Not building a particular set of programs - through a compilation option - "
"shortens the overall building time and lowers the required size for the disk "
"image, whereas not installing the same specific set of programs does not "
"lower the overall building time."
msgstr ""

#. type: Title ===
#: documentation/content/en/articles/nanobsd/_index.adoc:406
#, no-wrap
msgid "Updating NanoBSD"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:409
msgid "The update process of NanoBSD is relatively simple:"
msgstr ""

#. type: delimited block = 4
#: documentation/content/en/articles/nanobsd/_index.adoc:413
msgid "Build a new NanoBSD image, as usual."
msgstr ""

#. type: delimited block = 4
#: documentation/content/en/articles/nanobsd/_index.adoc:414
msgid ""
"Upload the new image into an unused partition of a running NanoBSD appliance."
msgstr ""

#. type: delimited block = 4
#: documentation/content/en/articles/nanobsd/_index.adoc:416
msgid ""
"The most important difference of this step from the initial NanoBSD "
"installation is that now instead of using [.filename]#\\_.disk.full# (which "
"contains an image of the entire disk), the [.filename]#_.disk.image# image "
"is installed (which contains an image of a single system partition)."
msgstr ""

#. type: delimited block = 4
#: documentation/content/en/articles/nanobsd/_index.adoc:417
msgid "Reboot, and start the system from the newly installed partition."
msgstr ""

#. type: delimited block = 4
#: documentation/content/en/articles/nanobsd/_index.adoc:418
msgid "If all goes well, the upgrade is finished."
msgstr ""

#. type: delimited block = 4
#: documentation/content/en/articles/nanobsd/_index.adoc:419
msgid ""
"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."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:422
msgid ""
"To install new image onto the running NanoBSD system, it is possible to use "
"either the [.filename]#updatep1# or [.filename]#updatep2# script located in "
"the [.filename]#/root# directory, depending from which partition is running "
"the current system."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:424
msgid ""
"According to which services are available on the host serving the new "
"NanoBSD image and what type of transfer is preferred, it is possible to use "
"one of these three methods:"
msgstr ""

#. type: Title ====
#: documentation/content/en/articles/nanobsd/_index.adoc:425
#, no-wrap
msgid "Using man:ftp[1]"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:428
msgid "If the transfer speed is most important, use this example:"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:433
#, no-wrap
msgid ""
"# ftp myhost\n"
"get _.disk.image \"| sh updatep1\"\n"
msgstr ""

#. type: Title ====
#: documentation/content/en/articles/nanobsd/_index.adoc:435
#, no-wrap
msgid "Using man:ssh[1]"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:438
msgid "If a secure transfer is preferred, consider using this example:"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:442
#, no-wrap
msgid "# ssh myhost cat _.disk.image.gz | zcat | sh updatep1\n"
msgstr ""

#. type: Title ====
#: documentation/content/en/articles/nanobsd/_index.adoc:444
#, no-wrap
msgid "Using man:nc[1]"
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:447
msgid ""
"Try this example if the remote host is not running the man:ftpd[8] or "
"man:sshd[8] service:"
msgstr ""

#. type: delimited block = 4
#: documentation/content/en/articles/nanobsd/_index.adoc:451
msgid ""
"First, open a TCP listener on the host serving the image, and make it send "
"the image to the client:"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:455
#, no-wrap
msgid "myhost# nc -l 2222 < _.disk.image\n"
msgstr ""

#. type: delimited block = 6
#: documentation/content/en/articles/nanobsd/_index.adoc:460
msgid ""
"Make sure that the chosen port is not blocked by the firewall to receive "
"incoming connections from the NanoBSD host."
msgstr ""

#. type: Plain text
#: documentation/content/en/articles/nanobsd/_index.adoc:462
msgid ""
"Connect to the host serving the new image, and execute the "
"[.filename]#updatep1# script:"
msgstr ""

#. type: delimited block . 4
#: documentation/content/en/articles/nanobsd/_index.adoc:466
#, no-wrap
msgid "# nc myhost 2222 | sh updatep1\n"
msgstr ""