* [U-Boot] [PATCH] make fw_setenv write multiple variables
@ 2009-04-30 9:46 Nikos Mavrogiannopoulos
2009-04-30 11:06 ` Wolfgang Denk
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Nikos Mavrogiannopoulos @ 2009-04-30 9:46 UTC (permalink / raw)
To: u-boot
This patch makes fw_setenv write multiple variables on a single command
line. That is "fw_setenv var1 value1 var2 value2" will write all
variables and values without the need to erase multiple times the
environment.
regards,
Nikos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Allow-fw_setenv-to-write-multiple-variables-in-the-s.patch
Type: text/x-patch
Size: 0 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090430/434eb942/attachment.bin
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] make fw_setenv write multiple variables
2009-04-30 9:46 [U-Boot] [PATCH] make fw_setenv write multiple variables Nikos Mavrogiannopoulos
@ 2009-04-30 11:06 ` Wolfgang Denk
2009-04-30 11:31 ` Marc Leeman
2009-04-30 11:37 ` Marc Leeman
2 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2009-04-30 11:06 UTC (permalink / raw)
To: u-boot
Dear Nikos Mavrogiannopoulos,
In message <49F9738D.9060703@gennetsa.com> you wrote:
>
> This patch makes fw_setenv write multiple variables on a single command
> line. That is "fw_setenv var1 value1 var2 value2" will write all
> variables and values without the need to erase multiple times the
> environment.
I reject this as it would introduce serious incompatibilities with
the existing interfaces, both in fw_setenv and in the U-Boot setenv
command.
Not to mention that it would be extremely error prone.
But I understand that such a functionality may be useful - just your
interface design is bogus.
What about the following alternative: add an option to fw_setenv to
read the commands (evventually even with an [optional?] leading
"setenv") from a file (or from stdin, if no file name or '-' is
given). Then you can have one set of parameters per line, and no
argument counting or similar things are needed.
What do you think?
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
Another dream that failed. There's nothing sadder.
-- Kirk, "This side of Paradise", stardate 3417.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] make fw_setenv write multiple variables
2009-04-30 9:46 [U-Boot] [PATCH] make fw_setenv write multiple variables Nikos Mavrogiannopoulos
2009-04-30 11:06 ` Wolfgang Denk
@ 2009-04-30 11:31 ` Marc Leeman
2009-04-30 11:37 ` Marc Leeman
2 siblings, 0 replies; 7+ messages in thread
From: Marc Leeman @ 2009-04-30 11:31 UTC (permalink / raw)
To: u-boot
> This patch makes fw_setenv write multiple variables on a single command
> line. That is "fw_setenv var1 value1 var2 value2" will write all
> variables and values without the need to erase multiple times the
> environment.
IIRC fw_setenv uses the first word as key and all the rest as the value.
Judging on the description of your patch, this will probably break this
behaviour.
I wrote a fw_editenv with -k/-v flags a couple of years ago in order to
get around this, but i don't remember if I submitted it to the list.
--
greetz, marc
Mediocrity finds safety in standardization.
-- Frederick Crane
crichton 2.6.26 #1 PREEMPT Tue Jul 29 21:17:59 CDT 2008 GNU/Linux
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090430/2e68db27/attachment.pgp
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] make fw_setenv write multiple variables
2009-04-30 9:46 [U-Boot] [PATCH] make fw_setenv write multiple variables Nikos Mavrogiannopoulos
2009-04-30 11:06 ` Wolfgang Denk
2009-04-30 11:31 ` Marc Leeman
@ 2009-04-30 11:37 ` Marc Leeman
2009-04-30 13:13 ` Wolfgang Denk
2 siblings, 1 reply; 7+ messages in thread
From: Marc Leeman @ 2009-04-30 11:37 UTC (permalink / raw)
To: u-boot
If I didn't in the past, I did now; this is what we are using to write
from the firmware to do bulk changes in the u-boot config space.
The patch is against 1.3.3
--
greetz, marc
(1) Never draw what you can copy.
(2) Never copy what you can trace.
(3) Never trace what you can cut out and paste down.
crichton 2.6.26 #1 PREEMPT Tue Jul 29 21:17:59 CDT 2008 GNU/Linux
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fw_editenv.diff
Type: text/x-diff
Size: 5203 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090430/0dca99a3/attachment.diff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090430/0dca99a3/attachment.pgp
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] make fw_setenv write multiple variables
2009-04-30 11:37 ` Marc Leeman
@ 2009-04-30 13:13 ` Wolfgang Denk
2009-04-30 13:27 ` Marc Leeman
0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2009-04-30 13:13 UTC (permalink / raw)
To: u-boot
Dear Marc,
In message <20090430113741.GD10108@crichton.homelinux.org> you wrote:
>
> If I didn't in the past, I did now; this is what we are using to write
> from the firmware to do bulk changes in the u-boot config space.
>
> The patch is against 1.3.3
Thanks a lot.
Hm... this seems a lot of code to deal with a trivial issue. I think
implementing my idea (reading the input line by line from a text
file) would be much easier to implement and easier to use as well.
And of course the patch doesn't apply any more against current code.
[Not to mention that the Signed-off-by: line is missing, plus there
are coding style issues.]
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
God made the integers; all else is the work of Man. - Kronecker
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] make fw_setenv write multiple variables
2009-04-30 13:13 ` Wolfgang Denk
@ 2009-04-30 13:27 ` Marc Leeman
2009-04-30 16:46 ` Wolfgang Denk
0 siblings, 1 reply; 7+ messages in thread
From: Marc Leeman @ 2009-04-30 13:27 UTC (permalink / raw)
To: u-boot
> Hm... this seems a lot of code to deal with a trivial issue. I ?think
> implementing ?my ?idea ?(reading ?the ?input line by line from a text
> file) would be much easier to implement and easier to use as well.
Yeah, probably.
IIRC, I tried to stick as close to the fw_Xenv code structure as possible;
as such, this basically copies the fw_setenv block and modifies it without
interfering or breaking in the upstream code.
> And of course the patch doesn't apply any more against current code.
I haven't looked at it, but unless there are large differences and rewrites
in fw_env.c; the block of code should apply pretty easily: that's one of the
underlying reasons keeping to current fw_env.c code separate and adding on it.
> [Not to mention that the Signed-off-by: line is missing, plus there
> are coding style issues.]
I didn't expect it to get applied: I just used it as input to the
fw_setenv key val val val val
example
--
br, marc
The best approach for you requires two steps. The first step is
reading the Manual.
Wolfgang Denk - u-boot mailing list
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] make fw_setenv write multiple variables
2009-04-30 13:27 ` Marc Leeman
@ 2009-04-30 16:46 ` Wolfgang Denk
0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2009-04-30 16:46 UTC (permalink / raw)
To: u-boot
Dear Marc Leeman,
In message <1f729c480904300627r5661774ej7d2cf5a19bee1083@mail.gmail.com> you wrote:
>
> IIRC, I tried to stick as close to the fw_Xenv code structure as possible;
> as such, this basically copies the fw_setenv block and modifies it without
> interfering or breaking in the upstream code.
Indeed. That code duplication is another problem, which for itself
would be reason enough to reject the patch. It's unmaintainable.
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
Men of peace usually are [brave].
-- Spock, "The Savage Curtain", stardate 5906.5
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-04-30 16:46 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-30 9:46 [U-Boot] [PATCH] make fw_setenv write multiple variables Nikos Mavrogiannopoulos
2009-04-30 11:06 ` Wolfgang Denk
2009-04-30 11:31 ` Marc Leeman
2009-04-30 11:37 ` Marc Leeman
2009-04-30 13:13 ` Wolfgang Denk
2009-04-30 13:27 ` Marc Leeman
2009-04-30 16:46 ` Wolfgang Denk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.