summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-09-01 22:04:48 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-09-02 14:21:30 +0100
commitd1a84c9f3d387bfeaeaa0007dda8d90164633255 (patch)
treef51c9af343a5ab6f3a0990aefeee94d432d1ceea
parentc0df2ab7ebac5650e52089ada97e8657f8af3979 (diff)
downloadpoky-d1a84c9f3d387bfeaeaa0007dda8d90164633255.tar.gz
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>
-rwxr-xr-xscripts/oe-find-native-sysroot2
-rwxr-xr-xscripts/runqemu-export-rootfs2
-rwxr-xr-xscripts/runqemu-extract-sdk2
-rwxr-xr-xscripts/runqemu-gen-tapdevs4
-rwxr-xr-xscripts/runqemu-ifup22
-rwxr-xr-xscripts/runqemu-internal20
6 files changed, 40 insertions, 12 deletions
diff --git a/scripts/oe-find-native-sysroot b/scripts/oe-find-native-sysroot
index b99014b52e..b2c22aaf40 100755
--- a/scripts/oe-find-native-sysroot
+++ b/scripts/oe-find-native-sysroot
@@ -31,7 +31,7 @@
31# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 31# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
32 32
33if [ -z "$OECORE_NATIVE_SYSROOT" ]; then 33if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
34 BITBAKE=`which bitbake` 34 BITBAKE=`which bitbake 2> /dev/null`
35 if [ "x$BITBAKE" != "x" ]; then 35 if [ "x$BITBAKE" != "x" ]; then
36 if [ "$UID" = "0" ]; then 36 if [ "$UID" = "0" ]; then
37 # Root cannot run bitbake unless sanity checking is disabled 37 # Root cannot run bitbake unless sanity checking is disabled
diff --git a/scripts/runqemu-export-rootfs b/scripts/runqemu-export-rootfs
index 6f4604d9a6..3ee311235d 100755
--- a/scripts/runqemu-export-rootfs
+++ b/scripts/runqemu-export-rootfs
@@ -38,7 +38,7 @@ fi
38# Ensure the nfs-export-dir is an absolute path 38# Ensure the nfs-export-dir is an absolute path
39NFS_EXPORT_DIR=$(cd "$2" && pwd) 39NFS_EXPORT_DIR=$(cd "$2" && pwd)
40 40
41SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot` 41SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
42if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then 42if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
43 echo "Error: Unable to find the oe-find-native-sysroot script" 43 echo "Error: Unable to find the oe-find-native-sysroot script"
44 echo "Did you forget to source your build environment setup script?" 44 echo "Did you forget to source your build environment setup script?"
diff --git a/scripts/runqemu-extract-sdk b/scripts/runqemu-extract-sdk
index d30e5a64aa..4b5247597f 100755
--- a/scripts/runqemu-extract-sdk
+++ b/scripts/runqemu-extract-sdk
@@ -29,7 +29,7 @@ if [ $# -ne 2 ]; then
29 exit 1 29 exit 1
30fi 30fi
31 31
32SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot` 32SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
33if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then 33if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
34 echo "Error: Unable to find the oe-find-native-sysroot script" 34 echo "Error: Unable to find the oe-find-native-sysroot script"
35 echo "Did you forget to source your build system environment setup script?" 35 echo "Did you forget to source your build system environment setup script?"
diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs
index 9f313879e6..15bccd4484 100755
--- a/scripts/runqemu-gen-tapdevs
+++ b/scripts/runqemu-gen-tapdevs
@@ -62,6 +62,10 @@ if [ -z "$IFCONFIG" ]; then
62 # Is it ever anywhere else? 62 # Is it ever anywhere else?
63 IFCONFIG=/sbin/ifconfig 63 IFCONFIG=/sbin/ifconfig
64fi 64fi
65if [ ! -x "$IFCONFIG" ]; then
66 echo "$IFCONFIG cannot be executed"
67 exit 1
68fi
65 69
66# Ensure we start with a clean slate 70# Ensure we start with a clean slate
67for tap in `$IFCONFIG | grep ^tap | awk '{ print \$1 }'`; do 71for tap in `$IFCONFIG | grep ^tap | awk '{ print \$1 }'`; do
diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup
index 987a37a1a7..870cb6bcb7 100755
--- a/scripts/runqemu-ifup
+++ b/scripts/runqemu-ifup
@@ -69,12 +69,29 @@ if [ "x$IFCONFIG" = "x" ]; then
69 # better than nothing... 69 # better than nothing...
70 IFCONFIG=/sbin/ifconfig 70 IFCONFIG=/sbin/ifconfig
71fi 71fi
72if [ ! -x "$IFCONFIG" ]; then
73 echo "$IFCONFIG cannot be executed"
74 exit 1
75fi
72 76
73ROUTE=`which route` 77ROUTE=`which route`
74if [ "x$ROUTE" = "x" ]; then 78if [ "x$ROUTE" = "x" ]; then
75 # better than nothing... 79 # better than nothing...
76 ROUTE=/sbin/route 80 ROUTE=/sbin/route
77fi 81fi
82if [ ! -x "$ROUTE" ]; then
83 echo "$ROUTE cannot be executed"
84 exit 1
85fi
86
87IPTABLES=`which iptables 2> /dev/null`
88if [ "x$IPTABLES" = "x" ]; then
89 IPTABLES=/sbin/iptables
90fi
91if [ ! -x "$IPTABLES" ]; then
92 echo "$IPTABLES cannot be executed"
93 exit 1
94fi
78 95
79n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ] 96n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ]
80$IFCONFIG $TAP 192.168.7.$n 97$IFCONFIG $TAP 192.168.7.$n
@@ -83,11 +100,6 @@ dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ]
83$ROUTE add -host 192.168.7.$dest $TAP 100$ROUTE add -host 192.168.7.$dest $TAP
84 101
85# setup NAT for tap0 interface to have internet access in QEMU 102# setup NAT for tap0 interface to have internet access in QEMU
86IPTABLES=`which iptables`
87if [ "x$IPTABLES" = "x" ]; then
88 IPTABLES=/sbin/iptables
89fi
90
91$IPTABLES -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.0/24 103$IPTABLES -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.0/24
92echo 1 > /proc/sys/net/ipv4/ip_forward 104echo 1 > /proc/sys/net/ipv4/ip_forward
93$IPTABLES -P FORWARD ACCEPT 105$IPTABLES -P FORWARD ACCEPT
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index 19f8d3de8e..4f6909b734 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -88,8 +88,16 @@ fi
88# sudo. 88# sudo.
89NOSUDO_FLAG="/etc/runqemu-nosudo" 89NOSUDO_FLAG="/etc/runqemu-nosudo"
90 90
91QEMUIFUP=`which runqemu-ifup` 91QEMUIFUP=`which runqemu-ifup 2> /dev/null`
92QEMUIFDOWN=`which runqemu-ifdown` 92QEMUIFDOWN=`which runqemu-ifdown 2> /dev/null`
93if [ -z "$QEMUIFUP" -o ! -x "$QEMUIFUP" ]; then
94 echo "runqemu-ifup cannot be found or executed"
95 exit 1
96fi
97if [ -z "$QEMUIFDOWN" -o ! -x "$QEMUIFDOWN" ]; then
98 echo "runqemu-ifdown cannot be found or executed"
99 exit 1
100fi
93 101
94NFSRUNNING="false" 102NFSRUNNING="false"
95 103
@@ -137,6 +145,10 @@ IFCONFIG=`which ifconfig 2> /dev/null`
137if [ -z "$IFCONFIG" ]; then 145if [ -z "$IFCONFIG" ]; then
138 IFCONFIG=/sbin/ifconfig 146 IFCONFIG=/sbin/ifconfig
139fi 147fi
148if [ ! -x "$IFCONFIG" ]; then
149 echo "$IFCONFIG cannot be executed"
150 exit 1
151fi
140 152
141POSSIBLE=`$IFCONFIG -a | grep '^tap' | awk '{print $1}'` 153POSSIBLE=`$IFCONFIG -a | grep '^tap' | awk '{print $1}'`
142TAP="" 154TAP=""
@@ -418,7 +430,7 @@ fi
418 430
419PATH=$CROSSPATH:$OECORE_NATIVE_SYSROOT/usr/bin:$PATH 431PATH=$CROSSPATH:$OECORE_NATIVE_SYSROOT/usr/bin:$PATH
420 432
421QEMUBIN=`which $QEMU` 433QEMUBIN=`which $QEMU 2> /dev/null`
422if [ ! -x "$QEMUBIN" ]; then 434if [ ! -x "$QEMUBIN" ]; then
423 echo "Error: No QEMU binary '$QEMU' could be found." 435 echo "Error: No QEMU binary '$QEMU' could be found."
424 cleanup 436 cleanup
@@ -434,7 +446,7 @@ function _quit() {
434 return 446 return
435} 447}
436 448
437DISTCCD=`which distccd` 449DISTCCD=`which distccd 2> /dev/null`
438PIDFILE="" 450PIDFILE=""
439 451
440trap _quit INT TERM QUIT 452trap _quit INT TERM QUIT