# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
- BITBAKE=`which bitbake`
+ BITBAKE=`which bitbake 2> /dev/null`
if [ "x$BITBAKE" != "x" ]; then
if [ "$UID" = "0" ]; then
# Root cannot run bitbake unless sanity checking is disabled
# Ensure the nfs-export-dir is an absolute path
NFS_EXPORT_DIR=$(cd "$2" && pwd)
-SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot`
+SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
echo "Error: Unable to find the oe-find-native-sysroot script"
echo "Did you forget to source your build environment setup script?"
exit 1
fi
-SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot`
+SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
echo "Error: Unable to find the oe-find-native-sysroot script"
echo "Did you forget to source your build system environment setup script?"
# Is it ever anywhere else?
IFCONFIG=/sbin/ifconfig
fi
+if [ ! -x "$IFCONFIG" ]; then
+ echo "$IFCONFIG cannot be executed"
+ exit 1
+fi
# Ensure we start with a clean slate
for tap in `$IFCONFIG | grep ^tap | awk '{ print \$1 }'`; do
# 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
$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
# sudo.
NOSUDO_FLAG="/etc/runqemu-nosudo"
-QEMUIFUP=`which runqemu-ifup`
-QEMUIFDOWN=`which runqemu-ifdown`
+QEMUIFUP=`which runqemu-ifup 2> /dev/null`
+QEMUIFDOWN=`which runqemu-ifdown 2> /dev/null`
+if [ -z "$QEMUIFUP" -o ! -x "$QEMUIFUP" ]; then
+ echo "runqemu-ifup cannot be found or executed"
+ exit 1
+fi
+if [ -z "$QEMUIFDOWN" -o ! -x "$QEMUIFDOWN" ]; then
+ echo "runqemu-ifdown cannot be found or executed"
+ exit 1
+fi
NFSRUNNING="false"
if [ -z "$IFCONFIG" ]; then
IFCONFIG=/sbin/ifconfig
fi
+if [ ! -x "$IFCONFIG" ]; then
+ echo "$IFCONFIG cannot be executed"
+ exit 1
+fi
POSSIBLE=`$IFCONFIG -a | grep '^tap' | awk '{print $1}'`
TAP=""
PATH=$CROSSPATH:$OECORE_NATIVE_SYSROOT/usr/bin:$PATH
-QEMUBIN=`which $QEMU`
+QEMUBIN=`which $QEMU 2> /dev/null`
if [ ! -x "$QEMUBIN" ]; then
echo "Error: No QEMU binary '$QEMU' could be found."
cleanup
return
}
-DISTCCD=`which distccd`
+DISTCCD=`which distccd 2> /dev/null`
PIDFILE=""
trap _quit INT TERM QUIT