summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Nikolaus Schaller <hns@goldelico.com>2012-10-30 10:26:55 +0100
committerH. Nikolaus Schaller <hns@goldelico.com>2012-10-30 10:26:55 +0100
commit2e3073ba97abf68f15825592428bdcd50e40810c (patch)
tree9ab274346625a1deb5ea451b8adb565bb6a50acd
parent08096acc438daf8d9dac2d55d44fbad8e89b7b62 (diff)
downloadbootable_bootloader_goldelico_gta04-2e3073ba97abf68f15825592428bdcd50e40810c.zip
bootable_bootloader_goldelico_gta04-2e3073ba97abf68f15825592428bdcd50e40810c.tar.gz
bootable_bootloader_goldelico_gta04-2e3073ba97abf68f15825592428bdcd50e40810c.tar.bz2
added a CONFIG option so that U-Boot can be enforced to start with a new default environment but keep saveenv to NAND flash intact
-rw-r--r--u-boot/common/env_common.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/u-boot/common/env_common.c b/u-boot/common/env_common.c
index c3e6388..10ea90c 100644
--- a/u-boot/common/env_common.c
+++ b/u-boot/common/env_common.c
@@ -204,11 +204,15 @@ int env_import(const char *buf, int check)
{
env_t *ep = (env_t *)buf;
+#if defined(CONFIG_START_WITH_DEFAULT_ENVIRONMENT)
+ set_default_env(NULL);
+ return 0;
+#endif
+
if (check) {
uint32_t crc;
memcpy(&crc, &ep->crc, sizeof(crc));
-
if (crc32(0, ep->data, ENV_SIZE) != crc) {
set_default_env("!bad CRC");
return 0;