Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F9E4C433F5 for ; Thu, 18 Nov 2021 23:29:00 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1226160E0B for ; Thu, 18 Nov 2021 23:29:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1226160E0B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E90FE82FB8; Fri, 19 Nov 2021 00:28:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SWweQjuk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0C97F82F96; Thu, 18 Nov 2021 22:26:18 +0100 (CET) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DE7F782A68 for ; Thu, 18 Nov 2021 22:26:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=fntoth@gmail.com Received: by mail-ed1-x536.google.com with SMTP id w1so33143042edc.6 for ; Thu, 18 Nov 2021 13:26:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=qh0MS966qAhxg1JjmJxKKSJkXQWQntH1ie/yNFyg2+4=; b=SWweQjukKXesvn+zLGmQCiCvv3a1Ky74EbT3aS7dMdZppNF8x0C5ENobZ56MC1P6JD yRB/Qeo2zSjKUvbtvEmk4IFUAVPC5oKA5qC9QK0f88uIa8uwkIHhCv/9tcg0c2AkcGCf nZVEvARalOzsi+k9lAgIkVIfmCELUmB0/sWunWnCmQxxmAmRgM+b0lqg3z403886q8wV Ho8Csq02BjXWTMSZlSfovVSGbXicp/wU+MBNHjg/Zq8GSvEt3zq9DHDv4MqP+0Q/xFK7 e0pt5rdD4F1dpBH69zGl4cUA08Y8UeKDWLj9lzJoNihbeuoanrBFtFCuuGRgJLRPLEsh 4hbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=qh0MS966qAhxg1JjmJxKKSJkXQWQntH1ie/yNFyg2+4=; b=zt10Oid7kX5IA2QOX1i6Hln6mu36AnLjmdTQ9KvPOxTJSlBVIG9h/jv2x+yucern9u ZK27V2QtWbN74MHK9OnEiDSTNX5Whm95XB45dVaRLjD67SidbfuVzxYrz5oDSo3apndb tvXqHNOG1gvwXe8FziklqNyIwTWaVLL5p3VoU7ZjZAqqucKcfZaVfXPyyR9KAb2C6iJy Ru/3rb6U2BeI8PDKZ045kLt8fVIDL87pXs80yDiE9Y3frqSXHGDoCSJxXRKfeuHJqjuO ml/o1g5ve4BAwVT2YmZweZcczGxSSpgQqNFGcG4PKQUIYSKMaVvAL8zH5szjL2s0yqzF KGVw== X-Gm-Message-State: AOAM5320TBDFSyq8pDqVe8Gdo4dMJ7isD6skzxx5A6LWWpQMFrVSl+Sn t5Lb330422LVPYj2RZ5b0SU= X-Google-Smtp-Source: ABdhPJyTmb6iM3p+XRqJUMS1NFUaYZr1d6cGm6ACFbAVHTGBZCTnWkab982RNaDjZhhpCprVCGrDcg== X-Received: by 2002:a05:6402:10cd:: with SMTP id p13mr15932205edu.111.1637270774547; Thu, 18 Nov 2021 13:26:14 -0800 (PST) Received: from ?IPV6:2001:981:6fec:1:557f:5cbe:b0b3:d821? ([2001:981:6fec:1:557f:5cbe:b0b3:d821]) by smtp.gmail.com with ESMTPSA id cw5sm408729ejc.74.2021.11.18.13.26.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Nov 2021 13:26:14 -0800 (PST) Message-ID: Date: Thu, 18 Nov 2021 22:26:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH v1 1/1] tools/netconsole: Add support for socat Content-Language: en-US To: Andy Shevchenko , u-boot@lists.denx.de References: <20211117171506.88821-1-andriy.shevchenko@linux.intel.com> From: Ferry Toth In-Reply-To: <20211117171506.88821-1-andriy.shevchenko@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Fri, 19 Nov 2021 00:28:55 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.35 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean 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 Tested-by: Ferry Toth > --- > 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