Преглед изворни кода

u-boot-fw-utils: Fix regressions in u-boot-2016.03.

Both of these patches from upstream.

Signed-off-by: Philip Balister <philip@balister.org>
Philip Balister пре 9 година
родитељ
комит
1ff51ed878

+ 48 - 0
recipes-bsp/u-boot/files/0001-tools-env-bug-config-structs-must-be-defined-in-tool.patch

@@ -0,0 +1,48 @@
+From 43cb65b7a00e4759427a6e4b8a02039e43dab5a5 Mon Sep 17 00:00:00 2001
+From: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
+Date: Fri, 25 Mar 2016 14:52:19 +0100
+Subject: [PATCH] tools: env: bug: config structs must be defined in tools
+ library
+
+fw_senten/fw_printenv can be compiled as a tools library,
+excluding the fw_env_main object.
+
+Reported-by: Stefano Babic <sbabic@denx.de>
+Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
+---
+ tools/env/fw_env.c      | 4 ++++
+ tools/env/fw_env_main.c | 4 ----
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
+index 5c7505c..1420ac5 100644
+--- a/tools/env/fw_env.c
++++ b/tools/env/fw_env.c
+@@ -35,6 +35,10 @@
+
+ #include "fw_env.h"
+
++struct common_args common_args;
++struct printenv_args printenv_args;
++struct setenv_args setenv_args;
++
+ #define DIV_ROUND_UP(n, d)	(((n) + (d) - 1) / (d))
+
+ #define min(x, y) ({				\
+diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c
+index 3bec5b9..3706d8f 100644
+--- a/tools/env/fw_env_main.c
++++ b/tools/env/fw_env_main.c
+@@ -49,10 +49,6 @@ static struct option long_options[] = {
+	{NULL, 0, NULL, 0}
+ };
+
+-struct common_args common_args;
+-struct printenv_args printenv_args;
+-struct setenv_args setenv_args;
+-
+ void usage_printenv(void)
+ {
+
+--
+2.5.5

+ 34 - 0
recipes-bsp/u-boot/files/0001-tools-env-fix-config-file-loading-in-env-library.patch

@@ -0,0 +1,34 @@
+From 925c97c248527391de32c2926f7e1911850fd4b0 Mon Sep 17 00:00:00 2001
+From: Anatolij Gustschin <agust@denx.de>
+Date: Fri, 29 Apr 2016 22:00:11 +0200
+Subject: [PATCH] tools: env: fix config file loading in env library
+
+env library is broken as the config file pointer is only initialized
+in main(). When running in the env library parse_config() fails:
+
+  Cannot parse config file '(null)': Bad address
+
+Ensure that config file pointer is always initialized.
+
+Signed-off-by: Anatolij Gustschin <agust@denx.de>
+Cc: Stefano Babic <sbabic@denx.de>
+---
+ tools/env/fw_env.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
+index 1420ac5..06cf63d 100644
+--- a/tools/env/fw_env.c
++++ b/tools/env/fw_env.c
+@@ -1325,6 +1325,9 @@ static int parse_config ()
+	struct stat st;
+
+ #if defined(CONFIG_FILE)
++	if (!common_args.config_file)
++		common_args.config_file = CONFIG_FILE;
++
+	/* Fills in DEVNAME(), ENVSIZE(), DEVESIZE(). Or don't. */
+	if (get_config(common_args.config_file)) {
+		fprintf(stderr, "Cannot parse config file '%s': %m\n",
+--
+2.5.5