diff options
-rwxr-xr-x | scripts/oe-find-native-sysroot | 2 | ||||
-rwxr-xr-x | scripts/runqemu-export-rootfs | 2 | ||||
-rwxr-xr-x | scripts/runqemu-extract-sdk | 2 | ||||
-rwxr-xr-x | scripts/runqemu-gen-tapdevs | 4 | ||||
-rwxr-xr-x | scripts/runqemu-ifup | 22 | ||||
-rwxr-xr-x | scripts/runqemu-internal | 20 |
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 | ||
33 | if [ -z "$OECORE_NATIVE_SYSROOT" ]; then | 33 | if [ -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 |
39 | NFS_EXPORT_DIR=$(cd "$2" && pwd) | 39 | NFS_EXPORT_DIR=$(cd "$2" && pwd) |
40 | 40 | ||
41 | SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot` | 41 | SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null` |
42 | if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then | 42 | if [ -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 |
30 | fi | 30 | fi |
31 | 31 | ||
32 | SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot` | 32 | SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null` |
33 | if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then | 33 | if [ -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 |
64 | fi | 64 | fi |
65 | if [ ! -x "$IFCONFIG" ]; then | ||
66 | echo "$IFCONFIG cannot be executed" | ||
67 | exit 1 | ||
68 | fi | ||
65 | 69 | ||
66 | # Ensure we start with a clean slate | 70 | # Ensure we start with a clean slate |
67 | for tap in `$IFCONFIG | grep ^tap | awk '{ print \$1 }'`; do | 71 | for 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 |
71 | fi | 71 | fi |
72 | if [ ! -x "$IFCONFIG" ]; then | ||
73 | echo "$IFCONFIG cannot be executed" | ||
74 | exit 1 | ||
75 | fi | ||
72 | 76 | ||
73 | ROUTE=`which route` | 77 | ROUTE=`which route` |
74 | if [ "x$ROUTE" = "x" ]; then | 78 | if [ "x$ROUTE" = "x" ]; then |
75 | # better than nothing... | 79 | # better than nothing... |
76 | ROUTE=/sbin/route | 80 | ROUTE=/sbin/route |
77 | fi | 81 | fi |
82 | if [ ! -x "$ROUTE" ]; then | ||
83 | echo "$ROUTE cannot be executed" | ||
84 | exit 1 | ||
85 | fi | ||
86 | |||
87 | IPTABLES=`which iptables 2> /dev/null` | ||
88 | if [ "x$IPTABLES" = "x" ]; then | ||
89 | IPTABLES=/sbin/iptables | ||
90 | fi | ||
91 | if [ ! -x "$IPTABLES" ]; then | ||
92 | echo "$IPTABLES cannot be executed" | ||
93 | exit 1 | ||
94 | fi | ||
78 | 95 | ||
79 | n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ] | 96 | n=$[ (`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 |
86 | IPTABLES=`which iptables` | ||
87 | if [ "x$IPTABLES" = "x" ]; then | ||
88 | IPTABLES=/sbin/iptables | ||
89 | fi | ||
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 |
92 | echo 1 > /proc/sys/net/ipv4/ip_forward | 104 | echo 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. |
89 | NOSUDO_FLAG="/etc/runqemu-nosudo" | 89 | NOSUDO_FLAG="/etc/runqemu-nosudo" |
90 | 90 | ||
91 | QEMUIFUP=`which runqemu-ifup` | 91 | QEMUIFUP=`which runqemu-ifup 2> /dev/null` |
92 | QEMUIFDOWN=`which runqemu-ifdown` | 92 | QEMUIFDOWN=`which runqemu-ifdown 2> /dev/null` |
93 | if [ -z "$QEMUIFUP" -o ! -x "$QEMUIFUP" ]; then | ||
94 | echo "runqemu-ifup cannot be found or executed" | ||
95 | exit 1 | ||
96 | fi | ||
97 | if [ -z "$QEMUIFDOWN" -o ! -x "$QEMUIFDOWN" ]; then | ||
98 | echo "runqemu-ifdown cannot be found or executed" | ||
99 | exit 1 | ||
100 | fi | ||
93 | 101 | ||
94 | NFSRUNNING="false" | 102 | NFSRUNNING="false" |
95 | 103 | ||
@@ -137,6 +145,10 @@ IFCONFIG=`which ifconfig 2> /dev/null` | |||
137 | if [ -z "$IFCONFIG" ]; then | 145 | if [ -z "$IFCONFIG" ]; then |
138 | IFCONFIG=/sbin/ifconfig | 146 | IFCONFIG=/sbin/ifconfig |
139 | fi | 147 | fi |
148 | if [ ! -x "$IFCONFIG" ]; then | ||
149 | echo "$IFCONFIG cannot be executed" | ||
150 | exit 1 | ||
151 | fi | ||
140 | 152 | ||
141 | POSSIBLE=`$IFCONFIG -a | grep '^tap' | awk '{print $1}'` | 153 | POSSIBLE=`$IFCONFIG -a | grep '^tap' | awk '{print $1}'` |
142 | TAP="" | 154 | TAP="" |
@@ -418,7 +430,7 @@ fi | |||
418 | 430 | ||
419 | PATH=$CROSSPATH:$OECORE_NATIVE_SYSROOT/usr/bin:$PATH | 431 | PATH=$CROSSPATH:$OECORE_NATIVE_SYSROOT/usr/bin:$PATH |
420 | 432 | ||
421 | QEMUBIN=`which $QEMU` | 433 | QEMUBIN=`which $QEMU 2> /dev/null` |
422 | if [ ! -x "$QEMUBIN" ]; then | 434 | if [ ! -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 | ||
437 | DISTCCD=`which distccd` | 449 | DISTCCD=`which distccd 2> /dev/null` |
438 | PIDFILE="" | 450 | PIDFILE="" |
439 | 451 | ||
440 | trap _quit INT TERM QUIT | 452 | trap _quit INT TERM QUIT |