New environment ?

Sascha Hauer s.hauer at
Mon Mar 4 15:53:20 EST 2013

Hi George,

On Sat, Mar 02, 2013 at 09:47:44AM -0800, George Pontis wrote:
> I'm interested to update my bsp to use the new environment. I am not finding
> any info that describe the structure or how it is intended to be configured
> and used. Can someone provide a pointer to something, or write a few
> sentences on the subject ?

I'm pretty sure I wrote something up, but I can't find it :(

So here is something new:

As with the old env the files are collected from different directories.
The basic files are in defaultenv-2/base/, the menu specific files are
in defaultenv-2/menu/. All files can be overwritten with board specific

The defenv-2 has an init sequence, so all files in /env/init/ are
executed in alphabetical order during startup. Most notable in the
init sequence is /env/init/automount. Here automountpoints are created,
Automount means that a fs is not directly mounted. Instead it is mounted
when the directory is first accessed. Optionally a command is executed
which can make the device to be mounted available (e.g. usb). The
automounting has the advantage that the possible mountpoints can be
configured and later a simple 'cp' will access the files.

Another thing worth noting is the 'ifup' script which can be used to
configure the network device in a Linux-like fashion. The config file
is in /env/network/eth0 and should be self explanatory.

The boot script itself expects boot entries in /env/boot/. boot <name>
will boot the corresponding entry. A single entry usually configures
the global variables (global.*) which bootm later evaluates. I orginally
did this to make it possible to configure everythin needed using
boot -d (dryrun) and later 'bootm' without further arguments could
be called. This way a boot entry could be dryrun first, then the user
can set additional variables before executing bootm. I'm thinking about
removing this extra step though.
Some extra scripts exist (/env/bin/bootargs-*) to make the setting
of the variables simpler for the /env/boot scripts.

If menu support and the menu commands are compiled in the scripts from
defaultenv-2/menu are compiled in. Typing 'exit' on the prompt (or 'm'
during autoboot timeout) will lead you to a menu which gives you access
to the most important config files and lets you boot the configured

I hope this helps for a first start.


Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 |  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

More information about the barebox mailing list