mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
scripts: Show sensible warning messages if expected binaries don't exist
[YOCTO #1438] (From OE-Core rev: 6b5706d1f9ce7a3fd4d8f819ff8f3fd789665647) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -69,12 +69,29 @@ if [ "x$IFCONFIG" = "x" ]; then
|
||||
# better than nothing...
|
||||
IFCONFIG=/sbin/ifconfig
|
||||
fi
|
||||
if [ ! -x "$IFCONFIG" ]; then
|
||||
echo "$IFCONFIG cannot be executed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ROUTE=`which route`
|
||||
if [ "x$ROUTE" = "x" ]; then
|
||||
# better than nothing...
|
||||
ROUTE=/sbin/route
|
||||
fi
|
||||
if [ ! -x "$ROUTE" ]; then
|
||||
echo "$ROUTE cannot be executed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
IPTABLES=`which iptables 2> /dev/null`
|
||||
if [ "x$IPTABLES" = "x" ]; then
|
||||
IPTABLES=/sbin/iptables
|
||||
fi
|
||||
if [ ! -x "$IPTABLES" ]; then
|
||||
echo "$IPTABLES cannot be executed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ]
|
||||
$IFCONFIG $TAP 192.168.7.$n
|
||||
@@ -83,11 +100,6 @@ 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
|
||||
IPTABLES=/sbin/iptables
|
||||
fi
|
||||
|
||||
$IPTABLES -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.0/24
|
||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
$IPTABLES -P FORWARD ACCEPT
|
||||
|
||||
Reference in New Issue
Block a user