All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] README.NetConsole question
@ 2007-03-15 11:55 Igor Marnat
  2007-03-15 12:49 ` Detlev Zundel
  0 siblings, 1 reply; 12+ messages in thread
From: Igor Marnat @ 2007-03-15 11:55 UTC (permalink / raw)
  To: u-boot

Hello List!

I'm trying to use netconsole on my board but I met unxecpected
problems on host side (the machine I'm trying to connect to
u-boot'ed board).

I'm trying to use on the host side script from README.NetConsole. The one which is
quoted below. When I start the script, my Linux complains about the
string "nc -u -l -p 6666".

As the "man nc" states about -l option, "It
is an error to use this option in conjunction with the -p".

Regarding -p: "It is an error to use this option in conjunction with the -l option."

Am I doing something wrong? Should I change nc utility or script?


U-boot version is 1.1.6, host machine uses
Fedora Core 5, nc (netcat utility) is from "nc-1.84-3.2.rpm".

The script from README.NetConsole:

#!/bin/bash -x

[ $# = 1 ] || { echo "Usage: $0 target_ip" >&2 ; exit 1 ; }
TARGET_IP=$1

stty -icanon -echo intr ^T
nc -u -l -p 6666 < /dev/null &
nc -u ${TARGET_IP} 6666
stty icanon echo intr ^C


Best regards,
Igor Marnat
mailto:marny@rambler.ru

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

* [U-Boot-Users] README.NetConsole question
  2007-03-15 11:55 [U-Boot-Users] README.NetConsole question Igor Marnat
@ 2007-03-15 12:49 ` Detlev Zundel
  2007-03-15 13:26   ` Scott McNutt
  2007-03-15 13:57   ` [U-Boot-Users] README.NetConsole question Igor Marnat
  0 siblings, 2 replies; 12+ messages in thread
From: Detlev Zundel @ 2007-03-15 12:49 UTC (permalink / raw)
  To: u-boot

Hi Igor,

> I'm trying to use netconsole on my board but I met unxecpected
> problems on host side (the machine I'm trying to connect to
> u-boot'ed board).
>
> I'm trying to use on the host side script from README.NetConsole. The one which is
> quoted below. When I start the script, my Linux complains about the
> string "nc -u -l -p 6666".
>
> As the "man nc" states about -l option, "It
> is an error to use this option in conjunction with the -p".

Huh!  Where exactly does it say so?  I cannot even find "error" in the
manpage to my nc (1.10-32 on a Debian system).  Actually this
statement is nonsense, -l tells netcat to "l"isten on a socket and -p
tells it the portnumber.  How exactly should one start netcat as a
listener without combining these options?

Please check the netcat that you have - maybe "nc" simply isn't netcat
on your system.  Sometimes the binary is called "netcat".

Cheers
  Detlev

-- 
He thinks he's really smooth, but he's only C^1.
--
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office: Kirchenstr. 5, D-82194 Groebenzell, Germany +49 8142 66989 40

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

* [U-Boot-Users] README.NetConsole question
  2007-03-15 12:49 ` Detlev Zundel
@ 2007-03-15 13:26   ` Scott McNutt
  2007-03-15 14:01     ` Detlev Zundel
  2007-03-15 13:57   ` [U-Boot-Users] README.NetConsole question Igor Marnat
  1 sibling, 1 reply; 12+ messages in thread
From: Scott McNutt @ 2007-03-15 13:26 UTC (permalink / raw)
  To: u-boot

Hi Igor & Detlev,

>> As the "man nc" states about -l option, "It
>> is an error to use this option in conjunction with the -p".
> 
> Huh!  Where exactly does it say so?  I cannot even find "error" in the
> manpage to my nc (1.10-32 on a Debian system).

On my FC5 system, (nc-1.84-3.2) the netcat manpage does make
such a statement:

>  -l  Used to specify that nc should listen for an incoming connection
>      rather than initiate a connection to a remote host.  It is an
>      error to use this option in conjunction with the -p, -s, or -z
>      options.  Additionally, any timeouts specified with the -w option
>      are ignored.

Note that it does not define an option parameter in the manpage
documentation for the option ... but the "CLIENT/SERVER MODEL"
section of the manpage gives an example:

>  It is quite simple to build a very basic client/server model using nc.
>  On one console, start nc listening on a specific port for a connection.
>  For example:
> 
>        $ nc -l 1234

I'm not sure when or why the option differences started
between your two versions of netcat -- but they do apparently
exist.

That said, you may want to use the following if your version
complains about the -l and -p options being used together:

    $ nc -u -l 6666

Regards,
--Scott

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

* [U-Boot-Users] README.NetConsole question
  2007-03-15 12:49 ` Detlev Zundel
  2007-03-15 13:26   ` Scott McNutt
@ 2007-03-15 13:57   ` Igor Marnat
  1 sibling, 0 replies; 12+ messages in thread
From: Igor Marnat @ 2007-03-15 13:57 UTC (permalink / raw)
  To: u-boot

Hello Detlev,

DZ> Please check the netcat that you have - maybe "nc" simply isn't netcat
DZ> on your system.  Sometimes the binary is called "netcat".

Thank you for your reply, it really helped.

I rebuilt nc from sources (nc110.tgz) and data from the board really
appears on my host side as if it was serial console. Obviously
distributive of Fedora Core 5 contains some strange version of nc.

Perhaps it worth to mentioned in README.NetConsole.

Best regards,
Igor Marnat
mailto:marny at rambler.ru

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

* [U-Boot-Users] README.NetConsole question
  2007-03-15 13:26   ` Scott McNutt
@ 2007-03-15 14:01     ` Detlev Zundel
  2007-03-15 14:41       ` Scott McNutt
  0 siblings, 1 reply; 12+ messages in thread
From: Detlev Zundel @ 2007-03-15 14:01 UTC (permalink / raw)
  To: u-boot

Hi,

>> Huh!  Where exactly does it say so?  I cannot even find "error" in the
>> manpage to my nc (1.10-32 on a Debian system).
>
> On my FC5 system, (nc-1.84-3.2) the netcat manpage does make
> such a statement:

Wow, a short research shows that netcat is not a program but a whole
family :)  Just for the records the Debian netcat seems to be the
original implementation by <hobbit AT atstake DOT com>.

Anyway, if the netcat from FedoraCore wins out and -l does not combine
with -p anymore, can someone please fix Wikipedia[1]?

Thanks
  Detlev

[1] http://en.wikipedia.org/wiki/Netcat

-- 
Directories are added, deleted, and rearranged much as you would
expect, even if you don't know it's what you'd expect.
                                         -- Tom Lord in TLA Documentation
--
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office: Kirchenstr. 5, D-82194 Groebenzell, Germany +49 8142 66989 40

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

* [U-Boot-Users] README.NetConsole question
  2007-03-15 14:01     ` Detlev Zundel
@ 2007-03-15 14:41       ` Scott McNutt
  2007-03-16  5:13         ` [U-Boot-Users] [PATCH] README.NetConsole Igor Marnat
  0 siblings, 1 reply; 12+ messages in thread
From: Scott McNutt @ 2007-03-15 14:41 UTC (permalink / raw)
  To: u-boot

> Wow, a short research shows that netcat is not a program but a whole
> family :)  Just for the records the Debian netcat seems to be the
> original implementation by <hobbit AT atstake DOT com>.

I checked the CVS repo at OpenBSD It looks like the -l -p
option interaction was pulled in when Eric Jackson's updates
for IPv6 support were added in Revision 1.21

http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/netcat.c

The commit comments seem humorous (but only in hindsight):

"Import completely re-written netcat w/ support for IPv6.
very little usage has changed ...."

> Anyway, if the netcat from FedoraCore wins out and -l does not combine
> with -p anymore, can someone please fix Wikipedia[1]?

That and a hundred other web pages! ;-)

Best Regards,
--Scott

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

* [U-Boot-Users] [PATCH] README.NetConsole
  2007-03-15 14:41       ` Scott McNutt
@ 2007-03-16  5:13         ` Igor Marnat
  2007-03-16 13:11           ` Scott McNutt
  0 siblings, 1 reply; 12+ messages in thread
From: Igor Marnat @ 2007-03-16  5:13 UTC (permalink / raw)
  To: u-boot

Hello folks,

>> Anyway, if the netcat from FedoraCore wins out and -l does not combine
>> with -p anymore, can someone please fix Wikipedia[1]?

SM> That and a hundred other web pages! ;-)

Thank you to all guys for the help.

I'd suggest the following patch to begin with. May be native english
guys correct me.

diff -urN -X dontdiff u-boot-1.1.6/doc/README.NetConsole u-boot-1.1.6-tz/doc/README.NetConsole
--- u-boot-1.1.6/doc/README.NetConsole  2006-11-02 17:15:01.000000000 +0300
+++ u-boot-1.1.6-tz/doc/README.NetConsole       2007-03-16 08:04:31.000000000 +0300
@@ -34,6 +34,11 @@
 stty icanon echo intr ^C
 +++++++++++++++++++++++++++++++++++++++++++

+Be aware that in some distributives (Fedora Core 5 at least) usage of
+nc has been changed and -l and -p options are considered as mutually exclusive.
+If nc complains about options provided, try to rebuild it from scratch.
+Known working version lives in nc110.tgz
+
 The script expects exactly one argument, which is interpreted as  the
 target IP address (or host name, assuming DNS is working). The script
 can be interrupted by pressing ^T (CTRL-T).



 

Best regards,
Igor Marnat
mailto:marny at rambler.ru

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

* [U-Boot-Users] [PATCH] README.NetConsole
  2007-03-16  5:13         ` [U-Boot-Users] [PATCH] README.NetConsole Igor Marnat
@ 2007-03-16 13:11           ` Scott McNutt
  2007-03-16 20:13             ` Wolfgang Denk
  0 siblings, 1 reply; 12+ messages in thread
From: Scott McNutt @ 2007-03-16 13:11 UTC (permalink / raw)
  To: u-boot

Hi Igor

> +Be aware that in some distributives (Fedora Core 5 at least) usage of
> +nc has been changed and -l and -p options are considered as mutually exclusive.
> +If nc complains about options provided, try to rebuild it from scratch.
> +Known working version lives in nc110.tgz

You may want suggest simply removing the "-p" from the script.
That way you won't have to rebuild anything. E.g.:

Be aware that in some distributives (Fedora Core 5 at least)
usage of nc has been changed and -l and -p options are considered
as mutually exclusive. If nc complains about options provided,
you can remove the -p option from the script. For example:

+++++++++++++++++++++++++++++++++++++++++++
#! /bin/bash

[ $# = 1 ] || { echo "Usage: $0 target_ip" >&2 ; exit 1 ; }
TARGET_IP=$1

stty -icanon -echo intr ^T
nc -u -l 6666 < /dev/null &
nc -u ${TARGET_IP} 6666
stty icanon echo intr ^C
+++++++++++++++++++++++++++++++++++++++++++

Regards,
--Scott

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

* [U-Boot-Users] [PATCH] README.NetConsole
  2007-03-16 13:11           ` Scott McNutt
@ 2007-03-16 20:13             ` Wolfgang Denk
  2007-03-19  6:24               ` Igor Marnat
  0 siblings, 1 reply; 12+ messages in thread
From: Wolfgang Denk @ 2007-03-16 20:13 UTC (permalink / raw)
  To: u-boot

In message <45FA979C.8030907@psyent.com> you wrote:
> 
> > +Be aware that in some distributives (Fedora Core 5 at least) usage of
> > +nc has been changed and -l and -p options are considered as mutually exclusive.
> > +If nc complains about options provided, try to rebuild it from scratch.
> > +Known working version lives in nc110.tgz
> 
> You may want suggest simply removing the "-p" from the script.
> That way you won't have to rebuild anything. E.g.:
...

Now if you could please submit this as a patch against
README.NetConsole ?

Thanks in advance.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office:  Kirchenstr. 5,       D-82194 Groebenzell,            Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Backed up the system lately?

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

* [U-Boot-Users] [PATCH] README.NetConsole
  2007-03-16 20:13             ` Wolfgang Denk
@ 2007-03-19  6:24               ` Igor Marnat
  2007-03-19 16:02                 ` Ben Warren
  0 siblings, 1 reply; 12+ messages in thread
From: Igor Marnat @ 2007-03-19  6:24 UTC (permalink / raw)
  To: u-boot

Hello guys,

WD> Now if you could please submit this as a patch against
WD> README.NetConsole ?

Here it goes. I tried, it works.

diff -urN -X dontdiff u-boot-1.1.6/doc/README.NetConsole u-boot-1.1.6-tz/doc/README.NetConsole
--- u-boot-1.1.6/doc/README.NetConsole  2006-11-02 17:15:01.000000000 +0300
+++ u-boot-1.1.6-tz/doc/README.NetConsole       2007-03-19 09:20:51.000000000 +0300
@@ -34,6 +34,23 @@
 stty icanon echo intr ^C
 +++++++++++++++++++++++++++++++++++++++++++

+Be aware that in some distributives (Fedora Core 5 at least)
+usage of nc has been changed and -l and -p options are considered
+as mutually exclusive. If nc complains about options provided,
+you can remove the -p option from the script. For example:
+
++++++++++++++++++++++++++++++++++++++++++++
+#! /bin/bash
+
+[ $# = 1 ] || { echo "Usage: $0 target_ip" >&2 ; exit 1 ; }
+TARGET_IP=$1
+
+stty -icanon -echo intr ^T
+nc -u -l 6666 < /dev/null &
+nc -u ${TARGET_IP} 6666
+stty icanon echo intr ^C
++++++++++++++++++++++++++++++++++++++++++++
+
 The script expects exactly one argument, which is interpreted as  the
 target IP address (or host name, assuming DNS is working). The script
 can be interrupted by pressing ^T (CTRL-T).




 
Best regards,
Igor Marnat
mailto:marny@rambler.ru

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

* [U-Boot-Users] [PATCH] README.NetConsole
  2007-03-19  6:24               ` Igor Marnat
@ 2007-03-19 16:02                 ` Ben Warren
  2007-03-21  6:55                   ` Igor Marnat
  0 siblings, 1 reply; 12+ messages in thread
From: Ben Warren @ 2007-03-19 16:02 UTC (permalink / raw)
  To: u-boot

Igor,

On Mon, 2007-03-19 at 09:24 +0300, Igor Marnat wrote:
<snip>
> +Be aware that in some distributives (Fedora Core 5 at least)
> +usage of nc has been changed and -l and -p options are considered
> +as mutually exclusive. If nc complains about options provided,
> +you can remove the -p option from the script. For example:
> +
> ++++++++++++++++++++++++++++++++++++++++++++
> +#! /bin/bash
> +
> +[ $# = 1 ] || { echo "Usage: $0 target_ip" >&2 ; exit 1 ; }
> +TARGET_IP=$1
> +
> +stty -icanon -echo intr ^T
> +nc -u -l 6666 < /dev/null &
> +nc -u ${TARGET_IP} 6666
> +stty icanon echo intr ^C
> ++++++++++++++++++++++++++++++++++++++++++++
> +
I don't think it's necessary to repeat the script in its entirety, since
the difference is only two characters.  The descriptive paragraph should
be enough.

Also, please submit with a 'Signed-off-by' line so it gets properly
tracked.

regards,
Ben

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

* [U-Boot-Users] [PATCH] README.NetConsole
  2007-03-19 16:02                 ` Ben Warren
@ 2007-03-21  6:55                   ` Igor Marnat
  0 siblings, 0 replies; 12+ messages in thread
From: Igor Marnat @ 2007-03-21  6:55 UTC (permalink / raw)
  To: u-boot

Hello Ben,

BW> I don't think it's necessary to repeat the script in its entirety, since
BW> the difference is only two characters.  The descriptive paragraph should
BW> be enough.

Yes, I think you are right.


BW> Also, please submit with a 'Signed-off-by' line so it gets properly
BW> tracked.

I'm not an advanced user of git unfortunately. Anyway, I did my best, hope it's ok
now.


Signed-off-by: Igor Marnat <marny@rambler.ru>
---
 doc/README.NetConsole |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/doc/README.NetConsole b/doc/README.NetConsole
index cc35a0a..950b0c4 100644
--- a/doc/README.NetConsole
+++ b/doc/README.NetConsole
@@ -38,6 +38,11 @@ The script expects exactly one argument, which is interpreted as  the
 target IP address (or host name, assuming DNS is working). The script
 can be interrupted by pressing ^T (CTRL-T).
 
+Be aware that in some distributives (Fedora Core 5 at least)
+usage of nc has been changed and -l and -p options are considered
+as mutually exclusive. If nc complains about options provided,
+you can just remove the -p option from the script. 
+
 It turns out that 'netcat' cannot be used to listen to broadcast
 packets. We developed our own tool 'ncb' (see tools directory) that
 listens to broadcast packets on a given port and dumps them to the
-- 
1.4.4.2


Best regards,
Igor Marnat
mailto:marny at rambler.ru

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

end of thread, other threads:[~2007-03-21  6:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-15 11:55 [U-Boot-Users] README.NetConsole question Igor Marnat
2007-03-15 12:49 ` Detlev Zundel
2007-03-15 13:26   ` Scott McNutt
2007-03-15 14:01     ` Detlev Zundel
2007-03-15 14:41       ` Scott McNutt
2007-03-16  5:13         ` [U-Boot-Users] [PATCH] README.NetConsole Igor Marnat
2007-03-16 13:11           ` Scott McNutt
2007-03-16 20:13             ` Wolfgang Denk
2007-03-19  6:24               ` Igor Marnat
2007-03-19 16:02                 ` Ben Warren
2007-03-21  6:55                   ` Igor Marnat
2007-03-15 13:57   ` [U-Boot-Users] README.NetConsole question Igor Marnat

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.