summaryrefslogtreecommitdiffstats
path: root/scripts/bareboxenv.c
Commit message (Collapse)AuthorAgeFilesLines
* include: printk: retire printk_once for pr_debug_onceAhmad Fatoum2023-02-031-1/+1
| | | | | | | | | | printk is just printf and KERN_DEBUG is just "", so printk_once(KERN_DEBUG doesn't do what's promised. Replace instead with pr_debug_once, which does what one would expect. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230202133415.319020-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: bareboxenv: add erase hint if build as host-toolMarco Felsch2021-08-091-0/+6
| | | | | | | | | | The bareboxenv behviour is different if used as host-tool. As host-tool the erase is skipped which can confuse the user. Add a help note as hot fix. In the long term we should add the host-tool erase support as well. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20210806093337.10153-1-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: Replace license and copyright boilerplate by SPDX identifiersUwe Kleine-König2021-02-161-15/+4
| | | | | | | | | Convert the files that licensecheck can determine to be licensed under GPL-2.0-only or GPL-2.0-or-later and also convert the copyright statements to SPDX. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: remove references to CREDITSUwe Kleine-König2020-04-271-3/+0
| | | | | | | | The CREDITS file was removed from barebox in 2015 by commit 6570288f2d97 ("Remove the CREDITS file"). Remove references to it from several files. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Allow usage of default environment without environment file storageAlbert Schwarzkopf2019-12-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the default environment is only used when the barebox environment on the persistent store is not valid or when ENVFS_FLAGS_FORCE_BUILT_IN is set in the super block. However, ENVFS_FLAGS_FORCE_BUILT_IN can be cleared and the environmnet variables in the persistent store will be used again. This may not be desirable. This patch allows building CONFIG_DEFAULT_ENVIRONMENT independent of CONFIG_ENV_HANDLING. This can be useful if you never want to load or write values from the persistent store and you only need to read environment variables from your default environment. If CONFIG_ENV_HANDLING is not set, a message will be printed to the user indicating that changes to non-volatile variables won't be persisted. Move envfs functions that are needed when CONFIG_DEFAULT_ENVIRONMENT and/or CONFIG_ENV_HANDLING is set to a new file common/envfs-core.c. Signed-off-by: Albert Schwarzkopf <a.schwarzkopf@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: bareboxenv.c: fix warning: ‘xstrdup’ defined but not usedOleksij Rempel2019-01-291-10/+0
| | | | | Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* recursive_action: add ACTION_SORT flagBaeuerle, Florian2019-01-081-0/+15
| | | | | | | | | | | Add a flag to sort directory entries before recursing into them. Since this part of lib/ is used inside barebox as well as in scripts/bareboxenv.c, we cannot easily use stringlists from lib/, which would have made the code a bit nicer. Signed-off-by: Florian Bäuerle <florian.baeuerle@allegion.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* saveenv: provide a zeroed/empty/ignore environmentJuergen Borleis2014-08-011-2/+8
| | | | | | | | | | | | If an external environment storage should be used in very rare and special cases, the intentional behaviour should be to ignore the external environment and always fall back to the built-in environment. By storing an empty "to be ignored" environment into the external environment a confusing error message about invalid CRC sums will go away and still the built-in environment is used. With this new option we can force the intentional behaviour. Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* envfs: change API to be able to forward special flags into the envfs superblockJuergen Borleis2014-08-011-1/+1
| | | | | | | | | | In order to be able to mark an stored envfs image with special features (intentional ignore for example), we now can feed forward these flags. By forwarding a '0' for the flags nothing changes because the envfs superblock was already allocated with xzalloc. Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: bareboxcrc32 as host and target userspacetoolMichael Grzeschik2013-12-041-19/+0
| | | | | | | | This patch adds the crc32 command to be build as host and optionally as target tool. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts/bareboxenv: Make locally used functions staticSascha Hauer2013-09-301-6/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bareboxenv: Return proper exit code on failure.Christian Kapeller2013-02-261-4/+12
| | | | | | | | In case environment loading/saving failed, the calling program should be informed about that by returning a non zero exit code. Signed-off-by: Christian Kapeller <christian.kapeller@cmotion.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: remove now unnecessary includeSascha Hauer2013-01-201-1/+0
| | | | | | | include/environment.h is no longer necessary to build scripts/bareboxenv, so remove its inclusion. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* loadenv: allow more fine grained environment loadingSascha Hauer2012-11-291-1/+1
| | | | | | | | | | | This implements two new options for the loadenv command: -s: removes (scrubs) old directory contents to be able to create a fresh environment from for example /dev/defaultenv -n: no overwrite. Do not overwrite existing files. This allows to keep parts of the old environment. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bareboxenv.c: simple grammatical fixRobert P. J. Day2012-11-191-2/+2
| | | | | Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/defaultenv-deps'Sascha Hauer2012-10-031-4/+11
|\
| * scripts/bareboxenv: Only print information if -v is givenSascha Hauer2012-09-281-4/+11
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-3/+0
|/ | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* recursive_action: add ACTION_FOLLOWLINKS supportJean-Christophe PLAGNIOL-VILLARD2012-09-051-1/+1
| | | | | | this is need to support symlink in envfs Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* hostcc tools: include "compiler.h", fix included headersDirk Hörner2012-06-051-0/+2
| | | | | | | | | When barebox headers get included from HOSTCC tools they should not include other architecture specific headers as barebox might get cross-compiled. Instead, the tool itself should include "compiler.h". Signed-off-by: Dirk Hörner <dirker@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* move digest to crypto/Jean-Christophe PLAGNIOL-VILLARD2011-10-121-1/+1
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename U-Boot-v2 project to bareboxSascha Hauer2009-12-151-0/+196
This has been done with the following script: find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \ -e 's/u2boot/barebox/g' \ -e 's/U2Boot/barebox/g' \ -e 's/U-boot V2/barebox/g' \ -e 's/u-boot v2/barebox/g' \ -e 's/U-Boot V2/barebox/g' \ -e 's/U-Boot-v2/barebox/g' \ -e 's/U_BOOT/BAREBOX/g' \ -e 's/UBOOT/BAREBOX/g' \ -e 's/uboot/barebox/g' \ -e 's/u-boot/barebox/g' \ -e 's/u_boot/barebox/g' \ -e 's/U-Boot/barebox/g' \ -e 's/U-boot/barebox/g' \ -e 's/U-BOOT/barebox/g' find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \ xargs -0 -r rename 's/u[-_]?boot/barebox/' It needs some manual fixup following in the next patch Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>