diff options
author | Gerald Van Baren <vanbaren@cideas.com> | 2007-08-10 19:19:50 -0400 |
---|---|---|
committer | Gerald Van Baren <vanbaren@cideas.com> | 2007-08-10 19:19:50 -0400 |
commit | 29eaae953476f2bba4d5c7ac097b96cd827c1dff (patch) | |
tree | 537faa4c04db58ee7b070b56bd7de7bd116092d3 /common/cmd_nvedit.c | |
parent | ed8e5f362a2fc572eb9c1854f6c76c291b0f9a0f (diff) | |
parent | fb56579ffe7ef3275b7036bb7b924e5a0d32bd70 (diff) |
Merge git://www.denx.de/git/u-boot
Diffstat (limited to 'common/cmd_nvedit.c')
-rw-r--r-- | common/cmd_nvedit.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index de5a5148f..1db0fc3c0 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -193,7 +193,12 @@ int _do_setenv (int flag, int argc, char *argv[]) * Ethernet Address and serial# can be set only once, * ver is readonly. */ +#ifdef CONFIG_HAS_UID + /* Allow serial# forced overwrite with 0xdeaf4add flag */ + if ( ((strcmp (name, "serial#") == 0) && (flag != 0xdeaf4add)) || +#else if ( (strcmp (name, "serial#") == 0) || +#endif ((strcmp (name, "ethaddr") == 0) #if defined(CONFIG_OVERWRITE_ETHADDR_ONCE) && defined(CONFIG_ETHADDR) && (strcmp ((char *)env_get_addr(oldval),MK_STR(CONFIG_ETHADDR)) != 0) @@ -397,7 +402,15 @@ void setenv (char *varname, char *varvalue) _do_setenv (0, 3, argv); } -int do_setenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +#ifdef CONFIG_HAS_UID +void forceenv (char *varname, char *varvalue) +{ + char *argv[4] = { "forceenv", varname, varvalue, NULL }; + _do_setenv (0xdeaf4add, 3, argv); +} +#endif + +int do_setenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { if (argc < 2) { printf ("Usage:\n%s\n", cmdtp->usage); |