diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-07-21 14:37:37 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-07-22 12:27:22 +0200 |
commit | 3fadbdae1fd5fb3d9a078f29bf2fb6f14d808c00 (patch) | |
tree | 34fcb3cf08328cd284bebdcbca07c000a49e19d2 /include | |
parent | b9ac9a9785071f5d243cf287c527286624c08f1b (diff) | |
download | barebox-3fadbdae1fd5fb3d9a078f29bf2fb6f14d808c00.tar.gz barebox-3fadbdae1fd5fb3d9a078f29bf2fb6f14d808c00.tar.xz |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/globalvar.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/globalvar.h b/include/globalvar.h index 67b97de486..1cd8d21a2e 100644 --- a/include/globalvar.h +++ b/include/globalvar.h @@ -173,4 +173,7 @@ static inline void dev_param_init_from_nv(struct device_d *dev, const char *name #endif +void nv_var_set_clean(void); +int nvvar_save(void); + #endif /* __GLOBALVAR_H */ |