]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts: Show sensible warning messages if expected binaries don't exist
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 1 Sep 2011 21:04:48 +0000 (22:04 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 2 Sep 2011 13:20:32 +0000 (14:20 +0100)
[YOCTO #1438]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/oe-find-native-sysroot
scripts/runqemu-export-rootfs
scripts/runqemu-extract-sdk
scripts/runqemu-gen-tapdevs
scripts/runqemu-ifup
scripts/runqemu-internal

index b99014b52eccd46c3f1472b2abbb317c53aa3661..b2c22aaf40f089d509b2fe27ff1700ca8e11990f 100755 (executable)
@@ -31,7 +31,7 @@
 # 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
index 6f4604d9a6534cf6ee0cbbb459d43fbc9c649bce..3ee311235db87f0b62f46ee653bc1fef7b3db0cc 100755 (executable)
@@ -38,7 +38,7 @@ fi
 # 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?"
index d30e5a64aa53ed4273aeb389196306e668c0734d..4b5247597f62197f6f71791a8cdcef4a0db581bb 100755 (executable)
@@ -29,7 +29,7 @@ if [ $# -ne 2 ]; then
        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?"
index 9f313879e6b64e02e34170cbf1a9c506a4bebdf8..15bccd4484a0a33b43911e82e04b7c2d05287ac6 100755 (executable)
@@ -62,6 +62,10 @@ if [ -z "$IFCONFIG" ]; then
        # 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
index 987a37a1a7ae12f12e1fba47c676306a8d2859ad..870cb6bcb7ea186e735dad0501d9fbfde4ea790a 100755 (executable)
@@ -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
index 19f8d3de8ef9d73b175ef65617d9be56fbc43d9b..4f6909b734c370b327f7121fa3066ec564d1101b 100755 (executable)
@@ -88,8 +88,16 @@ fi
 # 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"
 
@@ -137,6 +145,10 @@ IFCONFIG=`which ifconfig 2> /dev/null`
 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=""
@@ -418,7 +430,7 @@ fi
 
 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
@@ -434,7 +446,7 @@ function _quit() {
     return
 }
 
-DISTCCD=`which distccd`
+DISTCCD=`which distccd 2> /dev/null`
 PIDFILE=""
 
 trap _quit INT TERM QUIT