From: Andreas Reichel <
andreas.r...@siemens.com>
Design of the bg_setenv tool does not allow proper handling of
global user variables at the moment. The tool must be re-designed
to solve this.
This does not affect the API where this functionality is wanted by
SWupdate. Users can set the variables on a per-config basis.
Signed-off-by: Andreas Reichel <
andreas.r...@siemens.com>
---
tools/bg_setenv.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/tools/bg_setenv.c b/tools/bg_setenv.c
index e9156cd..3ed5a7f 100644
--- a/tools/bg_setenv.c
+++ b/tools/bg_setenv.c
@@ -65,8 +65,6 @@ struct env_action {
STAILQ_HEAD(stailhead, env_action) head = STAILQ_HEAD_INITIALIZER(head);
-static bool inhibit_global_store = false;
-
static void journal_free_action(struct env_action *action)
{
if (!action) {
@@ -116,11 +114,10 @@ static void journal_process_action(BGENV *env, struct env_action *action)
ebgenv_t e;
char *tmp;
- if (inhibit_global_store) {
- /* If the environment is written to a file, we don't want a
- * global variable storage, but only into the output file */
- action->type &= ~USERVAR_TYPE_GLOBAL;
- }
+ /* Currently, the tools cannot handle global user variables correctly,
+ * users are asked to perform manual variable changes per
+ * configuration only. */
+ action->type &= ~USERVAR_TYPE_GLOBAL;
switch (action->task) {
case ENV_TASK_SET:
@@ -319,7 +316,6 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
break;
case 'f':
arguments->output_to_file = true;
- inhibit_global_store = true;
res = asprintf(&envfilepath, "%s/%s", arg, FAT_ENV_FILENAME);
if (res == -1) {
return ENOMEM;
--
2.15.0