summaryrefslogtreecommitdiff
path: root/recipes-bsp
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp')
-rw-r--r--recipes-bsp/multitech/u-boot-linux-utils/crc_erase.patch10
1 files changed, 6 insertions, 4 deletions
diff --git a/recipes-bsp/multitech/u-boot-linux-utils/crc_erase.patch b/recipes-bsp/multitech/u-boot-linux-utils/crc_erase.patch
index 67cd5ef..5d78703 100644
--- a/recipes-bsp/multitech/u-boot-linux-utils/crc_erase.patch
+++ b/recipes-bsp/multitech/u-boot-linux-utils/crc_erase.patch
@@ -3,7 +3,7 @@
# Allow the deliberate erasure of the environment with the
# clearenv command.
diff --git a/src/u_boot.c b/src/u_boot.c
-index e240475..f10eaa3 100644
+index e240475..94f18ed 100644
--- a/src/u_boot.c
+++ b/src/u_boot.c
@@ -64,6 +64,8 @@ static int write_uboot_env(const char *device, struct environment *env)
@@ -54,7 +54,7 @@ index e240475..f10eaa3 100644
crc1_ok = 0;
}
-@@ -315,20 +324,26 @@ int main(int argc, char *argv[]) {
+@@ -315,20 +324,27 @@ int main(int argc, char *argv[]) {
error("read_uboot_env failed");
return 1;
}
@@ -75,8 +75,10 @@ index e240475..f10eaa3 100644
crc2_ok = 0;
}
- if (!crc1_ok && !crc2_ok) {
+- if (!crc1_ok && !crc2_ok) {
- error("both environments are bad: loading DEFAULT_ENV");
++ if (!crc1_ok && !crc2_ok && env1->crc == 0xffffffff &&
++ (env1->flags == 0xff) && (env2->flags == 0xff) && (env2->crc == 0xffffffff)) {
+ error("both environments are bad: not loading DEFAULT_ENV");
env = env1;
env->flags = 0;
@@ -85,7 +87,7 @@ index e240475..f10eaa3 100644
} else if (crc1_ok && !crc2_ok) {
env = env1;
} else if (!crc1_ok && crc2_ok) {
-@@ -353,6 +368,9 @@ int main(int argc, char *argv[]) {
+@@ -353,6 +369,9 @@ int main(int argc, char *argv[]) {
err = cmd_printenv(env, argc, argv);
} else if (!tokcmp(cmd, "setenv")) {
err = cmd_setenv(env, argc, argv);