The translation is temporarily closed for contributions due to maintenance, please come back later.

Translation

(itstool) path: sect2/para
English
The <filename>/etc</filename> and <filename>/var</filename> directories are <citerefentry><refentrytitle>md</refentrytitle><manvolnum>4</manvolnum></citerefentry> (malloc) disks.
Context English Chinese (Simplified) (zh_CN) State
This document provides information about the <application>NanoBSD</application> tools, which can be used to create FreeBSD system images for embedded applications, suitable for use on a Compact Flash card (or other mass storage medium). 这篇文档提供了关于 <application>NanoBSD</application> 工具的介绍信息, 这一工具可以用来创建用于嵌入式应用的 FreeBSD 系统映像, 以适应存放到袖珍闪存 (Compact Flash) 卡 (或其它大容量存储介质) 上的需要。
<primary>NanoBSD</primary> <primary>NanoBSD</primary>
<application>NanoBSD</application> is a tool currently developed by Poul-Henning Kamp <email>phk@FreeBSD.org</email>. It creates a FreeBSD system image for embedded applications, suitable for use on a Compact Flash card (or other mass storage medium). <application>NanoBSD</application> 是 Poul-Henning Kamp <email>phk@FreeBSD.org</email> 目前正在开发的一项工具。 它可以用来创建用于嵌入式应用的 FreeBSD 系统映像, 以便配合袖珍闪存 (Compact Flash) 卡 (或其他大容量存储介质) 使用。
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. 这一工具也可以用来构建定制的安装映像, 以简化通常称为 <quote>计算设备 (computer appliances)</quote> 的系统的安装和维护工作。 计算设备通常在产品中将捆绑硬件和软件, 或者换言之, 所有的应用程序都是预先装好的。 这些设备可以直接插到暨存的网络中, 并 (几乎是) 立即投入使用。
The features of <application>NanoBSD</application> include: <application>NanoBSD</application> 提供的功能包括:
Ports and packages work as in FreeBSD — Every single application can be installed and used in a <application>NanoBSD</application> image, the same way as in FreeBSD. 可以和 FreeBSD 一样使用 Ports 和预编译包── 所有的应用程序都可以在 <application>NanoBSD</application> 映像中直接使用, 而方式与 FreeBSD 完全一样。
No missing functionality — If it is possible to do something with FreeBSD, 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. 不减少功能 ── 能够使用 FreeBSD 做的任何工作, 都可以在 <application>NanoBSD</application> 中使用, 除非您在创建 <application>NanoBSD</application> 映像时, 明确地删去它们。
Everything is read-only at run-time — It is safe to pull the power-plug. There is no necessity to run <citerefentry><refentrytitle>fsck</refentrytitle><manvolnum>8</manvolnum></citerefentry> after a non-graceful shutdown of the system. 所有对象在运行时均是只读的 ── 可以安全地拔掉电源插销。 在系统非正常关闭之后, 无需运行 <citerefentry><refentrytitle>fsck</refentrytitle><manvolnum>8</manvolnum></citerefentry>。
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. 便于联编和定制 ── 只需使用一个 shell 脚本和一个配置文件, 您可以很容易地裁减和定制适于任意需求的映像。
NanoBSD Howto 如何使用 NanoBSD
The Design of NanoBSD NanoBSD 的设计
Once the image is present on the medium, it is possible to boot <application>NanoBSD</application>. The mass storage medium is divided into three parts by default: 一旦将映像存入介质, 就可以用它来引导 <application>NanoBSD</application> 了。 默认情况下, 大容量存储器会划分为三个区:
Two image partitions: <literal>code#1</literal> and <literal>code#2</literal>. 两个映像区: <literal>code#1</literal> 和 <literal>code#2</literal>。
The configuration file partition, which can be mounted under the <filename>/cfg</filename> directory at run time. 一个配置文件区, 运行环境中, 可以将其挂接到 <filename>/cfg</filename> 目录下。
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. <filename>/etc</filename> 和 <filename>/var</filename> 目录均为 <citerefentry><refentrytitle>md</refentrytitle><manvolnum>4</manvolnum></citerefentry> (malloc) 盘。
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. 配置文件分区保存在 <filename>/cfg</filename> 目录。 它包含了用于 <filename>/etc</filename> 目录的文件, 在启动之后暂时以只读方式挂接。 因此, 在需要从 <filename>/etc</filename> 向 <filename>/cfg</filename> 目录复制所进行的、 希望在重启时保持不变的配置时, 需要进行一些额外的操作。
Making Persistent Changes to <filename>/etc/resolv.conf</filename> 在 <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>
<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. 只有在系统启动过程中, 以及需要修改配置文件的场合, 才需要挂接包含 <filename>/cfg</filename> 的那个分区。
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). 在任何时候都保持挂接 <filename>/cfg</filename> 不是一个好主意, 特别是当您把 <application>NanoBSD</application> 放在不适合进行大量写操作的分区时 (由于文件系统的同步进程会定期向系统盘写一些数据)。
Building a NanoBSD Image 构建 NanoBSD 映像
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. <application>NanoBSD</application> 映像是通过使用非常简单的 <filename>nanobsd.sh</filename> shell 脚本来构建的, 这个脚本可以在 <filename><replaceable>/usr</replaceable>/src/tools/tools/nanobsd</filename> 目录中找到。 这个脚本建立的映像文件, 可以用 <citerefentry><refentrytitle>dd</refentrytitle><manvolnum>1</manvolnum></citerefentry> 工具复制到存储介质上。
The necessary commands to build a <application>NanoBSD</application> image are: 构建 <application>NanoBSD</application> 映像所需的命令是:
<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"/>
<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. 进入 <application>NanoBSD</application> 构建脚本的主目录。
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. 在存储介质上安装 <application>NanoBSD</application>。
Customizing a NanoBSD Image 定制 NanoBSD 映像
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>. 这可能是 <application>NanoBSD</application> 最为重要, 同时也是您最感兴趣的功能。 同时, 您在开发 <application>NanoBSD</application> 应用时, 这也是相当耗时的过程。

Loading…

No matching activity found.

Browse all component changes

Glossary

English Chinese (Simplified) (zh_CN)
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect2/para
Source string location
article.translate.xml:118
String age
a year ago
Source string age
a year ago
Translation file
articles/zh_CN/nanobsd.po, string 23