[PATCH 2/3] Add next generation default environment template

Sascha Hauer s.hauer at pengutronix.de
Sun Jun 24 08:23:48 EDT 2012


On Mon, Jun 04, 2012 at 10:47:44AM +0200, Juergen Beisert wrote:
> Sascha Hauer wrote:
> > [...]
> > diff --git a/defaultenv-2/base/init/bootargs-base
> > b/defaultenv-2/base/init/bootargs-base new file mode 100644
> > index 0000000..8e588ad
> > --- /dev/null
> > +++ b/defaultenv-2/base/init/bootargs-base
> > @@ -0,0 +1,8 @@
> > +#!/bin/sh
> > +
> > +if [ "$1" = menu ]; then
> > +       init-menu-add-entry "$0" "Base bootargs"
> > +       exit
> > +fi
> > +
> > +global.linux.bootargs.base="console=ttyS0,115200"
> > [...]
> 
> Seems if you want to change the console setting here, you always have to save 
> the change and restart the system to take affect of the new value when 
> the 'boot' command is running. Old behaviour was an immediate change without 
> saving and restarting. This was a nice behaviour when one just wants to try a 
> different parameter without destroying the old environment.

Late response on this one:

You don't have to restart. Instead, you can just overwrite it on the
command line and boot afterwards:

barebox: global.linux.bootargs.base=console=ttymytempconsole0,115200
barebox: boot

Some more background:

The idea is that the bootentries in /env/boot/* can be executed and
setup the boot environment, afterwards you would only run 'bootm'
without additional arguments.

For example you could execute /env/boot/nand-ubi, then your setup would
be:

bootm.image = /dev/nand0.kernel.bb
bootm.oftree =
bootm.initrd =
linux.bootargs.base = console=ttymxc0,115200
linux.bootargs.ip = ip=dhcp
linux.bootargs.root = root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs
linux.mtdparts.nand0 = mxc_nand:512k(nand0.barebox)ro,128k(nand0.bareboxenv),4M(nand0.kernel),-(nand0.root)
linux.mtdparts.nor0 = physmap-flash.0:512k(nor0.barebox)ro,128k(nor0.bareboxenv),4M(nor0.kernel),-(nor0.root)

If then you want to boot once with a devicetree without permanently
changing you environment, you could do a

barebox: global.bootm.oftree=/whatever/oftree
barebox: bootm


The possibilities are there, maybe the question is how we can simplify
(and document) them so that people are actually aware of what can be
done.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
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