From patchwork Tue May 14 20:20:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fiona Klute X-Patchwork-Id: 1935232 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=pp7tAqL7; 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 4VfDbc6QMRz20KD for ; Wed, 15 May 2024 10:28:28 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F39AB881B8; Wed, 15 May 2024 02:28:03 +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="pp7tAqL7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EF6EE87C75; Tue, 14 May 2024 22:21:14 +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 072A08717A for ; Tue, 14 May 2024 22:21:12 +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=1715718072; x=1716322872; i=fiona.klute@gmx.de; bh=ucUl7b5in+chSEB9g0wAjDfPvzc0t3WY3/nIyOgUDwc=; 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=pp7tAqL7lEVWJki2plxNz/rCLOoI6k4xx/7pdvb79WjkN1NzHCjowEeWUnCy1she kw/fK4ieWNOIGAD9J8XnO9/6gMltsw2AT0+LoUeSjmKvtCZNr4+ObKCWIUHoGR+Hu Q7frfWgjuHLPT1RwcFHgKeyH/Ty27Tx8Ob7sar4NbdrHMrb4UKIel83VdIGkPn/1v lBfu8kl8tjeowwq3SV24Z8sSsaS1GoXul1+6XN8a2WKECADUHwMzOJiRtoqOIrNIF JqSRd+1jwT7KpoZymHyNbVB9EcfUXAuYhj7eIXGMlxjH+q3GUjmdJQIg9ADmiUObX i/hF3lsCKOm6JCcebw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from haruka.lan ([85.22.125.31]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MOREc-1rwTjl3cSM-00Pyyl; Tue, 14 May 2024 22:21:11 +0200 From: Fiona Klute To: u-boot@lists.denx.de Cc: Fiona Klute Subject: [PATCH 1/2] doc: Detailed example for netconsole setup Date: Tue, 14 May 2024 22:20:40 +0200 Message-ID: <20240514202041.386027-1-fiona.klute@gmx.de> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:Fx8ddMhokoaLOZxT7oJe5HIGf2LUIBnZ/sCrobhY8wjLiDpqNhq ORg0JsI6aX90xr9Nuk5QlCL1vZrZCKmOQAHPhxUXdCXghqi6X36eI79T07cN6GsXM6Day4m 5Dv66NI7cYhrWMLpBPnc6jshoXj010y1MeR90pZNSUZI/pLjRYr7vFyDG0KRUbBIDjOst2o lYuJ/FC2zGJpSaRdF8BNg== UI-OutboundReport: notjunk:1;M01:P0:4b/ASIlAPvA=;cyadcIqB8kXxjO2/2iJmxWn4kx1 UldaCNf8y0AIyP96EB9MDWt13hoC2LmkBS4usZzCI9+/7c8KE0/xtUISJnD+kDL7KZ350GN/G MI6YfeKptWhk5gXuk/LTwMiVA0t5sf1QKGuwVhN84CS2HGYdbx9c6DgiZYtwftu/GkHFT8fKK JkzctmGOtaeveOQ6C/626fkp5cWmhFkxfEKlhENW9VCnUEeEnYXjTrn4G+v/lHVSpSJIOJ/Of oS6b90f8koKDePt8l0Y+Wr8GV6D9T5umcgq0XRcphkK/xY87oD87HEYiLsSD5EfBNlxl4hIxN 4VtS2TUCgv0t3YEZvanBj1HYun3MA7DiuVjSlCIZNgCfLdoPT9SbU99kqOhjSTfzA9A42Szm4 cOtoEZlXtQbBd5FnyJVFiIDEzeYpgd+zuCd8RyPVFeQfOzeCwWIvZxTjjLLnByE09UMMkWRnX Y5uFfrSKQ5CmEY+BI2OMo8wJaAhXFII2r1DbUKquJHBky4t1YW4Mu0UdwcPMPM14hjVMV857y jnXV8ecRKFVNVuowzhGaq7uEFfTP9Ep8atag/Uv11SAx40zYZJ6Q2eXbOFdoVF4D+pn+2bDrn zZh71oPe8cDelo1E9fQnNXyBfhxrrlMHLGKqleuguX7Kl2h+xUgjjHSrY26ALzOLgF50G+v9T bb65D/Hk8Dk+/7NO4dUyvAxGlhwlFBJo2fqcQ9/0dpW5L1S1e0Gp8N9V9OGMQOA/MVMf450pM DnBznc1X15jHrffpRVES4fMHfA2zS+UjHIyC2AhWa9ceuuBAlNnf1gQedd7n9Dn9SBiiogTBv EXKWVMTLjLuB65YT/fsfghne9BL5b1Hpf8SUoGI4Dq+PI= X-Mailman-Approved-At: Wed, 15 May 2024 02:28:00 +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 --- 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..0c983e6970 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 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 Tue May 14 20:20:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fiona Klute X-Patchwork-Id: 1935233 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=gEjZJkHQ; 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 4VfDbq1H9Vz20KD for ; Wed, 15 May 2024 10:28:39 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 73A37881D6; Wed, 15 May 2024 02:28:04 +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="gEjZJkHQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AED7C880A7; Tue, 14 May 2024 22:21:19 +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_H4, RCVD_IN_MSPIKE_WL,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.20]) (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 BCF9F8717A for ; Tue, 14 May 2024 22:21:17 +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=1715718077; x=1716322877; i=fiona.klute@gmx.de; bh=mc7M0U2AJGXlOeokSWVtO8gBV4HbmqeScC8sDNcWwkM=; 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=gEjZJkHQZXbQd/otw4TC0M0u3SrQFp6oybe5P/1j3ZzQrnI6Y0Yw2TjLIgMBVVaK iiE0XsfRev2lXqST+OjWOvSg+zVB74Pz5ajaSs4y/WPAoTDbER0ZTnK525Ek0ump9 fG3iDfVPBT/TIKr6GvznLLn4JSKYNJrvodvQAAUCuT7X2xCkgS+m3kC9V3sQMl/K7 4hRdjbz0uaK4KF/Daj4SQO5Yf4NtIahg+ZlcExAIC9TybTmbhigJ+cC1EtjOqm9kO o7ISPyx4FS6CGORPwtPUrbvfusbcaObIPyh/6EcuaUAyJ7cgO1kb/eji3SYmpgPxI XMD5l29214p03Cg4Aw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from haruka.lan ([85.22.125.31]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MwwZX-1sUAOV2oPL-00yUFW; Tue, 14 May 2024 22:21:16 +0200 From: Fiona Klute To: u-boot@lists.denx.de Cc: Fiona Klute Subject: [PATCH 2/2] doc: Update netconsole examples Date: Tue, 14 May 2024 22:20:41 +0200 Message-ID: <20240514202041.386027-2-fiona.klute@gmx.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240514202041.386027-1-fiona.klute@gmx.de> References: <20240514202041.386027-1-fiona.klute@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:mzwb0yKXdZbVHWu1PXcvfUELGjkJ48/64qcwGTomxjuC2HPrAPz xAgvoGZ87VojIlDqdPaaZO/TQTwfFgk68G0kOj7uNUbIhmR9/6O4LsDPfJTDWmH6IGwok5z CmLk9I83UkQNm8o78kRd3ARweFXjKxMjMvBSKHIEtLmZHvePhR43ERx927UTeYWVb1OY/+V uz5L9p5HOrWMVkQGoVnBA== UI-OutboundReport: notjunk:1;M01:P0:dQMw41TBBZs=;VmkhcXp/BneCxPEAiYTf6rLVnCI hB7g3ERWUTZM3gebysBg9oniw6frRVG4esMJXG3gMhjPARXu0tM3HBJDM08/g0cTKS5CNGDfP MSRewRajGE9vZHdciTbPWoaAvpzRCsTl17f5GVjJEIN7zTsOxm+hqfW/seuUM2la3nZrgj/ff RT7JV+51xTNM6Trx7bvcajWFjo6EFFfjf63whPsSdinTiXXJce4mgmXIX4B0X/rag7jqnVzDs HEmfchqLX8LE8m94E8BwoniB2dD6ApEbDU3ev65ajqpDZbWQUS1Wszx4iACzsmVqzyA0gQVqV +TTPZ9MtG8unmuwr2i+8bmF2sunXqe+12Y1w/Sy3H/MEXnkOgCik3DDP4haG6Ku6/M56iH1Fy Mn5uHvM4wnbplcjirxew5jWQuSZDdvOk9R7ko3NCsKX8wguj0sBP8BEeotqHcANj95OKNgrUd uKvwMN/DV+/0MobM/8ZW3/likVKxNT1CcVVO/Da6qTsouFrvHfWT/8F84eUtLHI50mblYcz9v 4sc4jdv/gUPPPQKrHewrp2l1FI6zBrBh8ZKNml9QtGkuAQuSSP5e5CdGYZP2mHJJWwsIKbZX4 a8r2Oi21urncr66ItcUx0/bwQELkxoY82BgfHWykSdvTCUJHwqFFsdDsVZ7jsHAMvPz5yfaxI J4lum7epLzyjpB4RfTHIhp11P2FR3M/G1Bp7UC+rWSLkBn9wdCYR78o1CN9ZDOnudXLONTX8+ JXa9VteFrZk+Gu04NNl8QDWjf4iIX7PqvWXyNT+l/Yh7uzXqhhGkOHJ1bi8HfHWX6/Syf5rKJ CN22d1Y8PUmp5kAx/bbCLKzYxjHAiXb+uzyjmi6kBQtJ4= X-Mailman-Approved-At: Wed, 15 May 2024 02:28:00 +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 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: Heinrich Schuchardt --- doc/usage/netconsole.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.43.0 diff --git a/doc/usage/netconsole.rst b/doc/usage/netconsole.rst index 0c983e6970..b5832843f3 100644 --- a/doc/usage/netconsole.rst +++ b/doc/usage/netconsole.rst @@ -24,9 +24,9 @@ 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 + => env set nc 'env set stdout 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