u-boot-fw-utils: fix environment access functions

In the old u-boot-fw-utils 2016.x the function 'fw_env_close' wrote
the environment to the media. That is no longer the case, now that
function only frees the memory used, and 'fw_env_flush' is used
to write the environment.

This was causing that userspace application using this library were not
able to write changes to the environment.

https://jira.digi.com/browse/DEL-5644

Signed-off-by: Jose Diaz de Grenu <Jose.DiazdeGrenu@digi.com>
This commit is contained in:
Jose Diaz de Grenu 2018-01-31 13:36:52 +01:00
parent f3c7f91d90
commit 4895148009
1 changed files with 9 additions and 5 deletions

View File

@ -6,9 +6,9 @@ Signed-off-by: Javier Viguera <javier.viguera@digi.com>
Signed-off-by: Jose Diaz de Grenu <Jose.DiazdeGrenu@digi.com>
---
tools/env/Makefile | 2 +-
tools/env/ubootenv.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++
tools/env/ubootenv.h | 46 ++++++++++++++++++++++++++++++++++++++
3 files changed, 109 insertions(+), 1 deletion(-)
tools/env/ubootenv.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++
tools/env/ubootenv.h | 46 ++++++++++++++++++++++++++++++++++++
3 files changed, 113 insertions(+), 1 deletion(-)
create mode 100644 tools/env/ubootenv.c
create mode 100644 tools/env/ubootenv.h
@ -27,10 +27,10 @@ index c10ff66c7772..1d99e3b65dc6 100644
diff --git a/tools/env/ubootenv.c b/tools/env/ubootenv.c
new file mode 100644
index 000000000000..836fcd14a67f
index 000000000000..eb9ad5fce097
--- /dev/null
+++ b/tools/env/ubootenv.c
@@ -0,0 +1,62 @@
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2017, Digi International Inc.
+ *
@ -88,6 +88,10 @@ index 000000000000..836fcd14a67f
+ if (ret)
+ goto err;
+
+ ret = fw_env_flush(NULL);
+ if (ret)
+ goto err;
+
+ ret = fw_env_close(NULL);
+
+err: