]> git.ipfire.org Git - people/ms/u-boot.git/commit
tools/env: allow config filename to be passed via command line argument
authorMichael Heimpold <mhei@heimpold.de>
Tue, 27 Oct 2015 21:34:49 +0000 (22:34 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 18 Nov 2015 13:47:02 +0000 (08:47 -0500)
commit9884f44cab5d1ce944b1dc087c9bb8db0efb5160
treeb1b94bc3ff057b4226ddd2530db2f2bd11abb7e6
parentf5b76de4403881940a3ef57f9b6e9fa5b3433070
tools/env: allow config filename to be passed via command line argument

When for example generating/manipulating SD card/eMMC images which
contain U-Boot and its environment(s), it is handy to use a given
configuration file instead of the compiled-in default one.
And since the default configuration file is expected under /etc
it's hard for an usual linux user account without special permissions
to use fw_printenv/fw_setenv for this purpose.
So allow to pass an optional filename via a new '-c' command
line argument.

Example:

$ ln -s fw_printenv tools/env/fw_setenv
$ cat fw_env.config
test.img 0x20000 0x20000
test.img 0x40000 0x20000

$ tools/env/fw_printenv -c ./fw_env.config fdt_file
fdt_file=imx28-duckbill.dtb

$ tools/env/fw_setenv -c ./fw_env.config fdt_file imx28-duckbill-spi.dtb

$ tools/env/fw_printenv -c ./fw_env.config fdt_file
fdt_file=imx28-duckbill-spi.dtb

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
tools/env/fw_env.c
tools/env/fw_env_main.c