From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 16 Aug 2023 13:43:21 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qWEvq-006DOa-Fc for lore@lore.pengutronix.de; Wed, 16 Aug 2023 13:43:21 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1qWEvo-0001ao-7n; Wed, 16 Aug 2023 13:43:20 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qWEvh-0001Zi-2x; Wed, 16 Aug 2023 13:43:13 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qWEvg-0011jf-FX; Wed, 16 Aug 2023 13:43:12 +0200 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1qWEvf-00B4Bb-29; Wed, 16 Aug 2023 13:43:11 +0200 From: Oleksij Rempel To: distrokit@pengutronix.de Date: Wed, 16 Aug 2023 13:43:09 +0200 Message-Id: <20230816114310.2637671-4-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230816114310.2637671-1-o.rempel@pengutronix.de> References: <20230816114310.2637671-1-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [DistroKit] [PATCH v1 3/4] mipsel: run: make network work on systems with multiple QEMU instances X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oleksij Rempel Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false Other platforms use already PPID based ssh forwarding configuration. So, make it for MIPSEL too. Signed-off-by: Oleksij Rempel --- configs/platform-mipsel/run | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/configs/platform-mipsel/run b/configs/platform-mipsel/run index 36dc6de..6407f0c 100755 --- a/configs/platform-mipsel/run +++ b/configs/platform-mipsel/run @@ -36,14 +36,10 @@ if [ ! -e "${QEMU_EXEC}" ]; then exit 1 fi -# the port a 'telned' would connect to (in the emulated sysem) -TELNET_INTERNAL_PORT=23 -# port QEMU opens at the host side to give access to the ${TELNET_INTERNAL_PORT} -TELNET_EXTERNAL_PORT=4444 - -# dito for ssh +# the port to which an sshd would connect (in the emulated system) SSH_INTERNAL_PORT=22 -SSH_EXTERNAL_PORT=4445 +# the port which QEMU opens at the host side to give access to the ${SSH_INTERNAL_PORT} +SSH_EXTERNAL_PORT=${QEMU_SSH_PORT:-$((PPID%64000+1025))} # check if vde is available for networking if [ -z "${VDE_SOCKET}" ]; then @@ -62,7 +58,8 @@ fi # fall back to user network if necessary if [ -z "${QEMU_NET}" ]; then - QEMU_NET=(-netdev user,id=net1,hostfwd=tcp:127.0.0.1:${TELNET_EXTERNAL_PORT}-:${TELNET_INTERNAL_PORT},hostfwd=tcp:127.0.0.1:${SSH_EXTERNAL_PORT}-:${SSH_INTERNAL_PORT} ) + QEMU_NET=(-netdev user,id=net1,hostfwd=tcp:127.0.0.1:${SSH_EXTERNAL_PORT}-:${SSH_INTERNAL_PORT},hostfwd=tcp:127.0.0.1:12345-:12345) + echo "Forwarding SSH port 127.0.0.1:${SSH_EXTERNAL_PORT} -> qemu:${SSH_INTERNAL_PORT}" fi BASE_CMDLINE="console=ttyS0,115200" -- 2.39.2