From patchwork Thu May 16 10:42:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fiona Klute X-Patchwork-Id: 1936002 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=gmx.de header.i=fiona.klute@gmx.de header.a=rsa-sha256 header.s=s31663417 header.b=NXnoPjz4; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vg93F4WmJz1yfq for ; Thu, 16 May 2024 22:52:09 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4FE5F8833A; Thu, 16 May 2024 14:50:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=gmx.de 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; secure) header.d=gmx.de header.i=fiona.klute@gmx.de header.b="NXnoPjz4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A896188286; Thu, 16 May 2024 12:43:08 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4532F87F65 for ; Thu, 16 May 2024 12:43:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=fiona.klute@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1715856184; x=1716460984; i=fiona.klute@gmx.de; bh=nOh+/z8sGeE6Azsd0W7e3u8P49sPN3lc4LBaMH+YQPo=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-ID: MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=NXnoPjz4mz/++oeG8ENl5U8g/1VCV15qjiSSpZzTUnGninTJifCHZ8DFm6uefPFv CPZLrqPDoOkLvPHpeqzL8wjdaL4r/r1EQvggMuhO5ulxTuKf2LxOEN9wutqRXQSly jHEhNnQLkhQcOTWE5A4yxTb3I+1WubbZmTlPPXXltZrEyjze483QpvKWRH2lk8tgu JVTSjzbqyJbmfa7/oEDcIbygSLebRV6iAKzWTuXksOc2ks3OdIj/ikH1IWfCRmBu9 DK2+SovBIzanKGWiDILTuPo7Mb87I46aeP8GSmmoJZEpGAphX8WrM83V+5l2i100V wU7m8muNVnoXOfO2fQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from haruka.lan ([85.22.121.157]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MO9z7-1rwEqn0tth-00Obeb; Thu, 16 May 2024 12:43:04 +0200 From: Fiona Klute To: u-boot@lists.denx.de Cc: mibodhi@gmail.com, Fiona Klute Subject: [PATCH v2 1/2] doc: Detailed example for netconsole setup Date: Thu, 16 May 2024 12:42:44 +0200 Message-ID: <20240516104245.2075748-1-fiona.klute@gmx.de> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:9c5rwITMaORuZmIE0crMCbxFPYl6P8tNs4ohaDk9uyZBAQ1Ty5y n2WnLSztI2mZ7vpGfrQK3Ee4UmjkQ6j1ov/ZzsTrYV1JEMUrQ4tpZwv7pvvEdPKLp7Q0KNE qQq64FbRXYnNlnOcZquZmu4hjsbsfny0N0iiZA2s0a9dF5vMRE3yhK/G9ktl4MCHdv/cbiO cyTKaE07YodLfWn/KCjxA== UI-OutboundReport: notjunk:1;M01:P0:+3k5ZorUwWo=;KEMcWCSrZczO6O5RrTh2qSh7UAZ HeWyJ+aBu2Fmc4AidhoefsM7YMUcmaaAamkDaePiyUuhRNy9xJg62Pkh1776hfSM5FznbXzLA Zc7W6jdF2xrFKlXuONRjcI7x6PLFPvyI4Y4zNrgrTlMhNhMRsobsrifemaAF0W8KIb51AtsEl wZx0+9VfbuGBQLJjhGdodH4PiIlmFAOb0cj+LIyYYbQWIhSN0PJ9ObRytZkGxCGxoNtq2Orda mZ6YPkq1RM9VKN5ctyGyu7DLnBduIYCGROuA724TZKE3zuktd3xI6+HZPstVg2scgtF0ZG4UQ 7u+GogsmJPwJ2MqLwSTGFDPfSxxY0KPitkLgVpPRhARgURWcx/QtO3f7IiTh/u9eD563rSKsJ 16UmVIpTym80VJRWO9Kv975e7nwQLDSGxzpnFThHAkzxOLI1k9QaVM4/HXpc6sX1+RPm2DQ+1 +DlXqs/6VfA9VkImk9L2Z0bf/slKK83ykbKCEJoCmF5bDkzeeZHffMsEgOHTOn7VaTk+Zg8Xg YSYlnseJqLHNQdka8GPCCTTnkwbj64Ihdc9LhKtq1C2U/Dg7egA5aaGNk7/KK7im9aNXlrd1B WjLPsv/KBvrGx/Ate+L0hBFEmMnMpoFLcgkPaOPdiqRvIkx3gLceLnT025CAKP88obteqEhuo kJF9K/ikTYz7yUHMKN0IfToHQbx2r0CtHepfkka0Z8VVXHHycUcuA5od6AsB7jQ+jcgX+rmZk obs9OnbRAmyxAO7kjtxhLoKS+R2lj6gEV5DgYEm1sEJ7lVEG9lUDsOj6jJ/Q71BxLpEzmtl5L DDOQmwVcQj5dyOsgoh/h6etOLcCDLuJgyT20JLOBBeASo= X-Mailman-Approved-At: Thu, 16 May 2024 14:50:16 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean This adds details that I would have liked to have readily available, in particular how to activate the network interface before enabling netconsole, and how to integrate netconsole so you can use the U-Boot prompt. Signed-off-by: Fiona Klute Reviewed-by: Tony Dinh --- Changes in v2: * Include stderr redirection * Use 4 spaces instead of tabs for code block to avoid overflowing lines doc/usage/netconsole.rst | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) -- 2.43.0 diff --git a/doc/usage/netconsole.rst b/doc/usage/netconsole.rst index 2aa3b9ccc5..647f0c220b 100644 --- a/doc/usage/netconsole.rst +++ b/doc/usage/netconsole.rst @@ -18,7 +18,9 @@ broadcast address and port 6666 are used. If it is set to an IP address of 0 (or 0.0.0.0) then no messages are sent to the network. The source / listening port can be configured separately by setting the 'ncinport' environment variable and the destination port can be -configured by setting the 'ncoutport' environment variable. +configured by setting the 'ncoutport' environment variable. Note that +you need to set up the network interface (e.g. using DHCP) before it +can be used for network console. For example, if your server IP is 192.168.1.1, you could use:: @@ -107,3 +109,32 @@ as follows: Note that unlike the U-Boot implementation the Linux netconsole is unidirectional, i. e. you have console output only in Linux. + +Setup via environment +--------------------- + +If persistent environment is enabled in your U-Boot configuration, you +can configure the network console using the environment. For example:: + + => env set autoload no + => env set hostname "u-boot" + => env set bootdelay 5 + => env set nc 'dhcp; env set stdout nc; env set stderr nc; env set stdin nc' + => env set ncip 192.168.1.1 + => env set preboot "${preboot}; run nc;" + => env save + => reset + +``autoload no`` tells the ``dhcp`` command to configure the network +interface without trying to load an image. ``hostname "u-boot"`` sets +the hostname to be sent in DHCP requests, so they are easy to +recognize in the DHCP server log. The command in ``nc`` calls ``dhcp`` +to make sure the network interface is set up before enabling +netconsole. + +Adding ``nc`` to ``preboot`` tells U-Boot to activate netconsole +before trying to find any boot options, so you can interact with it if +desired. + +``env save`` stores the settings persistently, and ``reset`` then +triggers a fresh start that will use the changed settings. From patchwork Thu May 16 10:42:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fiona Klute X-Patchwork-Id: 1936003 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=gmx.de header.i=fiona.klute@gmx.de header.a=rsa-sha256 header.s=s31663417 header.b=TR+kqr81; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vg93S0JHkz1yfq for ; Thu, 16 May 2024 22:52:20 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BBBE88837B; Thu, 16 May 2024 14:50:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=gmx.de 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; secure) header.d=gmx.de header.i=fiona.klute@gmx.de header.b="TR+kqr81"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 489B787F65; Thu, 16 May 2024 12:43:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5CB5488258 for ; Thu, 16 May 2024 12:43:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=fiona.klute@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1715856187; x=1716460987; i=fiona.klute@gmx.de; bh=8KOvOwHVKwbDuTyMEGLqicUZIERVzh4qIxNB/lis0F0=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-ID:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=TR+kqr813qBezrIbkQJPNlM3d8lhEv31hetLOpr2UGmUChUE0USrlb2witUvmEMK D4TRJIb2rMRTzk9YWJbRr701cetQJlXD1Ufy+Lybjki/dpACgIjKRygtupTf4o7Kc qm7lMCcDfHjKHJf2M4XbUOE9pv4z49GLC2NLAvpZYGhCGzBPLTsujsAmjw5QKcED7 RbS2BnRtbFGQsG8QQ+SAu1+XpdJUbg34A8dzazV9GqeqS3vxIQrt/qxgwLN/bb5oe qnlMP7e1sJnGVMrVb2kOFcOIz/J7R054mUIJIEqxMfHU35tiId6bZVtIjqXl1xCXA 1dpDo5LyrwhT1tUyFw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from haruka.lan ([85.22.121.157]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1McpNy-1shAJF1PH8-00ZvVa; Thu, 16 May 2024 12:43:07 +0200 From: Fiona Klute To: u-boot@lists.denx.de Cc: mibodhi@gmail.com, Fiona Klute Subject: [PATCH v2 2/2] doc: Update netconsole examples, mention stderr Date: Thu, 16 May 2024 12:42:45 +0200 Message-ID: <20240516104245.2075748-2-fiona.klute@gmx.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240516104245.2075748-1-fiona.klute@gmx.de> References: <20240516104245.2075748-1-fiona.klute@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Uq34CTjh1CNUZKTK/DMOku80wuS1wwMWUZ8LaC7GX+pan7nMiBH PlSxYN/wSynSDcRVU9xqbh3ETpq24qqKa2H6hKL3SaD8BYGZHMzH0XUQhH4+tUhSBelAN0/ oV1IWZvIuw6fSgLp+YzXxsFClhci/e3FGdxJ+tdj/z2L8xrUg3ugeVVdbJJSdOwW1J7zUAx y2wsxx3Tan+eWs87iAF5g== UI-OutboundReport: notjunk:1;M01:P0:7T/bJHfm0zo=;mlkxskOMvtMxUN6zqKYCo+JO+dz cbtZN3FDaMWroLJbD9pEsWjlxWdoqNrzrr8jhP86ERWxFIVlHRi8mqQS51dwxV8VwWmIln3pL O4bSx0P2DY64RiVyIrPB5hyqvr8cZgkCKfDQStrVXgSMMB7t7U/GV6iGstHXz7KA63WnE3+5C tACIJIqZbMgOdSm6B9Wz5e+lT30ZV78vRIdzBODp0qeZXPgu0xeINbl/fbjGk3ihIrkUHOm6D qjDt4j/v7h0ouaZyxzLoSRNAFwH2fP/CFLx1z0ux7AX8vRufXyHUwKbNoWbKjAUKcz59we1ZY plfBzQ5CtJVGlf2m/43hkFhChRXIwzQDOJLvldGlKEGuL+ioFTdqQIrXRCjlHx2GddAcpAVxd gZehR57nN/S7gS+RcL8glA/bFm8QZHrmVArdM+HiLMXY2uIgyZwZrxyhTLBcJHA4fn5vEA/6j 4njf81TJEYqqKJVhw0C1DP24L/K9kJ6o5ZAYp8tcUHltSxwobwX44DJDneiGtj6odJeBoTkJP rOOF5S3bekJOOzaoOmYnd812VaX4k2UfL4kzzWZvV4wXcRnG2D8jLMsSeIVKZcln6pEL173Cl gVOETRn70fBwqlKPPJLwSjxjhv2k+oJ+foDFo1It3dtX3LsJd9EpiFkcpGYrF/Xz+WdQ4kfIp mmRxr80FGSF0qsl8CMo6HU7vnXaYlxUHFMB4Zxn0W8S9u6x0W5Ah5pZZlu1Al2UtFxGRI24pQ +sntws0MioCNc8JWFpQGN6WxQoqr9EHxENCcM1cxUxigla+WY08HVscKeJffHJw3pOk35LWTk E2BZzHjoRIqYeOWxfmhfE4Kuoo0rNufDABU2gk/6eYFEk= X-Mailman-Approved-At: Thu, 16 May 2024 14:50:16 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean Stderr was missing from the initial description and example. As I understand the env command documentation the subcommand style is preferred, though the old format is still fully supported. Signed-off-by: Fiona Klute Reviewed-by: Tony Dinh --- Changes in v2: * Mention stderr redirection * Use 4 spaces instead of tabs for code block to avoid overflowing lines doc/usage/netconsole.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- 2.43.0 diff --git a/doc/usage/netconsole.rst b/doc/usage/netconsole.rst index 647f0c220b..f745615d9a 100644 --- a/doc/usage/netconsole.rst +++ b/doc/usage/netconsole.rst @@ -3,10 +3,10 @@ Network console In U-Boot, we implemented the networked console via the standard "devices" mechanism, which means that you can switch between the -serial and network input/output devices by adjusting the 'stdin' and -'stdout' environment variables. To switch to the networked console, -set either of these variables to "nc". Input and output can be -switched independently. +serial and network input/output devices by adjusting the 'stdin', +'stdout', and 'stderr' environment variables. To switch to the +networked console, set either of these variables to "nc". Input and +output can be switched independently. The default buffer size can be overridden by setting CFG_NETCONSOLE_BUFFER_SIZE. @@ -24,10 +24,10 @@ can be used for network console. For example, if your server IP is 192.168.1.1, you could use:: - => setenv nc 'setenv stdout nc;setenv stdin nc' - => setenv ncip 192.168.1.1 - => saveenv - => run nc + => env set nc 'env set stdout nc; env set stderr nc; env set stdin nc' + => env set ncip 192.168.1.1 + => env save + => run nc On the host side, please use this script to access the console