diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-06-06 09:55:10 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-06-20 20:27:30 +0200 |
commit | a906324e0ff601fcb2c006529dd57f58681cecc7 (patch) | |
tree | 67aa2742e706d9afc532377268ab350c8a0a090f /configs | |
parent | acdb6fe27b28826754adf508a81fa86134b94c5d (diff) | |
download | DistroKit-a906324e0ff601fcb2c006529dd57f58681cecc7.tar.gz DistroKit-a906324e0ff601fcb2c006529dd57f58681cecc7.tar.xz |
arm-qemu/run: network with vde if possible
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'configs')
-rwxr-xr-x | configs/arm-qemu-2011.01.0/run | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/configs/arm-qemu-2011.01.0/run b/configs/arm-qemu-2011.01.0/run index 0230228..d83fd51 100755 --- a/configs/arm-qemu-2011.01.0/run +++ b/configs/arm-qemu-2011.01.0/run @@ -56,12 +56,28 @@ TELNET_INTERNAL_PORT=23 # port QEMU opens at the host side to give access to the ${TELNET_INTERNAL_PORT} TELNET_EXTERNAL_PORT=4444 +if [ -z "${VDE_SOCKET}" ]; then + for dir in $(ls -d /var/run/vde2/*.ctl 2>/dev/null); do + if [ -r "${dir}" ]; then + VDE_SOCKET="${dir}" + fi + done +fi +if [ -n "${VDE_SOCKET}" ]; then + if ${QEMU_EXEC} --help | grep -q -- '-net vde'; then + QEMU_NET="-net vde,vlan=1,sock=${VDE_SOCKET}" + fi +fi +if [ -z "${QEMU_NET}" ]; then + QEMU_NET="-net user,vlan=1" +fi + # do the job ${QEMU_EXEC} ${QEMU_NOGRAPHIC} \ -M ${QEMU_MACHINE} \ -no-reboot \ -net nic,vlan=1 \ - -net user,vlan=1 \ + ${QEMU_NET} \ -redir tcp:${TELNET_EXTERNAL_PORT}:${PLATFORM_IP}:${TELNET_INTERNAL_PORT} \ -kernel ${PTXDIST_PLATFORMDIR}/images/linuximage \ -hda ${PTXDIST_PLATFORMDIR}/images/hd.img \ |