2018-09-21 |
environment: Allow default env path to be NULL
...
Several places assume that the default environment path cannot be NULL.
Allow NULL here without crashing.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 21 Sep 2018
|
2017-01-10 |
environment: fix typo
...
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Ulrich Ölmann
authored
on 23 Nov 2016
Sascha Hauer
committed
on 10 Jan 2017
|
2016-09-26 |
environment: "wrong magic" gives the impression of an error
...
From 15e7ff6 Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <srn@skov.dk>
Date: Thu, 22 Sep 2016 06:54:42 +0200
Subject: [PATCH 1/1] environment: "wrong magic" give the impression of an
error
Introduce a more soft wording when the magic of
the superblock does not match.
Include a hint to the typical reason "(envfs never written?)"
This prevents a "what is wrong?" moment when looking at
the boot log.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sam Ravnborg
authored
on 22 Sep 2016
Sascha Hauer
committed
on 26 Sep 2016
|
2016-07-22 |
nv: Save nv variables on shutdown
...
With this patch nv variables are automatically saved whenever barebox
shuts down (that is 'reset' is executed or a kernel is started). With
this the additional 'saveenv' step becomes unnecessary.
The nv variables are stored in the environment and the estasblished
behaviour is that files in the environment must be manually saved
using 'saveenv'. This behaviour shall be kept for now, so this patch
cannot just call 'saveenv' since that would save the modified
environment files aswell. Instead we read the environment from the
device, modifiy the nv variables and save the environment back.
Since this changes a long existing behaviour messages are printed the
first time a nv variable is modified and during shutdown when the
variables are actually saved.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 22 Jul 2016
|
2016-05-09 |
Merge branch 'for-next/include-cleanup'
Sascha Hauer
committed
on 9 May 2016
|
2016-04-19 |
fix erasing/protecting flashes with unspecified size
...
fixes: 81737c1 mtd: Fix erasing of devices >4GiB
Several places erased a complete flash partition passing ~0 as count to
erase(). With the above commit count to erase was changed from an unsigned
type to a signed type, so the (count > f->size - offset) check in
erase() no longer triggers and the ~0 count is no longer adjusted to the whole
device size. Among other things this results in saveenv failures on NOR
flashes.
This patch fixes this by introducing an explicit macro for erasing the
whole device which is tested for in erase(). All other negative values
are rejected.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Giorgio <giorgio.nicole@arcor.de>
Sascha Hauer
committed
on 19 Apr 2016
|
2016-04-15 |
string: Fix (v)asprintf prototypes
...
Our asprintf and vasprintf have different prototypes than the glibc
functions. This causes trouble when we want to share barebox code
with userspace code. Change the prototypes for (v)asprintf to match
the glibc prototypes. Since the current (v)asprintf are convenient
to use change the existing functions to b(v)asprintf.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Apr 2016
|
include: move crc specific stuff to crc.h
...
We have a crc.h, so move our crc function prototypes there to further
cleanup common.h.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Apr 2016
|
2015-12-17 |
environment: allow saving of symbolic link changes
...
Currently it is not possible to change symbolic links in the default
environment. For example if the default environment contains the
link "current_boot -> mmc" then the following does not work:
$ rm current_boot
$ ln net current_boot
$ saveenv
After reset the link is still pointing to "mmc" and this error appears:
"symlink: /env/boot/current_boot -> net : error -17"
The patch fixes the above problem and moves the "ENV_FLAG_NO_OVERWRITE"
to enable handling of symbolic links in this case too.
Signed-off-by: Zahari Doychev <zahari.doychev@linux.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Zahari Doychev
authored
on 16 Dec 2015
Sascha Hauer
committed
on 17 Dec 2015
|
2015-12-01 |
environment: support env on at24 eeprom
...
unprotect(), erase() and protect() return EOPNOTSUPP errno code
for at24 I2C eeproms, so envfs_save() doesn't store data
to these eeproms without this patch.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Antony Pavlov
authored
on 27 Nov 2015
Sascha Hauer
committed
on 1 Dec 2015
|
2015-03-09 |
Merge branch 'for-next/misc'
Sascha Hauer
committed
on 9 Mar 2015
|
2015-03-06 |
environment: envfs_{load, save}: add possibility to call with filename and dirname == NULL
...
This patch moves fallback to default into the envfs_{load,save} functions.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Marc Kleine-Budde
authored
on 5 Mar 2015
Sascha Hauer
committed
on 6 Mar 2015
|
2015-02-19 |
environment: Do not remove base env directory
...
When removing empty directories do not remove the base
directory.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 19 Feb 2015
|
2014-11-06 |
Add support for non volatile variables
...
This adds (back) support for non volatile variables. Non volatile
variables are variables which are stored in the environment over
reboot. They are used in the same way as the global variables, but
with a 'nv' command and device. The variables are stored under
/env/nv/, one variable per file. Adding a nv variable automatically
adds a global variable with the same name. Changing a nv variable
also changes the same global variable, but not the other way round.
This allows for example to configure the username as:
nv user=sha; saveenv
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Nov 2014
|
environment: Only save changes to the defaultenv
...
Instead of storing the complete files with a 'saveenv' command
only store the files that have changes to the default environment.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Nov 2014
|
environment: refactor saveenv
...
Collect all files in a list first and iterate over the list
when creating the actual environment image. Makes the next
patches easier.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Nov 2014
|
2014-11-05 |
environment: remove unused variable
...
fd is unused, remove it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 5 Nov 2014
|
environment: drop unnecessary casts
...
No Need to cast void pointers.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 5 Nov 2014
|
2014-08-01 |
envfs: change API to be able to forward special flags into the envfs superblock
...
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>
Juergen Borleis
authored
on 31 Jul 2014
Sascha Hauer
committed
on 1 Aug 2014
|
envfs: provide an intentional way to ignore an existing external environment
...
Add a simple flag to envfs to be able to mark an external environment as
"not to be used".
This change should not affect existing systems, because the current envfs
implementation ensures the 'flags' member in the envfs master block is always
zeroed.
Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Juergen Borleis
authored
on 31 Jul 2014
Sascha Hauer
committed
on 1 Aug 2014
|
2014-04-28 |
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>
Sascha Hauer
committed
on 28 Apr 2014
|
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>
Sascha Hauer
committed
on 28 Apr 2014
|
2014-04-09 |
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>
Sascha Hauer
committed
on 9 Apr 2014
|
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>
Sascha Hauer
committed
on 9 Apr 2014
|
2014-03-29 |
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 0a2a8f7
| 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>
Sascha Hauer
committed
on 29 Mar 2014
|
2014-02-28 |
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>
Sascha Hauer
committed
on 28 Feb 2014
|
2014-02-20 |
environment: Add function to load envfs from buffer
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Feb 2014
|
environment: constify arguments
...
The directory arguments to envfs_load and envfs_save can
be const.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 20 Feb 2014
|
2014-01-27 |
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>
Sascha Hauer
committed
on 27 Jan 2014
|
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>
Sascha Hauer
committed
on 27 Jan 2014
|