path: root/configs
diff options
authorRoland Hieber <>2021-04-26 12:07:15 +0200
committerRobert Schwebel <>2021-04-26 12:08:51 +0200
commitd975eb8b04087f8606d881d527d02e75f97c6243 (patch)
tree4c92b0f4332310867dbcc405c80cf40b92f8d725 /configs
parent55e2a6b1cf7ee69819d9f8388d2eba35fc077c2a (diff)
v7a: run: make the SSH forwarding port multiprocess-compatible
When multiple ./configs/platform-v7a/run scripts are run at the same time, the first qemu process will open port 4445, and following runs will fail. To prevent that, first look at the environment variable QEMU_SSH_PORT to determine the port to be used (so that users can set this in their shell to keep the port constant), or fall back to a port between 1025 and 65025 based on the shell's PID, which should have a good chance of choosing an unused, but stable port. Also print the port forwarding before starting qemu, so we don't have to bother about grepping the process list. Signed-off-by: Roland Hieber <> Link: Signed-off-by: Robert Schwebel <>
Diffstat (limited to 'configs')
1 files changed, 2 insertions, 1 deletions
diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run
index ed8ab1b..8af190f 100755
--- a/configs/platform-v7a/run
+++ b/configs/platform-v7a/run
@@ -39,7 +39,7 @@ fi
# the port to which an sshd would connect (in the emulated sysem)
# the port which QEMU opens at the host side to give access to the ${SSH_INTERNAL_PORT}
# check if vde is available for networking
if [ -z "${VDE_SOCKET}" ]; then
@@ -59,6 +59,7 @@ fi
# fall back to user network if necessary
if [ -z "${QEMU_NET}" ]; then
QEMU_NET=(-netdev user,id=net1,hostfwd=tcp:${SSH_EXTERNAL_PORT}-:${SSH_INTERNAL_PORT} )
+ echo "Forwarding SSH port${SSH_EXTERNAL_PORT} -> qemu:${SSH_INTERNAL_PORT}"
BASE_CMDLINE="console=ttyAMA0,115200 loglevel=5 systemd.log_level=warning systemd.show_status=auto"