diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-11-29 20:22:58 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-11-29 20:23:04 +0100 |
commit | 1533521bff4121dcd8dc37ef34fd09fc6a5018fb (patch) | |
tree | caeca762cedb4772b651b23d4e92853008633a72 /include/environment.h | |
parent | 5a9d53c47e3c6ce5bc7d38c60501a37ce2c2b276 (diff) | |
download | barebox-1533521bff4121dcd8dc37ef34fd09fc6a5018fb.tar.gz barebox-1533521bff4121dcd8dc37ef34fd09fc6a5018fb.tar.xz |
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>
Diffstat (limited to 'include/environment.h')
-rw-r--r-- | include/environment.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/environment.h b/include/environment.h index 4184977009..096c1697c4 100644 --- a/include/environment.h +++ b/include/environment.h @@ -75,9 +75,6 @@ int env_push_context(void); /* defaults to /dev/env0 */ extern char *default_environment_path; -int envfs_load(char *filename, char *dirname); -int envfs_save(char *filename, char *dirname); - int export(const char *); struct stat; @@ -86,6 +83,10 @@ int file_save_action(const char *, struct stat *, void *, int); #endif /* __BAREBOX__ */ +#define ENV_FLAG_NO_OVERWRITE (1 << 0) +int envfs_load(char *filename, char *dirname, unsigned flags); +int envfs_save(char *filename, char *dirname); + /* This part is used for the host and the target */ struct action_data { int fd; |