All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] tftp "command" in default environments
@ 2011-06-22 14:28 Luca Ceresoli
  2011-06-22 15:07 ` Igor Grinberg
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Luca Ceresoli @ 2011-06-22 14:28 UTC (permalink / raw)
  To: u-boot

Hi,

since 7a83af07aef3c (TFTP: add tftpsrv command) U-Boot has a new "tftpsrv"
command, which can be enabled by defining CONFIG_CMD_TFTPSRV.

Unfortunately, activating it causes some boards to stop working correctly.
This is because they use the tftp "command" in their environment, but tftp is
has never been a real command, just the prefix for tftpboot.
tftpboot used to be the sole completion for the tftp prefix, and this is still
true unless one activates tftpsrv.

A few numbers (consider a little percentage of false positives):
$ git grep -w tftp | wc
     788    4853   59575
$ git grep -w tftp include/configs/ board/ | wc
     658    4095   51357
$ git grep -w tftp doc/ README | wc
     119     685    7661

This is of course a bug in many boards (and the docs too).

It's obviously to be fixed for boards that define CONFIG_CMD_TFTPSRV:
currently none, but soon I'll update dig297 in this sense.

Fixing the docs would be wise, too. I'll try to find some time to do this job.

What I'm not sure about is if the default environment for all boards should be
fixed as well.
This would increase the binary size and the environment size. The increase
would be of a few bytes, is it correct to assume that it is negligible for all
boards?
OTOH it would give no visible advantage to those boards that will never want
tftpsrv at all, which are probably the vast majority.

I look forward to receive comments on this last question.

Luca



 
Luca Ceresoli
 

"Luca Ceresoli" <luca.ceresoli@comelit.it>
Comelit Group S.p.a.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] tftp "command" in default environments
  2011-06-22 14:28 [U-Boot] tftp "command" in default environments Luca Ceresoli
@ 2011-06-22 15:07 ` Igor Grinberg
  2011-06-22 16:07 ` Mike Frysinger
  2011-06-22 17:32 ` Wolfgang Denk
  2 siblings, 0 replies; 7+ messages in thread
From: Igor Grinberg @ 2011-06-22 15:07 UTC (permalink / raw)
  To: u-boot

On 06/22/11 17:28, Luca Ceresoli wrote:

> Hi,
>
> since 7a83af07aef3c (TFTP: add tftpsrv command) U-Boot has a new "tftpsrv"
> command, which can be enabled by defining CONFIG_CMD_TFTPSRV.
>
> Unfortunately, activating it causes some boards to stop working correctly.
> This is because they use the tftp "command" in their environment, but tftp is
> has never been a real command, just the prefix for tftpboot.
> tftpboot used to be the sole completion for the tftp prefix, and this is still
> true unless one activates tftpsrv.

Don't enable the CONFIG_CMD_TFTPSRV by default.
Only boards that want to use the tftpsrv command,
should define the above config.
This makes it like this: if you define the CONFIG_CMD_TFTPSRV,
then you need to make sure your default environment is still good,
if you don't define it then you should not have a problem.
Right?

> A few numbers (consider a little percentage of false positives):
> $ git grep -w tftp | wc
>      788    4853   59575
> $ git grep -w tftp include/configs/ board/ | wc
>      658    4095   51357
> $ git grep -w tftp doc/ README | wc
>      119     685    7661
>
> This is of course a bug in many boards (and the docs too).
>
> It's obviously to be fixed for boards that define CONFIG_CMD_TFTPSRV:
> currently none, but soon I'll update dig297 in this sense.
>
> Fixing the docs would be wise, too. I'll try to find some time to do this job.
>
> What I'm not sure about is if the default environment for all boards should be
> fixed as well.

See above

> This would increase the binary size and the environment size. The increase
> would be of a few bytes, is it correct to assume that it is negligible for all
> boards?

looks like a non issue

> OTOH it would give no visible advantage to those boards that will never want
> tftpsrv at all, which are probably the vast majority.

yep.



-- 
Regards,
Igor.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] tftp "command" in default environments
  2011-06-22 14:28 [U-Boot] tftp "command" in default environments Luca Ceresoli
  2011-06-22 15:07 ` Igor Grinberg
@ 2011-06-22 16:07 ` Mike Frysinger
  2011-06-22 17:26   ` Wolfgang Denk
  2011-06-22 17:32 ` Wolfgang Denk
  2 siblings, 1 reply; 7+ messages in thread
From: Mike Frysinger @ 2011-06-22 16:07 UTC (permalink / raw)
  To: u-boot

On Wednesday, June 22, 2011 10:28:59 Luca Ceresoli wrote:
> Unfortunately, activating it causes some boards to stop working correctly.
> This is because they use the tftp "command" in their environment, but tftp
> is has never been a real command, just the prefix for tftpboot.
> tftpboot used to be the sole completion for the tftp prefix, and this is
> still true unless one activates tftpsrv.

those configs are broken.  the autocomplete support has never been something 
you can rely on if you add new commands.  if you want correct behavior all the 
time, then use the full proper name (i.e. "tftpboot" not "tftp").

> This is of course a bug in many boards (and the docs too).

submit patches
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110622/dd5de1b9/attachment.pgp 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] tftp "command" in default environments
  2011-06-22 16:07 ` Mike Frysinger
@ 2011-06-22 17:26   ` Wolfgang Denk
  2011-06-22 17:44     ` Mike Frysinger
  2011-06-22 19:53     ` Eric Cooper
  0 siblings, 2 replies; 7+ messages in thread
From: Wolfgang Denk @ 2011-06-22 17:26 UTC (permalink / raw)
  To: u-boot

Dear Mike Frysinger,

In message <201106221207.42499.vapier@gentoo.org> you wrote:
>
> > Unfortunately, activating it causes some boards to stop working correctly.
> > This is because they use the tftp "command" in their environment, but tftp
> > is has never been a real command, just the prefix for tftpboot.
> > tftpboot used to be the sole completion for the tftp prefix, and this is
> > still true unless one activates tftpsrv.
>
> those configs are broken.  the autocomplete support has never been something 

This has absolutely nothing to do with autocomplete.  It's just using
the fact that you can abbreviate all command names as long as they
remain unambiguous.

> you can rely on if you add new commands.  if you want correct behavior all the 
> time, then use the full proper name (i.e. "tftpboot" not "tftp").

True.

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
"A dirty mind is a joy forever."                       - Randy Kunkee

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] tftp "command" in default environments
  2011-06-22 14:28 [U-Boot] tftp "command" in default environments Luca Ceresoli
  2011-06-22 15:07 ` Igor Grinberg
  2011-06-22 16:07 ` Mike Frysinger
@ 2011-06-22 17:32 ` Wolfgang Denk
  2 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2011-06-22 17:32 UTC (permalink / raw)
  To: u-boot

Dear "Luca Ceresoli",

In message <4E01FC2B.3010402@comelit.it> you wrote:
> 
> since 7a83af07aef3c (TFTP: add tftpsrv command) U-Boot has a new "tftpsrv"
> command, which can be enabled by defining CONFIG_CMD_TFTPSRV.

Right.

> Unfortunately, activating it causes some boards to stop working correctly.

I think this is not quite correct.  I don't see any broken board.

> This is because they use the tftp "command" in their environment, but tftp is
> has never been a real command, just the prefix for tftpboot.
> tftpboot used to be the sole completion for the tftp prefix, and this is still
> true unless one activates tftpsrv.

Correct.  So only those board maintainers that use "tftp" as
abbreviation _and_ now changing their board configuration to include
the "tftpsrv" need to pay attention.

> This is of course a bug in many boards (and the docs too).

It is not a bug.  It is a pretty normal situation that people use
abbreviations as long as they work.  When working interactively, I
used to use "set" for a long, long time instead of "setenv", until it
stopped working.  Then I used to use "sete" (and still do this) except
for boards that enable for example the "setexpr" command.

We just should try not to use such abbreviations in the environment,
and/or pay special attention to check the environment when changing
the board configuration to include new, additional commands.

> It's obviously to be fixed for boards that define CONFIG_CMD_TFTPSRV:
> currently none, but soon I'll update dig297 in this sense.

Then make sure to check the default env.

> What I'm not sure about is if the default environment for all boards should be
> fixed as well.

No.  Most of them will never enable the "tftpsrv" command.


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
In C we had to code our own bugs, in C++ we can inherit them.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] tftp "command" in default environments
  2011-06-22 17:26   ` Wolfgang Denk
@ 2011-06-22 17:44     ` Mike Frysinger
  2011-06-22 19:53     ` Eric Cooper
  1 sibling, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2011-06-22 17:44 UTC (permalink / raw)
  To: u-boot

On Wednesday, June 22, 2011 13:26:36 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > > Unfortunately, activating it causes some boards to stop working
> > > correctly. This is because they use the tftp "command" in their
> > > environment, but tftp is has never been a real command, just the
> > > prefix for tftpboot. tftpboot used to be the sole completion for the
> > > tftp prefix, and this is still true unless one activates tftpsrv.
> > 
> > those configs are broken.  the autocomplete support has never been
> > something
> 
> This has absolutely nothing to do with autocomplete.  It's just using
> the fact that you can abbreviate all command names as long as they
> remain unambiguous.

that's what i was referring to
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110622/90f2f2b8/attachment.pgp 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] tftp "command" in default environments
  2011-06-22 17:26   ` Wolfgang Denk
  2011-06-22 17:44     ` Mike Frysinger
@ 2011-06-22 19:53     ` Eric Cooper
  1 sibling, 0 replies; 7+ messages in thread
From: Eric Cooper @ 2011-06-22 19:53 UTC (permalink / raw)
  To: u-boot

Since "tftpsrv" is new, wouldn't it make sense to change it to
"srvtftp" or something else that doesn't conflict with a common
abbreviation?

-- 
Eric Cooper             e c c @ c m u . e d u

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-06-22 19:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-22 14:28 [U-Boot] tftp "command" in default environments Luca Ceresoli
2011-06-22 15:07 ` Igor Grinberg
2011-06-22 16:07 ` Mike Frysinger
2011-06-22 17:26   ` Wolfgang Denk
2011-06-22 17:44     ` Mike Frysinger
2011-06-22 19:53     ` Eric Cooper
2011-06-22 17:32 ` 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.