* [U-Boot] [PATCH] saveenv: standardize enablement
@ 2008-12-30 7:59 Mike Frysinger
2009-01-26 4:13 ` Mike Frysinger
2009-01-27 21:35 ` Wolfgang Denk
0 siblings, 2 replies; 10+ messages in thread
From: Mike Frysinger @ 2008-12-30 7:59 UTC (permalink / raw)
To: u-boot
Rather than special casing each environment type for enabling the saveenv
command, have them all behave the same. This avoids bitrot as new env
sources are added/removed.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
common/cmd_nvedit.c | 26 ++++++++------------------
1 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 85025da..b93de13 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -546,11 +546,8 @@ int getenv_r (char *name, char *buf, unsigned len)
return (-1);
}
-#if ((defined(CONFIG_ENV_IS_IN_NVRAM) || defined(CONFIG_ENV_IS_IN_EEPROM) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \
- && !defined(CONFIG_ENV_IS_NOWHERE))
+#if defined(CONFIG_CMD_ENV) && !defined(CONFIG_ENV_IS_NOWHERE)
+
int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
extern char * env_name_spec;
@@ -560,6 +557,12 @@ int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return (saveenv() ? 1 : 0);
}
+U_BOOT_CMD(
+ saveenv, 1, 0, do_saveenv,
+ "saveenv - save environment variables to persistent storage\n",
+ NULL
+);
+
#endif
@@ -602,19 +605,6 @@ U_BOOT_CMD(
" - delete environment variable 'name'\n"
);
-#if ((defined(CONFIG_ENV_IS_IN_NVRAM) || defined(CONFIG_ENV_IS_IN_EEPROM) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \
- && !defined(CONFIG_ENV_IS_NOWHERE))
-U_BOOT_CMD(
- saveenv, 1, 0, do_saveenv,
- "saveenv - save environment variables to persistent storage\n",
- NULL
-);
-
-#endif
-
#if defined(CONFIG_CMD_ASKENV)
U_BOOT_CMD(
--
1.6.0.6
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] saveenv: standardize enablement
2008-12-30 7:59 [U-Boot] [PATCH] saveenv: standardize enablement Mike Frysinger
@ 2009-01-26 4:13 ` Mike Frysinger
2009-01-27 21:35 ` Wolfgang Denk
1 sibling, 0 replies; 10+ messages in thread
From: Mike Frysinger @ 2009-01-26 4:13 UTC (permalink / raw)
To: u-boot
On Tuesday 30 December 2008 02:59:25 Mike Frysinger wrote:
> Rather than special casing each environment type for enabling the saveenv
> command, have them all behave the same. This avoids bitrot as new env
> sources are added/removed.
ping ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090125/75825444/attachment.pgp
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] saveenv: standardize enablement
2008-12-30 7:59 [U-Boot] [PATCH] saveenv: standardize enablement Mike Frysinger
2009-01-26 4:13 ` Mike Frysinger
@ 2009-01-27 21:35 ` Wolfgang Denk
2009-01-28 8:17 ` Wolfgang Denk
1 sibling, 1 reply; 10+ messages in thread
From: Wolfgang Denk @ 2009-01-27 21:35 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <1230623965-16546-1-git-send-email-vapier@gentoo.org> you wrote:
> Rather than special casing each environment type for enabling the saveenv
> command, have them all behave the same. This avoids bitrot as new env
> sources are added/removed.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> common/cmd_nvedit.c | 26 ++++++++------------------
> 1 files changed, 8 insertions(+), 18 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
--
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
Our way is peace.
-- Septimus, the Son Worshiper, "Bread and Circuses",
stardate 4040.7.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] saveenv: standardize enablement
2009-01-27 21:35 ` Wolfgang Denk
@ 2009-01-28 8:17 ` Wolfgang Denk
2009-01-28 8:50 ` Mike Frysinger
2009-01-28 18:48 ` [U-Boot] [PATCH] SPD823TS: do not define CONFIG_CMD_ENV Mike Frysinger
0 siblings, 2 replies; 10+ messages in thread
From: Wolfgang Denk @ 2009-01-28 8:17 UTC (permalink / raw)
To: u-boot
Dear Mike,
In message <1230623965-16546-1-git-send-email-vapier@gentoo.org> you wrote:
> Rather than special casing each environment type for enabling the saveenv
> command, have them all behave the same. This avoids bitrot as new env
> sources are added/removed.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> common/cmd_nvedit.c | 26 ++++++++------------------
> 1 files changed, 8 insertions(+), 18 deletions(-)
This patch breaks support for the
This board is a bit unusual as it is ROM based - it has
CONFIG_ENV_IS_IN_FLASH set because the default environment is embedded in
the ROM, but does not enable the flash driver (because there is no
flash on the board). So the test in "common/cmd_nvedit.c":
549 #if defined(CONFIG_CMD_ENV) && !defined(CONFIG_ENV_IS_NOWHERE)
fails - it enables do_saveenv(), but there is no underlying saveenv()
function. Result:
common/libcommon.a(cmd_nvedit.o): In function `do_saveenv':
common/cmd_nvedit.c:557: undefined reference to `saveenv'
make: *** [u-boot] Error 1
Please fix.
Best regards,
Wolfgang Denk
--
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
Never underestimate the bandwidth of a station wagon full of tapes.
-- Dr. Warren Jackson, Director, UTCS
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] saveenv: standardize enablement
2009-01-28 8:17 ` Wolfgang Denk
@ 2009-01-28 8:50 ` Mike Frysinger
2009-01-28 9:03 ` Wolfgang Denk
2009-01-28 18:48 ` [U-Boot] [PATCH] SPD823TS: do not define CONFIG_CMD_ENV Mike Frysinger
1 sibling, 1 reply; 10+ messages in thread
From: Mike Frysinger @ 2009-01-28 8:50 UTC (permalink / raw)
To: u-boot
On Wednesday 28 January 2009 03:17:06 Wolfgang Denk wrote:
> In message <1230623965-16546-1-git-send-email-vapier@gentoo.org> you wrote:
> > Rather than special casing each environment type for enabling the saveenv
> > command, have them all behave the same. This avoids bitrot as new env
> > sources are added/removed.
> >
> > Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> > ---
> > common/cmd_nvedit.c | 26 ++++++++------------------
> > 1 files changed, 8 insertions(+), 18 deletions(-)
>
> This patch breaks support for the
looks like the actual board name was missed in your e-mail ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090128/bb863ef4/attachment-0001.pgp
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] saveenv: standardize enablement
2009-01-28 8:50 ` Mike Frysinger
@ 2009-01-28 9:03 ` Wolfgang Denk
0 siblings, 0 replies; 10+ messages in thread
From: Wolfgang Denk @ 2009-01-28 9:03 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <200901280350.10310.vapier@gentoo.org> you wrote:
>
> > This patch breaks support for the
>
> looks like the actual board name was missed in your e-mail ?
Oops.
... for the SPD823TS board.
Thanks.
Best regards,
Wolfgang Denk
--
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
Unser Kopf ist rund, damit das Denken die Richtung wechseln kann.
-- Francis Picabia
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] SPD823TS: do not define CONFIG_CMD_ENV
2009-01-28 8:17 ` Wolfgang Denk
2009-01-28 8:50 ` Mike Frysinger
@ 2009-01-28 18:48 ` Mike Frysinger
2009-01-28 18:54 ` Mike Frysinger
2009-01-28 21:23 ` Wolfgang Denk
1 sibling, 2 replies; 10+ messages in thread
From: Mike Frysinger @ 2009-01-28 18:48 UTC (permalink / raw)
To: u-boot
Since the SPD823TS board does not actually have any writable flash to save
its environment, undefine CONFIG_CMD_ENV so the "saveenv" command is
disabled.
This fixes the build error:
common/libcommon.a(cmd_nvedit.o): In function `do_saveenv':
common/cmd_nvedit.c:557: undefined reference to `saveenv'
make: *** [u-boot] Error 1
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
include/configs/SPD823TS.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/configs/SPD823TS.h b/include/configs/SPD823TS.h
index 9201346..d4154d2 100644
--- a/include/configs/SPD823TS.h
+++ b/include/configs/SPD823TS.h
@@ -67,6 +67,7 @@
#define CONFIG_CMD_IDE
+#undef CONFIG_CMD_ENV
#undef CONFIG_CMD_FLASH
--
1.6.1.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] SPD823TS: do not define CONFIG_CMD_ENV
2009-01-28 18:48 ` [U-Boot] [PATCH] SPD823TS: do not define CONFIG_CMD_ENV Mike Frysinger
@ 2009-01-28 18:54 ` Mike Frysinger
2009-01-28 21:24 ` Wolfgang Denk
2009-01-28 21:23 ` Wolfgang Denk
1 sibling, 1 reply; 10+ messages in thread
From: Mike Frysinger @ 2009-01-28 18:54 UTC (permalink / raw)
To: u-boot
On Wednesday 28 January 2009 13:48:55 Mike Frysinger wrote:
> Since the SPD823TS board does not actually have any writable flash to save
> its environment, undefine CONFIG_CMD_ENV so the "saveenv" command is
> disabled.
btw, i find the "CONFIG_CMD_ENV -> saveenv" bindings a bit confusing. any
qualms with doing a giant sed to convert it to CONFIG_CMD_SAVEENV ?
sed -i 's:CONFIG_CMD_ENV\>:CONFIG_CMD_SAVEENV:g' \
include/*.h include/configs/*.h common/*.c README
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090128/0a3dfca6/attachment.pgp
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] SPD823TS: do not define CONFIG_CMD_ENV
2009-01-28 18:48 ` [U-Boot] [PATCH] SPD823TS: do not define CONFIG_CMD_ENV Mike Frysinger
2009-01-28 18:54 ` Mike Frysinger
@ 2009-01-28 21:23 ` Wolfgang Denk
1 sibling, 0 replies; 10+ messages in thread
From: Wolfgang Denk @ 2009-01-28 21:23 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <1233168535-16153-1-git-send-email-vapier@gentoo.org> you wrote:
> Since the SPD823TS board does not actually have any writable flash to save
> its environment, undefine CONFIG_CMD_ENV so the "saveenv" command is
> disabled.
>
> This fixes the build error:
> common/libcommon.a(cmd_nvedit.o): In function `do_saveenv':
> common/cmd_nvedit.c:557: undefined reference to `saveenv'
> make: *** [u-boot] Error 1
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> include/configs/SPD823TS.h | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
--
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
The night sky over the planet Krikkit is the least interesting sight
in the entire Universe.
- Douglas Adams _Life, the Universe, and Everything_
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] SPD823TS: do not define CONFIG_CMD_ENV
2009-01-28 18:54 ` Mike Frysinger
@ 2009-01-28 21:24 ` Wolfgang Denk
0 siblings, 0 replies; 10+ messages in thread
From: Wolfgang Denk @ 2009-01-28 21:24 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <200901281354.18466.vapier@gentoo.org> you wrote:
>
> btw, i find the "CONFIG_CMD_ENV -> saveenv" bindings a bit confusing. any
> qualms with doing a giant sed to convert it to CONFIG_CMD_SAVEENV ?
> sed -i 's:CONFIG_CMD_ENV\>:CONFIG_CMD_SAVEENV:g' \
> include/*.h include/configs/*.h common/*.c README
Feel free to go on.
Best regards,
Wolfgang Denk
--
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
There's an old proverb that says just about whatever you want it to.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-01-28 21:24 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-30 7:59 [U-Boot] [PATCH] saveenv: standardize enablement Mike Frysinger
2009-01-26 4:13 ` Mike Frysinger
2009-01-27 21:35 ` Wolfgang Denk
2009-01-28 8:17 ` Wolfgang Denk
2009-01-28 8:50 ` Mike Frysinger
2009-01-28 9:03 ` Wolfgang Denk
2009-01-28 18:48 ` [U-Boot] [PATCH] SPD823TS: do not define CONFIG_CMD_ENV Mike Frysinger
2009-01-28 18:54 ` Mike Frysinger
2009-01-28 21:24 ` Wolfgang Denk
2009-01-28 21:23 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox