English Spanish
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.
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.
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. Puede usarse para crear imágenes de instalación especializadas, diseñadas para instalar y mantener sistemas comúnmente llamados <quote>aparatos de computación</quote>. Los aparatos de computación incluyen el hardware y software en el mismo producto, lo cual significa que todas las aplicaciones vienen preinstaladas. El aparato se conecta a una red existente y puede comenzar a funcionar (casi) de inmediato.
The features of NanoBSD include:
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. Los ports y paquetes funcionan de la misma manera que en FreeBSD — Cada aplicación puede ser instalada y usada en una imagen de <application>NanoBSD</application>, de la misma manera que en FreeBSD.
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.
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.
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. Es fácil de crear y personalizar — Haciendo uso de un único script y solamente un archivo de configuración, es posible crear imágenes reducidas y personalizadas para satisfacer un conjunto arbitrario de requisitos.
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:
Two image partitions: `code#1` and `code#2`.
The configuration file partition, which can be mounted under the [.filename]#/cfg# directory at run time. La partición del archivo de configuración, la cual puede ser montada bajo el directorio <filename>/cfg</filename> en tiempo de ejecución.
The [.filename]#/etc# and [.filename]#/var# directories are man:md[4] (malloc) disks.
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.
Making Persistent Changes to [.filename]#/etc/resolv.conf#
# vi /etc/resolv.conf
[...]
# mount /cfg
# cp /etc/resolv.conf /cfg
# umount /cfg
The partition containing [.filename]#/cfg# should be mounted only at boot time and while overriding the configuration files. La partición que contiene <filename>/cfg</filename> debería ser montada solo en el arranque y cuando se sustituyan las directivas de los archivos de configuración.
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). Mantener <filename>/cfg</filename> montado todo el tiempo no es una buena idea, especialmente si el sistema <application>NanoBSD</application> se ejecuta en un medio de almacenamiento masivo que puede verse afectado negativamente por un alto número de escrituras a la partición (como cuando el sincronizador del sistema de archivos vuelca los datos hacia los discos del sistema).
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.
The necessary commands to build 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 <.>