summaryrefslogtreecommitdiffstats
path: root/configs/platform-v7a/run
diff options
context:
space:
mode:
Diffstat (limited to 'configs/platform-v7a/run')
-rwxr-xr-xconfigs/platform-v7a/run26
1 files changed, 9 insertions, 17 deletions
diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run
index 1dc4fd6..257dc1a 100755
--- a/configs/platform-v7a/run
+++ b/configs/platform-v7a/run
@@ -1,17 +1,12 @@
#!/bin/bash
-platformconfig=selected_platformconfig
-# fallback to platformconfig in the same dir as this script
-if [ ! -e "$platformconfig" ]; then
- platformconfig=$(dirname $0)/platformconfig
-fi
+platformconfig=$(dirname $0)/platformconfig
#
# we need information about the platform
#
if [ ! -e "$platformconfig" ]; then
- echo "error: selected_platformconfig does not exist"
- echo " please use 'ptxdist platform ...' or 'ptxdist --platformconfig=...'"
+ echo "error: ${platformconfig} does not exist"
exit 1
fi
@@ -36,14 +31,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,10 +53,11 @@ 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=ttyAMA0,115200 loglevel=5 systemd.log_level=warning systemd.show_status=auto"
+BASE_CMDLINE="console=ttyAMA0,115200 loglevel=5 systemd.show_status=auto"
if [ -d "${PTXDIST_PLATFORMDIR}/root/.virtfs_metadata" ]; then
security_model="mapped-file"
@@ -180,7 +172,7 @@ run_qemu_barebox() {
"${QEMU_BAREBOX_ARGS[@]}"
}
-target="${1:-9p}"
+target="${1:-barebox}"
#set -x
run_qemu_${target}