* [PATCH v1 1/1] tools/netconsole: Add support for socat
@ 2021-11-17 17:15 Andy Shevchenko
2021-11-18 21:26 ` Ferry Toth
0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2021-11-17 17:15 UTC (permalink / raw)
To: Andy Shevchenko, u-boot; +Cc: fntoth
socat is a very powerful tool to work with socets (and not only)
in UNIX systems. Let's add support for it in netconsole.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
tools/netconsole | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/tools/netconsole b/tools/netconsole
index 1a0ef22244e3..155453320f73 100755
--- a/tools/netconsole
+++ b/tools/netconsole
@@ -34,7 +34,7 @@ if [ -z "${ip}" ] || [ -n "$4" ] ; then
usage "Invalid number of arguments"
fi
-for nc in netcat nc ; do
+for nc in socat netcat nc ; do
type ${nc} >/dev/null 2>&1 && break
done
@@ -47,6 +47,10 @@ if type ncb 2>/dev/null ; then
# see if ncb is in $PATH
exec ncb ${board_out_port}
+elif [ "${nc}" = "socat" ] ; then
+ # socat does support broadcast
+ while ${nc} STDIO "UDP4-LISTEN:${board_out_port}"; do :; done
+
elif [ -x ${0%/*}/ncb ] ; then
# maybe it's in the same dir as the netconsole script
exec ${0%/*}/ncb ${board_out_port}
@@ -59,5 +63,9 @@ else
fi
) &
pid=$!
-${nc} -u ${ip} ${board_in_port}
+if [ "${nc}" = "socat" ] ; then
+ ${nc} - "UDP4:${ip}:${board_in_port}"
+else
+ ${nc} -u ${ip} ${board_in_port}
+fi
kill ${pid} 2>/dev/null
--
2.33.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/1] tools/netconsole: Add support for socat
2021-11-17 17:15 [PATCH v1 1/1] tools/netconsole: Add support for socat Andy Shevchenko
@ 2021-11-18 21:26 ` Ferry Toth
2021-11-26 16:05 ` Andy Shevchenko
0 siblings, 1 reply; 5+ messages in thread
From: Ferry Toth @ 2021-11-18 21:26 UTC (permalink / raw)
To: Andy Shevchenko, u-boot
Hi,
Op 17-11-2021 om 18:15 schreef Andy Shevchenko:
> socat is a very powerful tool to work with socets (and not only)
> in UNIX systems. Let's add support for it in netconsole.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ferry Toth <fntoth@gmail.com>
> ---
> tools/netconsole | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/tools/netconsole b/tools/netconsole
> index 1a0ef22244e3..155453320f73 100755
> --- a/tools/netconsole
> +++ b/tools/netconsole
> @@ -34,7 +34,7 @@ if [ -z "${ip}" ] || [ -n "$4" ] ; then
> usage "Invalid number of arguments"
> fi
>
> -for nc in netcat nc ; do
> +for nc in socat netcat nc ; do
> type ${nc} >/dev/null 2>&1 && break
> done
>
> @@ -47,6 +47,10 @@ if type ncb 2>/dev/null ; then
> # see if ncb is in $PATH
> exec ncb ${board_out_port}
>
> +elif [ "${nc}" = "socat" ] ; then
> + # socat does support broadcast
> + while ${nc} STDIO "UDP4-LISTEN:${board_out_port}"; do :; done
> +
> elif [ -x ${0%/*}/ncb ] ; then
> # maybe it's in the same dir as the netconsole script
> exec ${0%/*}/ncb ${board_out_port}
> @@ -59,5 +63,9 @@ else
> fi
> ) &
> pid=$!
> -${nc} -u ${ip} ${board_in_port}
> +if [ "${nc}" = "socat" ] ; then
> + ${nc} - "UDP4:${ip}:${board_in_port}"
> +else
> + ${nc} -u ${ip} ${board_in_port}
> +fi
> kill ${pid} 2>/dev/null
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/1] tools/netconsole: Add support for socat
2021-11-18 21:26 ` Ferry Toth
@ 2021-11-26 16:05 ` Andy Shevchenko
2021-12-02 5:10 ` Ramon Fried
0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2021-11-26 16:05 UTC (permalink / raw)
To: Ferry Toth; +Cc: Andy Shevchenko, U-Boot Mailing List
On Fri, Nov 19, 2021 at 1:29 AM Ferry Toth <fntoth@gmail.com> wrote:
>
> Hi,
>
> Op 17-11-2021 om 18:15 schreef Andy Shevchenko:
> > socat is a very powerful tool to work with socets (and not only)
> > in UNIX systems. Let's add support for it in netconsole.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Tested-by: Ferry Toth <fntoth@gmail.com>
Thanks!
Can thi be applied, please?
> > ---
> > tools/netconsole | 12 ++++++++++--
> > 1 file changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/netconsole b/tools/netconsole
> > index 1a0ef22244e3..155453320f73 100755
> > --- a/tools/netconsole
> > +++ b/tools/netconsole
> > @@ -34,7 +34,7 @@ if [ -z "${ip}" ] || [ -n "$4" ] ; then
> > usage "Invalid number of arguments"
> > fi
> >
> > -for nc in netcat nc ; do
> > +for nc in socat netcat nc ; do
> > type ${nc} >/dev/null 2>&1 && break
> > done
> >
> > @@ -47,6 +47,10 @@ if type ncb 2>/dev/null ; then
> > # see if ncb is in $PATH
> > exec ncb ${board_out_port}
> >
> > +elif [ "${nc}" = "socat" ] ; then
> > + # socat does support broadcast
> > + while ${nc} STDIO "UDP4-LISTEN:${board_out_port}"; do :; done
> > +
> > elif [ -x ${0%/*}/ncb ] ; then
> > # maybe it's in the same dir as the netconsole script
> > exec ${0%/*}/ncb ${board_out_port}
> > @@ -59,5 +63,9 @@ else
> > fi
> > ) &
> > pid=$!
> > -${nc} -u ${ip} ${board_in_port}
> > +if [ "${nc}" = "socat" ] ; then
> > + ${nc} - "UDP4:${ip}:${board_in_port}"
> > +else
> > + ${nc} -u ${ip} ${board_in_port}
> > +fi
> > kill ${pid} 2>/dev/null
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/1] tools/netconsole: Add support for socat
2021-11-26 16:05 ` Andy Shevchenko
@ 2021-12-02 5:10 ` Ramon Fried
2021-12-02 5:11 ` Ramon Fried
0 siblings, 1 reply; 5+ messages in thread
From: Ramon Fried @ 2021-12-02 5:10 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Ferry Toth, Andy Shevchenko, U-Boot Mailing List
On Fri, Nov 26, 2021 at 6:05 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Fri, Nov 19, 2021 at 1:29 AM Ferry Toth <fntoth@gmail.com> wrote:
> >
> > Hi,
> >
> > Op 17-11-2021 om 18:15 schreef Andy Shevchenko:
> > > socat is a very powerful tool to work with socets (and not only)
> > > in UNIX systems. Let's add support for it in netconsole.
> > >
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Tested-by: Ferry Toth <fntoth@gmail.com>
>
> Thanks!
>
> Can thi be applied, please?
>
> > > ---
> > > tools/netconsole | 12 ++++++++++--
> > > 1 file changed, 10 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/tools/netconsole b/tools/netconsole
> > > index 1a0ef22244e3..155453320f73 100755
> > > --- a/tools/netconsole
> > > +++ b/tools/netconsole
> > > @@ -34,7 +34,7 @@ if [ -z "${ip}" ] || [ -n "$4" ] ; then
> > > usage "Invalid number of arguments"
> > > fi
> > >
> > > -for nc in netcat nc ; do
> > > +for nc in socat netcat nc ; do
> > > type ${nc} >/dev/null 2>&1 && break
> > > done
> > >
> > > @@ -47,6 +47,10 @@ if type ncb 2>/dev/null ; then
> > > # see if ncb is in $PATH
> > > exec ncb ${board_out_port}
> > >
> > > +elif [ "${nc}" = "socat" ] ; then
> > > + # socat does support broadcast
> > > + while ${nc} STDIO "UDP4-LISTEN:${board_out_port}"; do :; done
> > > +
> > > elif [ -x ${0%/*}/ncb ] ; then
> > > # maybe it's in the same dir as the netconsole script
> > > exec ${0%/*}/ncb ${board_out_port}
> > > @@ -59,5 +63,9 @@ else
> > > fi
> > > ) &
> > > pid=$!
> > > -${nc} -u ${ip} ${board_in_port}
> > > +if [ "${nc}" = "socat" ] ; then
> > > + ${nc} - "UDP4:${ip}:${board_in_port}"
> > > +else
> > > + ${nc} -u ${ip} ${board_in_port}
> > > +fi
> > > kill ${pid} 2>/dev/null
>
>
>
> --
> With Best Regards,
> Andy Shevchenko
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/1] tools/netconsole: Add support for socat
2021-12-02 5:10 ` Ramon Fried
@ 2021-12-02 5:11 ` Ramon Fried
0 siblings, 0 replies; 5+ messages in thread
From: Ramon Fried @ 2021-12-02 5:11 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Ferry Toth, Andy Shevchenko, U-Boot Mailing List
On Thu, Dec 2, 2021 at 7:10 AM Ramon Fried <rfried.dev@gmail.com> wrote:
>
> On Fri, Nov 26, 2021 at 6:05 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> >
> > On Fri, Nov 19, 2021 at 1:29 AM Ferry Toth <fntoth@gmail.com> wrote:
> > >
> > > Hi,
> > >
> > > Op 17-11-2021 om 18:15 schreef Andy Shevchenko:
> > > > socat is a very powerful tool to work with socets (and not only)
> > > > in UNIX systems. Let's add support for it in netconsole.
> > > >
> > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > Tested-by: Ferry Toth <fntoth@gmail.com>
> >
> > Thanks!
> >
> > Can thi be applied, please?
> >
> > > > ---
> > > > tools/netconsole | 12 ++++++++++--
> > > > 1 file changed, 10 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/tools/netconsole b/tools/netconsole
> > > > index 1a0ef22244e3..155453320f73 100755
> > > > --- a/tools/netconsole
> > > > +++ b/tools/netconsole
> > > > @@ -34,7 +34,7 @@ if [ -z "${ip}" ] || [ -n "$4" ] ; then
> > > > usage "Invalid number of arguments"
> > > > fi
> > > >
> > > > -for nc in netcat nc ; do
> > > > +for nc in socat netcat nc ; do
> > > > type ${nc} >/dev/null 2>&1 && break
> > > > done
> > > >
> > > > @@ -47,6 +47,10 @@ if type ncb 2>/dev/null ; then
> > > > # see if ncb is in $PATH
> > > > exec ncb ${board_out_port}
> > > >
> > > > +elif [ "${nc}" = "socat" ] ; then
> > > > + # socat does support broadcast
> > > > + while ${nc} STDIO "UDP4-LISTEN:${board_out_port}"; do :; done
> > > > +
> > > > elif [ -x ${0%/*}/ncb ] ; then
> > > > # maybe it's in the same dir as the netconsole script
> > > > exec ${0%/*}/ncb ${board_out_port}
> > > > @@ -59,5 +63,9 @@ else
> > > > fi
> > > > ) &
> > > > pid=$!
> > > > -${nc} -u ${ip} ${board_in_port}
> > > > +if [ "${nc}" = "socat" ] ; then
> > > > + ${nc} - "UDP4:${ip}:${board_in_port}"
> > > > +else
> > > > + ${nc} -u ${ip} ${board_in_port}
> > > > +fi
> > > > kill ${pid} 2>/dev/null
> >
> >
> >
> > --
> > With Best Regards,
> > Andy Shevchenko
> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Applied to u-boot-net/next,
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-12-02 5:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17 17:15 [PATCH v1 1/1] tools/netconsole: Add support for socat Andy Shevchenko
2021-11-18 21:26 ` Ferry Toth
2021-11-26 16:05 ` Andy Shevchenko
2021-12-02 5:10 ` Ramon Fried
2021-12-02 5:11 ` Ramon Fried
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.