From 2e3073ba97abf68f15825592428bdcd50e40810c Mon Sep 17 00:00:00 2001 From: "H. Nikolaus Schaller" Date: Tue, 30 Oct 2012 10:26:55 +0100 Subject: 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 --- u-boot/common/env_common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- cgit v1.1