Automatically write default U-boot environment into Flash if environment damaged on U-boot load

This allows the default environment string in the U-boot binary to be used versus the (potentially incorrect)
default environment string in fw_printenv / fw_setenv
parent e73a6025
diff --git a/common/env_common.c b/common/env_common.c
index 13db7dc..00ca394 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -122,6 +122,9 @@ void set_default_env(const char *s)
0, NULL) == 0)
error("Environment import failed: errno = %d\n", errno);
+ puts("Storing new environment in Flash\n\n");
+ saveenv();
gd->flags |= GD_FLG_ENV_READY;
gd->flags |= GD_FLG_ENV_DEFAULT;
require u-boot-common-aspeed_${PV}.inc
require recipes-bsp/u-boot/
SRC_URI += "file://save-default-environment-on-crc-fail.patch"
PROVIDES += "u-boot"
DEPENDS += "dtc-native"
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment