2017-06-14 |
Revert "globalvar: remove code for unqualified globalvars"
...
This reverts commit e4f8105 .
Sascha Hauer
committed
on 14 Jun 2017
|
Revert "param: remove unnecessary device_d * argument"
...
This reverts commit 0071bac .
Sascha Hauer
committed
on 14 Jun 2017
|
Revert "globalvar: don't use nv_device if CONFIG_NVVAR is disabled"
...
This reverts commit b378e8c .
Sascha Hauer
committed
on 14 Jun 2017
|
Revert "nv: Fix setting of nv.dev.<devname>.<param> variables"
...
This reverts commit eaf884b .
Sascha Hauer
committed
on 14 Jun 2017
|
Revert "globalvar: Fix value of new globalvar when nvvar exists"
...
This reverts commit f8a1774 .
Sascha Hauer
committed
on 14 Jun 2017
|
2017-05-30 |
nv: Fix setting of nv.dev.<devname>.<param> variables
...
nv variables with the form nv.dev.<devname>.<param> shall be mirrored to
the device parameter <param> of the device named <devname>. This is
broken since:
| commit 35d8e85
| Author: Sascha Hauer <s.hauer@pengutronix.de>
| Date: Thu Apr 6 15:23:56 2017 +0200
|
| nv: Do not create globalvars from nvvars
Fix this by attaching the setting of the mirror device parameter
directly to the nv device rather than to the global device.
Reported-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 30 May 2017
|
2017-05-24 |
globalvar: Fix value of new globalvar when nvvar exists
...
When a new globalvar with a value is created and the corresponding
nvvar exists, then the globalvar gets the value of the nvvar, not
from the newly assigned value as expected.
nv quux=foo; global quux=bar; echo ${global.quux}
Should give "bar", not "foo". Fix this.
Reported-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 24 May 2017
|
2017-04-25 |
globalvar: don't use nv_device if CONFIG_NVVAR is disabled
...
At the moment barebox crashes if CONFIG_NVVAR is disabled
because of access to unregistered nv_device in
get_param_by_name(&nv_device, "version").
How to reproduce the crash:
barebox$ unset ARCH
barebox$ unset CROSS_COMPILE
barebox$ make sandbox_defconfig
barebox$ sed -i "s/CONFIG_ENV_HANDLING=y/# CONFIG_ENV_HANDLING is not set/" .config
barebox$ make oldconfig
barebox$ ./barebox
Segmentation fault
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Antony Pavlov
authored
on 24 Apr 2017
Sascha Hauer
committed
on 25 Apr 2017
|
2017-04-07 |
Merge branch 'for-next/misc'
Sascha Hauer
committed
on 7 Apr 2017
|
globalvar: remove code for unqualified globalvars
...
The globalvar_add_simple_* functions will fail when a globalvar of
the name already exists. This happened when the globalvar was created
previously because a corresponding nvvar existed. For this reason we
removed the globalvars that have been previously created by nvvar
creation (we called these unqualified globalvars). Since we no longer
create the corresponding globalvars on nvvar creation this code is
no longer needed. Remove it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 7 Apr 2017
|
nv: Do not create globalvars from nvvars
...
When we create a new nvvar there's no need to create the corresponding
globalvar, because whoever wants to use the corresponding globalvar
will create it before usage anyway. Doing this means that we have to
test for existence of a corresponding nvvar when we create a globalvar,
and if it does, set the value of the globalvar from the nvvar.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 7 Apr 2017
|
globalvar: remove unused globalvar_add()
...
globalvar_add() is unused in the tree. Remove it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 7 Apr 2017
|
nvvar: Fix creation without value
...
When a new nvvar is added without a value we want to get the value
from the corresponding globalvar. We do this by using nv_set which
ends up freeing the exact string that we passed into nv_set as
value. This results in a corrupt value. Fix this by assigning a
value manually without calling nv_set.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 7 Apr 2017
|
2017-04-04 |
global command: print info about variables
...
The info contains useful information at least for enums, for these the
possible values are printed. This makes the output of the "global"
command more useful and similar to "devinfo global"
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2017
|
2017-01-10 |
globalvar: Fix compiler warning
...
Fixes:
common/globalvar.c:393:7: warning: 'pname' may be used uninitialized in this function [-Wmaybe-uninitialized]
This is a false positive, pname cannot be uninitialized. Silence this
warning.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 10 Jan 2017
|
globalvar: Make locally used function static
...
Fixes:
common/globalvar.c:382:5: warning: no previous prototype for 'globalvar_simple_set' [-Wmissing-prototypes]
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 10 Jan 2017
|
2016-10-18 |
complete: Add completion for nv and globalvar commands
...
The 'nv' command is often used to create a nv variable
for an existing global variable, so add a command completion
function for this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 18 Oct 2016
|
2016-09-22 |
globalvar: introduce globalvar_add_simple_bitmask
...
Using the just introduced param_bitmask this adds the corresponding
globalvar convenience function.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 22 Sep 2016
|
globalvar: Allow full variable name in globalvar_add
...
As a convenience for users allow to pass the full name, including
the leading "global.", to globalvar_add().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 22 Sep 2016
|
nv: Allow full variable name in nvvar_add
...
As a convenience for users allow to pass the full name, including
the leading "nv.", to nvvar_add().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 22 Sep 2016
|
globalvar: Also create globalvars from for nonvolatile device vars
...
nv variables beginning with "nv.dev.<devname>.<varname>" are directly
mirrored to <devname>.<varname> and there is no globalvar for it. To
make it a bit more consistent and to increase the visibility of the
nonvolatile device variables create globalvars for them aswell.
With this the propagation flow has changed from:
nv.dev.<devname>.<varname>
-> <devname>.<varname>
to:
nv.dev.<devname>.<varname>
-> global.dev.<devname>.<varname>
-> <devname>.<varname>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 22 Sep 2016
|
nv: simplify nvvar_add
...
We do not need to have an extra code path when the variable already
exists, instead setting an existing variable can be done in the
variable creation code path aswell.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 22 Sep 2016
|
globalvar: Allow to remove multiple globalvars using wildcards
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 22 Sep 2016
|
globalvar: sync with nvvars
...
This patch fixes the behaviour when a driver creates a globalvar using
globalvar_add_simple_[string|int|bool|enum|ip]) *after* nvvars are
initialized and this globalvar is overwritten with a nvvar. Currently
this fix is not needed because all globalvars are registered before the
nvvars are initialized.
We have two different typed of globalvars. The first type, here referred
to as qualified globalvars, has a backend variable storage (the ones
created with globalvar_add_simple_[string|int|bool|enum|ip]), the other
created with globalvar_add_simple only has a dynamically allocted string
as backend.
Normally during startup of barebox the qualified globalvars are
registered and during load of nvvars are synced with the values from the
nvvars. Everything works fine in this case. However, when during nvvar
initialisation a globalvar for a nvvar does not exist, then it is
registered as unqualified globalvar. When then later some driver wants
to register a qualified globalvar for which a unqualified globalvar
already exists, it will get a -EEXIST. This is not the expected
behaviour. Instead, the current unqualified globalvar should be removed,
recreated as qualified globalvar and then afterwards synced with the
corresponding nvvar. This behaviour is fixed with this patch.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 22 Sep 2016
|
globalvar: Move static inline functions to common/
...
These functions will get bigger in the next patch which disqualifies
them as static inline functions.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 22 Sep 2016
|
nv: Fix variable removal in nvvar_save()
...
When nv variables are removed during runtime then they are
present again when saved with nvvar_save(). This is because nvvar_save()
does not delete variables that exist on the saved environment. Delete
/nv on the saved environment before saving the new variables.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 22 Sep 2016
|
2016-07-25 |
nv: Allow wildcards when removing NV vars
...
With this patch 'nv -r' can also take "*" and "?" wildcards for nv
variables. This makes it easier to remove multiple nv variables.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 25 Jul 2016
|
2016-07-22 |
nv: Use dev_remove_param to delete nv variable
...
dev_remove_param() is exactly for the purpose of removing a device
parameter, so use this function instead of open coding the
functionality.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 22 Jul 2016
|
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
|
nv: Do not save nv variables while loading
...
When reading nv variables from the storage in /env/nv we do
not need to write back the value to the file we just read from.
Optimize this a bit and make it unnecessary.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 22 Jul 2016
|