summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorRobert P. J. Day <rpjday@crashcourse.ca>2014-07-03 07:35:44 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2014-07-04 07:30:37 +0200
commit4d62410b7492125ea4eb313e92ed8283b564cfe9 (patch)
tree381fd67343a1e45d92bd5ac435770ae984010ddf /Documentation
parentb48241aabbf2f76e2b4a3fbd7f096588b22c497d (diff)
downloadbarebox-4d62410b7492125ea4eb313e92ed8283b564cfe9.tar.gz
barebox-4d62410b7492125ea4eb313e92ed8283b564cfe9.tar.xz
Documentation: defaultenv chapter from user manual.
A number of grammar fixes, typoes, font changes from the defaultenv-2 chapter. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/user/defaultenv-2.rst54
1 files changed, 37 insertions, 17 deletions
diff --git a/Documentation/user/defaultenv-2.rst b/Documentation/user/defaultenv-2.rst
index fc3723ec6f..faeeb81fbd 100644
--- a/Documentation/user/defaultenv-2.rst
+++ b/Documentation/user/defaultenv-2.rst
@@ -1,19 +1,21 @@
Default environment version 2
=============================
-barebox has its environment files under /env/. Most of the runtime configuration
-takes place under /env/. The environment is comparable to a tar archive which is
-unpacked from a storage medium during startup. If for whatever reason the environment
-cannot be loaded from a storage medium, a compiled-in default environment is used
-instead.
+barebox stores its environment files under the top-level ``/env/``
+directory, where most of the runtime configuration scripts are located.
+This environment is comparable to a tar archive which is unpacked from
+a storage medium during startup. If for whatever reason the environment
+cannot be loaded from a storage medium, a compiled-in default environment
+is used instead.
The environment is not automatically stored on the storage medium when a file
-under /env/ is changed, instead this has to be done manually using the
+under ``/env/`` is changed; rather, this has to be done manually using the
:ref:`command_saveenv` command.
-There are two sets of generic environment files which can be used. The older one
-should not be used for new boards and is not described here. New boards should use
-defaultenv-2 instead.
+There are two sets of generic environment files which can be used. The older
+version (version one) should not be used for new boards and is not described here
+(even though there are still numerous board definitions that use it).
+All new boards should use defaultenv-2 exclusively.
The default environment is composed from different directories during compilation::
@@ -25,27 +27,45 @@ The default environment is composed from different directories during compilatio
The content of the above directories is applied one after another. If the
same file exists in a later overlay, it will overwrite the preceding one.
+Note that not all of the above directories will necessarily be
+included in your default environment, it depends on your barebox
+configuration settings. You can see the configuration variables
+and their respective included directories in ``defaultenv/Makefile``::
+
+ bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW) += defaultenv-2-base
+ bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_MENU) += defaultenv-2-menu
+ bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_DFU) += defaultenv-2-dfu
+ bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-1
+
/env/bin/init
-------------
This script is executed by the barebox startup code after initialization.
-In the defaultenv-2 it will add some global variables and executes the scripts
-in /env/init/. It is also responsible for printing the boot timeout prompt.
-Be careful with changes to this script: since it is executed before any user
+In defaultenv-2, this script will define and set a number of global
+variables, followed by sourcing all of the scripts in ``/env/init/`` with::
+
+ for i in /env/init/*; do
+ . $i
+ done
+
+This script is also responsible for defining the boot timeout value
+(by default, three seconds), then printing the timeout prompt for the user.
+Be careful making changes to this script: since it is executed before any user
intervention, it might lock the system.
/env/init/
----------
-/env/init/ is the place for startup scripts. The scripts in this directory
-will be executed in alphabetical order by the /env/bin/init script.
+The ``/env/init/`` directory is the location for startup scripts. The scripts
+in this directory will be executed in alphabetical order by the
+``/env/bin/init`` script described earlier.
/env/boot/
----------
-/env/boot/ contains boot entry scripts. the :ref:`command_boot` command treats
-the files in this directory as possible boot targets. See :ref:`booting_linux`
-for more details.
+The ``/env/boot/`` directory contains boot entry scripts. The :ref:`command_boot`
+command treats the files in this directory as possible boot targets.
+See :ref:`booting_linux` for more details.
/env/config
-----------