[05/11] cmd: saveenv: enable the saveenv command when ENV_IS_NOWHERE is defined

Message ID 4bba43c82f3da1149c93a6191b74674553d6a970.1513975247.git-series.quentin.schulz@free-electrons.com
State New
Headers show
Series
  • Introduce variables whitelisting in environment
Related show

Commit Message

Quentin Schulz Dec. 22, 2017, 9:13 p.m.
but another env medium is enabled too

Now that it is possible to have multiple environments at the same time,
nowhere included, enable the saveenv command when nowhere medium is
enabled but accompanied by another medium on which the saveenv command
is possible.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
---
 cmd/nvedit.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Patch

diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index c00e1da..84a7004 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -704,7 +704,19 @@  ulong env_get_ulong(const char *name, int base, ulong default_val)
 }
 
 #ifndef CONFIG_SPL_BUILD
-#if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE)
+#if defined(CONFIG_CMD_SAVEENV) && (!defined(CONFIG_ENV_IS_NOWHERE) || (\
+	defined(CONFIG_ENV_IS_IN_EEPROM)	|| \
+	defined(CONFIG_ENV_IS_IN_FLASH)		|| \
+	defined(CONFIG_ENV_IS_IN_MMC)		|| \
+	defined(CONFIG_ENV_IS_IN_FAT)		|| \
+	defined(CONFIG_ENV_IS_IN_EXT4)		|| \
+	defined(CONFIG_ENV_IS_IN_NAND)		|| \
+	defined(CONFIG_ENV_IS_IN_NVRAM)		|| \
+	defined(CONFIG_ENV_IS_IN_ONENAND)	|| \
+	defined(CONFIG_ENV_IS_IN_SATA)		|| \
+	defined(CONFIG_ENV_IS_IN_SPI_FLASH)	|| \
+	defined(CONFIG_ENV_IS_IN_REMOTE)	|| \
+	defined(CONFIG_ENV_IS_IN_UBI)))
 static int do_env_save(cmd_tbl_t *cmdtp, int flag, int argc,
 		       char * const argv[])
 {