Skip to contentSkip to conversation

Make default environment available in fw_printenv

RFC PATCH New Selvamuthukumar 1 participant 1 message Feb 28, 2009

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 Make default environment available in fw_printenv

Include board configuration file in fw_printenv to get default environment variables.

---
I'm not sure whether this can be achived without any change in code, And howmany other things this change breaks, so marking it as RFC.

 tools/env/fw_env.c |    4 ++++
 tools/env/fw_env.h |    8 --------
 2 files changed, 4 insertions(+), 8 deletions(-)
tools/env/fw_env.c +4 -0
index 46747d3..52bae45 100644
@@ -24,6 +24,7 @@
  * MA 02111-1307 USA
  */
 
+#include <config.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
@@ -80,6 +81,9 @@ static int dev_current;
 #define ENVSECTORS(i) envdevices[(i)].env_sectors
 #define DEVTYPE(i)    envdevices[(i)].mtd_type
 
+#ifdef CONFIG_ENV_SIZE
+#undef CONFIG_ENV_SIZE
+#endif
 #define CONFIG_ENV_SIZE ENVSIZE(dev_current)
 
 #define ENV_SIZE      getenvsize()
tools/env/fw_env.h +0 -8
index c04da54..ce4b5ed 100644
@@ -39,14 +39,6 @@
 #define ENV2_SIZE         0x4000
 #define DEVICE2_ESIZE     0x4000
 
-#define CONFIG_BAUDRATE		115200
-#define CONFIG_BOOTDELAY	5	/* autoboot after 5 seconds	*/
-#define CONFIG_BOOTCOMMAND							\
-	"bootp; "								\
-	"setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} "	\
-	"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; "	\
-	"bootm"
-
 extern int   fw_printenv(int argc, char *argv[]);
 extern char *fw_getenv  (char *name);
 extern int fw_setenv  (int argc, char *argv[]);
Signature · 1 line
1.5.5