From e27e83237a8b1568342a2a2775c9314384e953ff Mon Sep 17 00:00:00 2001 From: Munkyu Im Date: Thu, 24 Sep 2015 17:47:25 +0900 Subject: [PATCH] net: bridge name is flexible qemu set bridged network on mac os 10.8. bridge name was fixed with "bridge0". However from mac os 10.9, the setting is possible on host network configuration. So, support another bridge names. Change-Id: I6c75766ca624847cf5e11a5ff9f61afbe89f041f Signed-off-by: Munkyu Im --- tizen/src/scripts/emulator-ifup-darwin.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tizen/src/scripts/emulator-ifup-darwin.sh b/tizen/src/scripts/emulator-ifup-darwin.sh index d199e71f18..c4a2bd6f53 100755 --- a/tizen/src/scripts/emulator-ifup-darwin.sh +++ b/tizen/src/scripts/emulator-ifup-darwin.sh @@ -1,18 +1,29 @@ #!/bin/sh -x -BRIDGE=bridge1 +#$1 = tap name (e.g. tap0) +#$2 = bridge name (optional) TAP=$1 -BASE=en0 echo "TAP: $1" + +BRIDGE="" +if [ x"$2" != x ]; then + echo "BRIDGE=$2" + BRIDGE=$2 +else + echo "BRIDGE=bridge1" + BRIDGE=bridge1 +fi + +BASE=en0 echo "get base network information" IP=`ipconfig getifaddr $BASE` NETMASK=`ifconfig $BASE | grep "inet " | awk '{print $4}'` -GW=`netstat -rn | grep ^default | awk '{print $2}'` +GW=`netstat -rn | grep $BRIDGE | grep ^default | awk '{print $2}'` echo "IP: $IP" echo "NETMASK: $NETMASK" echo "GW: $GW" echo "create bridge interface" -CHECK_BR=`ifconfig | grep ^bridge1:` +CHECK_BR=`ifconfig | grep ^$BRIDGE:` echo "CHECK_BR: $CHECK_BR" if [ "$CHECK_BR" = "" ] then -- 2.34.1