summaryrefslogtreecommitdiffstats
path: root/scripts/poky-qemu-ifup
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-09-10 10:43:06 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-09-10 10:45:55 +0100
commitc4ff5f303882a4dfbf37ddf835755b5df5fe881e (patch)
treec09df953fd83cd03ddd1246bf5eef59ecb4cb4ef /scripts/poky-qemu-ifup
parent8e43883f97f76857bd4cc85de544a09c6cceb24e (diff)
downloadast2050-yocto-poky-c4ff5f303882a4dfbf37ddf835755b5df5fe881e.zip
ast2050-yocto-poky-c4ff5f303882a4dfbf37ddf835755b5df5fe881e.tar.gz
scripts/poky-qemu-ifup: Ensure the host has a route to it
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'scripts/poky-qemu-ifup')
-rwxr-xr-xscripts/poky-qemu-ifup9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/poky-qemu-ifup b/scripts/poky-qemu-ifup
index e248a27..5ae6c6a 100755
--- a/scripts/poky-qemu-ifup
+++ b/scripts/poky-qemu-ifup
@@ -92,9 +92,18 @@ if [ "x$IFCONFIG" = "x" ]; then
IFCONFIG=/sbin/ifconfig
fi
+ROUTE=`which route`
+if [ "x$ROUTE" = "x" ]; then
+ # better than nothing...
+ ROUTE=/sbin/route
+fi
+
n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ]
$IFCONFIG $TAP 192.168.7.$n
+dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ]
+$ROUTE add -host 192.168.7.$dest $TAP
+
# setup NAT for tap0 interface to have internet access in QEMU
IPTABLES=`which iptables`
if [ "x$IPTABLES" = "x" ]; then
OpenPOWER on IntegriCloud