9
0
Fork 0
Commit Graph

49 Commits

Author SHA1 Message Date
Sascha Hauer ebb8a4b594 env: erase/protect in envfs_save
So that the envfs_save is more useful outside of the saveenv command

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-28 11:41:02 +02:00
Sascha Hauer 54bea204e2 environment: drop envfs_register_partition
The purpose of envfs_register_partition is to print an error
message when the partition does not exist. Print an error message
from generic code instead and drop this function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-28 11:37:42 +02:00
Sascha Hauer 55fb660e0b loadenv: detect truncated environment files
Properly detect when an environment file is truncated. This can happen
when a previous saveenv failed because the environment partition is too
small.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-09 17:00:37 +02:00
Sascha Hauer aa49d86b2d saveenv: Properly detect write errors
The return value check of the write call is completely bogus. We
check if we have written at minimum sizeof(struct envfs_super) bytes
instead of all bytes. Properly check for all bytes written instead
and allow write to write less bytes than requested.
Do not use write_full because this file is compiled for userspace
aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-09 17:00:29 +02:00
Sascha Hauer 0ae451a7bc environment: Fix unitiliazed variable
envfs_load_data needs a pointer to the envfs_super, otherwise it
works on an unitialized struct when detecting the envfs version.

This is broken since:

| commit 0a2a8f7059
| Author: Sascha Hauer <s.hauer@pengutronix.de>
| Date:   Thu Feb 20 08:16:01 2014 +0100
|
|     environment: Add function to load envfs from buffer
|
|     Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Grmpf. Most compilers do not issue a warning, only the blackfin
gcc 4.3.5 warns about this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 06:45:11 +01:00
Sascha Hauer 7fa10256c3 defaultenv: Allow multiple defaultenvironment overlays
We can compile barebox for multiple boards at once, but currently
they all share a single default environment. This patch adds a
defaultenv_append() which boards can call to customize the default
environment during runtime. Each board now generate default environment
snippets using bbenv-y and add them during runtime with defaultenv_append()

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-28 08:14:14 +01:00
Sascha Hauer 0a2a8f7059 environment: Add function to load envfs from buffer
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-20 14:45:48 +01:00
Sascha Hauer c2428b2287 environment: constify arguments
The directory arguments to envfs_load and envfs_save can
be const.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-20 14:43:49 +01:00
Sascha Hauer 5767987b34 env: make path arguments to envfs_load/save const
These functions have no business changing the path argument, so make the
argument const.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-27 11:08:44 +01:00
Sascha Hauer 25cee7ec17 environment: Use accessor functions for default environment path
default_environment_path only exists when CONFIG_ENV_HANDLING is enabled.
Boards would have to #ifdef this if they wanted to use
default_environment_path. Use accessor functions instead which can
be ifdeffed on a single place.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-27 09:27:02 +01:00
Sascha Hauer 121c3d6e9c devfs: let devfs_add_partition return the new partition
Useful for unregistering later or for adding addional flags.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 11:15:47 +02:00
Eric Bénard eec960e3b3 env: add register_persistent_environment
- heavily copied from register_persistant_environment which was
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-21 14:45:43 +01:00
Sascha Hauer 22e2544809 Merge branch 'for-next/compile-log-level'
Conflicts:
	drivers/usb/host/ehci-hcd.c
2013-02-04 15:48:51 +01:00
Sascha Hauer a01e54d201 treewide: fix format specifiers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-27 14:24:10 +01:00
Sascha Hauer 00df6b4637 make file_*_action static
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-20 16:30:22 +01:00
Sascha Hauer 5531abd16d move struct action_data to the only file using it
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-20 16:30:22 +01:00
Sascha Hauer 1533521bff loadenv: allow more fine grained environment loading
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>
2012-11-29 20:23:04 +01:00
Sascha Hauer 77322aa896 Treewide: remove address of the Free Software Foundation
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>
2012-09-17 10:57:41 +02:00
Jean-Christophe PLAGNIOL-VILLARD acef08abb7 envfs: add support of symlink
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-05 03:22:14 +08:00
Jean-Christophe PLAGNIOL-VILLARD d3cbc61596 envfs: add support of variable inode size
Introduce a struct envfs_inode_end with more data.
Today this will just containt the file mode to be able to add the symlink
support.

But this is compatible with the previous envfs version as they will do not
care about the extra as the previous version is just reading the filename and
then consume the extra data without using them.

Increase the envfs version to 1.0

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-05 03:22:14 +08:00
Jean-Christophe PLAGNIOL-VILLARD ff3058e3bb envfs: introduce version major and minor
they are store in the super block at byte 16th and 17th.

set the verison at 0.1

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-05 03:22:14 +08:00
Sascha Hauer 6188685091 Make errno a positive value
Normally errno contains a positive error value. A certain unnamed developer
mixed this up while implementing U-Boot-v2. Also, normally errno is never
set to zero by any library function.
This patch fixes this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-14 08:35:54 +02:00
Sascha Hauer 9640c2b4a5 environment: make default env path configurable
Normally the default path to save the environment is /dev/env0. However,
we can't map a file in a fat filesystem to /dev/env0. So if we want to
store the environment in a file in fat we have to make it configurable.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 09:54:56 +02:00
Sascha Hauer 361bb24081 common/environment.c: sparse fixes
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:21:25 +02:00
Luotao Fu f498576cb6 fix error return value while loading environment
Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-05-03 15:01:28 +02:00
Sascha Hauer a3ffa97f40 rename U-Boot-v2 project to barebox
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>
2009-12-15 10:18:30 +01:00
Nishanth Menon 2af143fcf2 common:environment: fix mode requirement
Issue:
Compiling on Ubuntu 8.10 Fails:
inlined from 'envfs_save' at scripts/../common/environment.c:135:
/usr/include/bits/fcntl2.h:51: error: call to '_open_missing_mod'
declared with attribute error: open with O_CREAT in second argument
needs 3 arguments

Usage: open(filename, O_WRONLY | O_CREAT)

Fix:
When using open with O_CREAT, it requires
mode to be defined.

Signed-off-by: Nishanth Menon <nm@ti.com>
2008-12-09 11:25:54 +01:00
Sascha Hauer c228b2b84b Trivial comment fix 2008-04-04 14:45:04 +02:00
Carsten Schlote db291de280 [general] Fixed endian handling for envfs
Fixed the handling of data similiar as found in cramfs.

This fixes the problem with an unreadable defaultenv on big-endian
targets.

The endian macors are now loaded from /asm/common.h by default.

Signed-off-by: Carsten Schlote <c.schlote@konzeptpark.de>
2008-02-19 08:56:01 +01:00
Juergen Beisert 8413d78ab3 separating environment commands, part 2
Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
2007-11-12 16:28:23 +01:00
Sascha Hauer 4b07af6730 svn_rev_643
structure cleanup
2007-07-05 18:02:13 +02:00
Sascha Hauer 156c1f4531 svn_rev_499
fix compiler warning
2007-07-05 18:01:59 +02:00
Sascha Hauer d5a108ece3 svn_rev_462
- Add help texts for many commands.
- Let the linker sort the command table.
- Add support for multiple argmuments in several commands
  (mkdir, rmdir, rm, cat)
2007-07-05 18:01:55 +02:00
Sascha Hauer 2eec7c7d41 svn_rev_427 2007-07-05 18:01:53 +02:00
Sascha Hauer 2692aaeb76 svn_rev_419
add ifdef for host compilation
2007-07-05 18:01:52 +02:00
Sascha Hauer 46743ea28f svn_rev_369
include asm-generic in errno.h instead of all other files
2007-07-05 18:01:47 +02:00
Sascha Hauer a8699cf677 svn_rev_335
add envload/envsave functions
2007-07-05 18:01:44 +02:00
Sascha Hauer b0c5815f03 svn_rev_131
remove old env routines
2007-07-05 18:01:25 +02:00
Sascha Hauer b3cecec441 svn_rev_092
generic/remove_autoload.diff
2007-07-05 18:01:22 +02:00
Bartlomiej Sieka daa6e418bc Preliminary support for the iDMR board (ColdFire). 2006-12-20 00:27:32 +01:00
Stefan Roese d12ae80889 Add NAND environment support for PPC440EPx Sequoia NAND boot config
Patch by Stefan Roese, 12 Sep 2006
2006-09-12 20:19:10 +02:00
Marian Balakowicz 78b123cd69 Add M5271EVB board support. 2006-05-09 11:54:44 +02:00
Wolfgang Denk dc17fb6dc2 Cleanup build problems (on Fedora Core x86_64 build host) 2005-08-03 22:32:02 +02:00
wdenk e2ffd59b4d * Code cleanup, mostly for GCC-3.3.x
* Cleanup confusing use of CONFIG_ETH*ADDR - ust his only to
  pre-define a MAC address; use CONFIG_HAS_ETH* to enable support for
  additional ethernet addresses.

* Cleanup drivers/i82365.c - avoid duplication of code

* Fix bogus "cannot span across banks" flash error message

* Add support for CompactFlash for the CPC45 Board.
2004-12-31 09:32:47 +00:00
wdenk 998eaaecd4 * Configure PPChameleon board to use redundand environment in flash
* Configure PPChameleon board to use JFFS2 NAND support.

* Added support for JFFS2 filesystem (read-only) on top of NAND flash
2004-04-18 19:43:36 +00:00
wdenk 0db5bca807 * Patch by Martin Winistoerfer, 23 Mar 2003
- Add port to MPC555/556 microcontrollers
  - Add support for cmi customer board with
    Intel 28F128J3A, 28F320J3A or 28F640J3A flash.

* Patch by Rick Bronson, 28 Mar 2003:
  - fix common/cmd_nand.c
2003-03-31 17:27:09 +00:00
stroese ad10dd9aaf Add "pcidelay" environment variable (in ms, enabled via CONFIG_PCI_BOOTDELAY). 2003-02-14 11:21:23 +00:00
wdenk d0fb80c302 * Restrict baudrate settings on LWMON to higher speeds
when watchdog is on

* Update baudrate in bd_info when it gets changed

* Add watchdog trigger points while waiting for serial port
  (so far only 8xx -- needed on LWMON with 100ms watchdog)

* Improve command line tool to access the U-Boot's environment
  (figuration of the utility, using a config file)
2003-01-11 09:48:40 +00:00
wdenk c609719b8d Initial revision 2002-11-03 00:24:07 +00:00