Skip to contentSkip to conversation

env: make import/export optional

PATCH Superseded Mike Frysinger 2 participants 3 messages Jan 10, 2011 – Mar 4, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 env: make import/export optional

---
 common/cmd_nvedit.c           |    8 ++++++++
 include/config_cmd_defaults.h |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)
common/cmd_nvedit.c +8 -0
index fb69c24..715dffd 100644
@@ -559,6 +559,7 @@ static int do_env_delete(cmd_tbl_t * cmdtp, int flag, int argc, char * const arg
 	return 0;
 }
 
+#ifdef CONFIG_CMD_EXPORTENV
 /*
  * env export [-t | -b | -c] addr [size]
  *	-t:	export as text format; if size is given, data will be
@@ -695,7 +696,9 @@ sep_err:
 		cmd);
 	return 1;
 }
+#endif
 
+#ifdef CONFIG_CMD_IMPORTENV
 /*
  * env import [-d] [-t | -b | -c] addr [size]
  *	-d:	delete existing environment before importing;
@@ -805,6 +808,7 @@ sep_err:
 		cmd);
 	return 1;
 }
+#endif
 
 #if defined(CONFIG_CMD_RUN)
 extern int do_run (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
@@ -822,8 +826,12 @@ static cmd_tbl_t cmd_env_sub[] = {
 #if defined(CONFIG_CMD_EDITENV)
 	U_BOOT_CMD_MKENT(edit, 2, 0, do_env_edit, "", ""),
 #endif
+#if defined(CONFIG_CMD_EXPORTENV)
 	U_BOOT_CMD_MKENT(export, 4, 0, do_env_export, "", ""),
+#endif
+#if defined(CONFIG_CMD_IMPORTENV)
 	U_BOOT_CMD_MKENT(import, 5, 0, do_env_import, "", ""),
+#endif
 	U_BOOT_CMD_MKENT(print, CONFIG_SYS_MAXARGS, 1, do_env_print, "", ""),
 #if defined(CONFIG_CMD_RUN)
 	U_BOOT_CMD_MKENT(run, CONFIG_SYS_MAXARGS, 1, do_run, "", ""),
include/config_cmd_defaults.h +2 -0
index 9283daa..6adebdb 100644
@@ -10,5 +10,7 @@
 #define _CONFIG_CMD_DEFAULTS_H_
 
 #define CONFIG_CMD_BOOTM 1
+#define CONFIG_CMD_EXPORTENV 1
+#define CONFIG_CMD_IMPORTENV 1
 
 #endif
Signature · 1 line
1.7.4.rc1
#1 lore raw

PATCH 1/1 env: make import/export optional

Dear Mike Frysinger,

Quoted 15 lines · In message <[email protected]> you wrote:
---
 common/cmd_nvedit.c           |    8 ++++++++
 include/config_cmd_defaults.h |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)
common/cmd_nvedit.c +1 -0
index fb69c24..715dffd 100644
@@ -559,6 +559,7 @@ static int do_env_delete(cmd_tbl_t * cmdtp, int flag, int argc, char * const arg
 	return 0;
 }
 
+#ifdef CONFIG_CMD_EXPORTENV

...

Quoted 1 line

+#ifdef CONFIG_CMD_IMPORTENV

Please document the new CONFIG_CMD_* options.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Artificial Intelligence is no match for natural stupidity.
#2 lore raw

PATCH v2 1/1 env: make import/export optional

In reply to Mike Frysinger
---
 README                        |    2 ++
 common/cmd_nvedit.c           |    8 ++++++++
 include/config_cmd_defaults.h |    2 ++
 3 files changed, 12 insertions(+), 0 deletions(-)
README +2 -0
index faee6fb..1773f00 100644
@@ -632,6 +632,7 @@ The following options need to be configured:
 		CONFIG_CMD_EDITENV	  edit env variable
 		CONFIG_CMD_EEPROM	* EEPROM read/write support
 		CONFIG_CMD_ELF		* bootelf, bootvx
+		CONFIG_CMD_EXPORTENV	* export the environment
 		CONFIG_CMD_SAVEENV	  saveenv
 		CONFIG_CMD_FDC		* Floppy Disk Support
 		CONFIG_CMD_FAT		* FAT partition support
@@ -644,6 +645,7 @@ The following options need to be configured:
 		CONFIG_CMD_IMI		  iminfo
 		CONFIG_CMD_IMLS		  List all found images
 		CONFIG_CMD_IMMAP	* IMMR dump support
+		CONFIG_CMD_IMPORTENV	* import an environment
 		CONFIG_CMD_IRQ		* irqinfo
 		CONFIG_CMD_ITEST	  Integer/string test of 2 values
 		CONFIG_CMD_JFFS2	* JFFS2 Support
common/cmd_nvedit.c +8 -0
index fb69c24..715dffd 100644
@@ -559,6 +559,7 @@ static int do_env_delete(cmd_tbl_t * cmdtp, int flag, int argc, char * const arg
 	return 0;
 }
 
+#ifdef CONFIG_CMD_EXPORTENV
 /*
  * env export [-t | -b | -c] addr [size]
  *	-t:	export as text format; if size is given, data will be
@@ -695,7 +696,9 @@ sep_err:
 		cmd);
 	return 1;
 }
+#endif
 
+#ifdef CONFIG_CMD_IMPORTENV
 /*
  * env import [-d] [-t | -b | -c] addr [size]
  *	-d:	delete existing environment before importing;
@@ -805,6 +808,7 @@ sep_err:
 		cmd);
 	return 1;
 }
+#endif
 
 #if defined(CONFIG_CMD_RUN)
 extern int do_run (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
@@ -822,8 +826,12 @@ static cmd_tbl_t cmd_env_sub[] = {
 #if defined(CONFIG_CMD_EDITENV)
 	U_BOOT_CMD_MKENT(edit, 2, 0, do_env_edit, "", ""),
 #endif
+#if defined(CONFIG_CMD_EXPORTENV)
 	U_BOOT_CMD_MKENT(export, 4, 0, do_env_export, "", ""),
+#endif
+#if defined(CONFIG_CMD_IMPORTENV)
 	U_BOOT_CMD_MKENT(import, 5, 0, do_env_import, "", ""),
+#endif
 	U_BOOT_CMD_MKENT(print, CONFIG_SYS_MAXARGS, 1, do_env_print, "", ""),
 #if defined(CONFIG_CMD_RUN)
 	U_BOOT_CMD_MKENT(run, CONFIG_SYS_MAXARGS, 1, do_run, "", ""),
include/config_cmd_defaults.h +2 -0
index 9283daa..6adebdb 100644
@@ -10,5 +10,7 @@
 #define _CONFIG_CMD_DEFAULTS_H_
 
 #define CONFIG_CMD_BOOTM 1
+#define CONFIG_CMD_EXPORTENV 1
+#define CONFIG_CMD_IMPORTENV 1
 
 #endif
Signature · 1 line
1.7.4.1