Busybox utils to set u-boot environment?
Marc Leeman
marc.leeman at gmail.com
Thu Aug 9 23:59:29 PDT 2007
> no, nor will there probably ever be due to the nature of u-boot ... every
> single board can store its environment in different types of flash in
> different sectors at different offsets in different magical ways ... there is
> no common infrastructure to query such information from kernel/user space
>
> you should setup your mtd maps to create a separate partition for your u-boot
> env sector and then use the mtd-utils package to read/write it from userspace
I do not fully agree with you: U-Boot already contains a firmware
version (fw_setenv and fw_printenv) of the U-Boot setenv and the
printenv commands.
[mleeman at neo u-boot-1.2.0]$ find . -name fw_env.c
./tools/env/fw_env.c
It even operates similarly as busybox (tm) with argv[0] to distinguish
between setenv and printenv (I added a editenv to set multiple variables
at one pass only erasing one time the sector).
As for the querying of the information, strictly speaking, there is not
really a need for this since the developer needs to specify it in a
config file:
[mleeman at neo u-boot-1.2.0]$ cat ../../flashfs/etc/fw_env.config
# Configuration file for fw_(printenv/saveenv) utility.
# Up to two entries are valid, in this case the redundand
# environment sector is assumed present.
# MTD device name Device offset Env. size Flash sector
# size
/dev/mtd1 0x0000 0x20000 0x20000
/dev/mtd2 0x0000 0x20000 0x20000
That's not really different as e.g. httpd.conf...
Finally, strictly speaking, you don't need a seperate mtd sector for
your environment, you could e.g. store it at the end of you U-Boot
sectors. If that is wise, that's an entirely different matter of course.
--
greetz, marc
Is everybody aboard this ship kinkoid?
Chiana - A Bug's Life
chiana 2.6.18-4-ixp4xx #1 Tue Mar 27 18:01:56 BST 2007 GNU/Linux
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://busybox.net/lists/busybox/attachments/20070810/cb839486/attachment.pgp
More information about the busybox
mailing list