diff options
author | Khem Raj <raj.khem@gmail.com> | 2013-05-12 22:42:22 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-16 00:09:47 +0300 |
commit | 4520feca657ac543267b4c8840e57bb32baf18c3 (patch) | |
tree | 538c6732f1c7a51206faf834c8c4393fbe984a45 /scripts | |
parent | f259554b4e91eecbb009622a64e43c5619aedb92 (diff) | |
download | poky-4520feca657ac543267b4c8840e57bb32baf18c3.tar.gz |
runqemu: Replace use of ifconfig with ip
ifconfig and its ilk (net-tools package) is deprecated in favour of iproute2 package
and is now removed by many distro's e.g. Archlinux. So we replace ifconfig with ip utility
(From OE-Core rev: c19e5d19ae8e6e6eb9b37549d80765b8315f79a4)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu-gen-tapdevs | 6 | ||||
-rwxr-xr-x | scripts/runqemu-ifup | 6 | ||||
-rwxr-xr-x | scripts/runqemu-internal | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs index f5be30ac32..d3b27be291 100755 --- a/scripts/runqemu-gen-tapdevs +++ b/scripts/runqemu-gen-tapdevs | |||
@@ -59,10 +59,10 @@ if [ ! -x "$RUNQEMU_IFUP" ]; then | |||
59 | exit 1 | 59 | exit 1 |
60 | fi | 60 | fi |
61 | 61 | ||
62 | IFCONFIG=`which ifconfig 2> /dev/null` | 62 | IFCONFIG=`which ip 2> /dev/null` |
63 | if [ -z "$IFCONFIG" ]; then | 63 | if [ -z "$IFCONFIG" ]; then |
64 | # Is it ever anywhere else? | 64 | # Is it ever anywhere else? |
65 | IFCONFIG=/sbin/ifconfig | 65 | IFCONFIG=/sbin/ip |
66 | fi | 66 | fi |
67 | if [ ! -x "$IFCONFIG" ]; then | 67 | if [ ! -x "$IFCONFIG" ]; then |
68 | echo "$IFCONFIG cannot be executed" | 68 | echo "$IFCONFIG cannot be executed" |
@@ -70,7 +70,7 @@ if [ ! -x "$IFCONFIG" ]; then | |||
70 | fi | 70 | fi |
71 | 71 | ||
72 | # Ensure we start with a clean slate | 72 | # Ensure we start with a clean slate |
73 | for tap in `$IFCONFIG | grep ^tap | awk '{ print \$1 }' | sed s/://`; do | 73 | for tap in `$IFCONFIG link | grep tap | awk '{ print \$2 }' | sed s/://`; do |
74 | echo "Note: Destroying pre-existing tap interface $tap..." | 74 | echo "Note: Destroying pre-existing tap interface $tap..." |
75 | $TUNCTL -d $tap | 75 | $TUNCTL -d $tap |
76 | done | 76 | done |
diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup index 0926faf439..8948153d5a 100755 --- a/scripts/runqemu-ifup +++ b/scripts/runqemu-ifup | |||
@@ -70,10 +70,10 @@ if [ $STATUS -ne 0 ]; then | |||
70 | fi | 70 | fi |
71 | fi | 71 | fi |
72 | 72 | ||
73 | IFCONFIG=`which ifconfig 2> /dev/null` | 73 | IFCONFIG=`which ip 2> /dev/null` |
74 | if [ "x$IFCONFIG" = "x" ]; then | 74 | if [ "x$IFCONFIG" = "x" ]; then |
75 | # better than nothing... | 75 | # better than nothing... |
76 | IFCONFIG=/sbin/ifconfig | 76 | IFCONFIG=/sbin/ip |
77 | fi | 77 | fi |
78 | if [ ! -x "$IFCONFIG" ]; then | 78 | if [ ! -x "$IFCONFIG" ]; then |
79 | echo "$IFCONFIG cannot be executed" | 79 | echo "$IFCONFIG cannot be executed" |
@@ -100,7 +100,7 @@ if [ ! -x "$IPTABLES" ]; then | |||
100 | fi | 100 | fi |
101 | 101 | ||
102 | n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ] | 102 | n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ] |
103 | $IFCONFIG $TAP 192.168.7.$n netmask 255.255.255.255 | 103 | $IFCONFIG addr add 192.168.7.$n/32 dev $TAP |
104 | 104 | ||
105 | dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ] | 105 | dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ] |
106 | $ROUTE add -host 192.168.7.$dest $TAP | 106 | $ROUTE add -host 192.168.7.$dest $TAP |
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal index 3bd0a09d8e..3c5282d89a 100755 --- a/scripts/runqemu-internal +++ b/scripts/runqemu-internal | |||
@@ -139,16 +139,16 @@ if [ ! -d "$LOCKDIR" ]; then | |||
139 | chmod 777 $LOCKDIR | 139 | chmod 777 $LOCKDIR |
140 | fi | 140 | fi |
141 | 141 | ||
142 | IFCONFIG=`which ifconfig 2> /dev/null` | 142 | IFCONFIG=`which ip 2> /dev/null` |
143 | if [ -z "$IFCONFIG" ]; then | 143 | if [ -z "$IFCONFIG" ]; then |
144 | IFCONFIG=/sbin/ifconfig | 144 | IFCONFIG=/sbin/ip |
145 | fi | 145 | fi |
146 | if [ ! -x "$IFCONFIG" ]; then | 146 | if [ ! -x "$IFCONFIG" ]; then |
147 | echo "$IFCONFIG cannot be executed" | 147 | echo "$IFCONFIG cannot be executed" |
148 | exit 1 | 148 | exit 1 |
149 | fi | 149 | fi |
150 | 150 | ||
151 | POSSIBLE=`$IFCONFIG -a | grep '^tap' | awk '{print $1}' | sed s/://` | 151 | POSSIBLE=`$IFCONFIG link | grep 'tap' | awk '{print $2}' | sed s/://` |
152 | TAP="" | 152 | TAP="" |
153 | LOCKFILE="" | 153 | LOCKFILE="" |
154 | for tap in $POSSIBLE; do | 154 | for tap in $POSSIBLE; do |