summaryrefslogtreecommitdiffstats
path: root/configs/platform-mips/run
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2023-08-16 13:43:07 +0200
committerRobert Schwebel <r.schwebel@pengutronix.de>2023-08-16 15:44:15 +0200
commit09938ed7c150deb0b6b5182394c93801deef83d0 (patch)
tree07980879e8bdf5fb51e9e7910a984ad85e2146a0 /configs/platform-mips/run
parentf7f0ef3930b2257d649d7c148275aa114b44684d (diff)
downloadDistroKit-09938ed7c150deb0b6b5182394c93801deef83d0.tar.gz
DistroKit-09938ed7c150deb0b6b5182394c93801deef83d0.tar.xz
mips: run: make network work on systems with multiple QEMU instances
Other platforms use already PPID based ssh forwarding configuration. So, make it for MIPS too. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20230816114310.2637671-2-o.rempel@pengutronix.de Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Diffstat (limited to 'configs/platform-mips/run')
-rwxr-xr-xconfigs/platform-mips/run13
1 files changed, 5 insertions, 8 deletions
diff --git a/configs/platform-mips/run b/configs/platform-mips/run
index cf8a535..e41f012 100755
--- a/configs/platform-mips/run
+++ b/configs/platform-mips/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 loglevel=5 systemd.show_status=auto"