summaryrefslogtreecommitdiff
path: root/tools/env/fw_env_main.c
Commit message (Collapse)AuthorAgeLines
* env: tool: add command line option to input lockfile pathB, Ravi2016-10-08-6/+29
| | | | | | | | | | | | | | | The default lockname is set to /var/lock. This limits the usage of this application where OS uses different lockfile location parameter. For example, In case of android, the default lock path location is /data. Hence by providing the command line option to input lockfile path will be useful to reuse the tool across multiple operating system. usage: ./fw_printenv -l <lockfile path> Signed-off-by: Ravi Babu <ravibabu@ti.com>
* tools/env: no global variable sharing between application and libraryAndreas Fenkart2016-05-27-10/+18
| | | | Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* tools/env: fw_printenv pass value_only as argumentAndreas Fenkart2016-05-27-2/+2
| | | | Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* tools: env: bug: config structs must be defined in tools libraryAndreas Fenkart2016-03-27-4/+0
| | | | | | | | fw_senten/fw_printenv can be compiled as a tools library, excluding the fw_env_main object. Reported-by: Stefano Babic <sbabic@denx.de> Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* Fix spelling of "comment".Vagrant Cascadian2016-03-22-1/+1
| | | | | Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* tools: env: update usage stringsAndreas Fenkart2016-02-08-42/+75
| | | | Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* tools: env: factor out parse_common_argsAndreas Fenkart2016-02-08-25/+37
| | | | Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* tools: env: shift optind arguments and fix argument indicesAndreas Fenkart2016-02-08-0/+4
| | | | Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* tools: env: parse aes key / suppress flag into argument structAndreas Fenkart2016-02-08-5/+26
| | | | | | | disabled original parsing, but not yet removed since the argument indexing needs to be fixed Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* tools: env: introduce setenv/printenv argument structsAndreas Fenkart2016-02-08-38/+75
| | | | | | | goal is to use getopt for all argument parsing instead of adhoc parsing in fw_getenv/fw_setenv functions Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* tools/env: allow config filename to be passed via command line argumentMichael Heimpold2015-11-18-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* env: Implement support for AES encryption into fw_* toolsMarek Vasut2014-03-21-5/+12
| | | | | | | | | | | | Implement support for encrypting/decrypting the environment block into the tools/env/fw_* tools. The cipher used is AES 128 CBC and the implementation depends solely on components internal to U-Boot. To allow building against the internal AES library, the library did need minor adjustments to not include U-Boot's headers which are not wanted to be included and define missing types. Signed-off-by: Marek Vasut <marex@denx.de>
* Coding Style cleanup: remove trailing white spaceWolfgang Denk2013-10-14-1/+1
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-24-17/+1
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* fw_env: fix incorrect usage of open(O_CREAT)Mike Frysinger2012-12-19-1/+1
| | | | | | | | | | | | | | | When using open(), the O_CREAT flag must be given a mode, otherwise it uses random garbage from the stack. Also, it can fail to build: In file included from /usr/include/fcntl.h:290:0, from fw_env_main.c:42: In function 'open', inlined from 'main' at fw_env_main.c:97:9: /usr/include/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* tools/env: Serialize calls to fw_*envJoe Hershberger2012-10-15-22/+37
| | | | | | | Use a lock file at /var/lock/fw_printenv.lock. Avoids seriously confusing the MTD driver. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* tools/env: fail on invalid optionsDaniel Hobi2010-09-18-0/+4
| | | | Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch>
* tools/env: allow option "-n" for fw_printenvDaniel Hobi2010-09-18-2/+5
| | | | | | | | | | | In commit bd7b26f8 (Tools: set multiple variable with fw_setenv utility), the option parsing was changed to getopt_long(3), but option "-n" of fw_printenv was not included. This leads to an error message "invalid option -- 'n'" on stderr, although the output on stdout is correct. Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch>
* Tools: set multiple variable with fw_setenv utilityStefano Babic2010-06-29-7/+60
| | | | | | | | | | Add a sort of batch mode to fw_setenv, allowing to set multiple variables in one shot, without updating the flash after each set as now. It is added the possibility to pass a config file with a list of pairs <variable, value> to be set, separated by a TAB character. Signed-off-by: Stefano Babic <sbabic@denx.de>
* Propagate Error Status to the Shell on fw_printenv ErrorsGrant Erickson2008-05-09-11/+14
| | | | | | | | | | | | Changed implementation such that fw_printenv returns failure status when one or more specified variables do not exist or when incorrect command syntax is used. This aids scripting fw_printenv such that the script can key of the return status rather than relying on standard error "scraping". Signed-off-by: Grant Erickson <gerickson@nuovations.com> Signed-off-by: Wolfgang Denk <wd@denx.de>
* * Patch by Josef Wagner, 12 Mar 2003:wdenk2003-03-12-1/+1
| | | | | | | | | | | | | | | | | | | | | | - 16/32 MB and 50/80 MHz support with auto-detection for IP860 - ETH05 and BEDBUG support for CU824 - added support for MicroSys CPC45 - new BOOTROM/FLASH0 and DOC base for PM826 * Patch by Robert Schwebel, 12 Mar 2003: Fix the chpart command on innokom board * Name cleanup: mv include/asm-i386/ppcboot-i386.h include/asm-i386/u-boot-i386.h s/PPCBoot/U-Boot/ in some files s/pImage/uImage/ in some files * Patch by Detlev Zundel, 15 Jan 2003: Fix '' command line quoting * Patch by The LEOX team, 19 Jan 2003: - add support for the ELPT860 board - add support for Dallas ds164x RTC
* * Use 1-byte-read instead of -write for iprobe() functionwdenk2002-12-17-0/+78
Add i2c commands to PM826 config * extend I2C POST code: check for list on known addresses