[OE-core] [PATCH] runqemu: Replace use of ifconfig with ip

Khem Raj raj.khem at gmail.com
Wed May 8 20:43:19 UTC 2013


On May 8, 2013, at 1:15 PM, Trevor Woerner <twoerner at gmail.com> wrote:

> On Wed, May 8, 2013 at 3:40 PM, Khem Raj <raj.khem at gmail.com> wrote:
>> 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
>> 
>> Signed-off-by: Khem Raj <raj.khem at gmail.com>
>> ---
>> scripts/runqemu-gen-tapdevs | 6 +++---
>> scripts/runqemu-ifup        | 6 +++---
>> scripts/runqemu-internal    | 6 +++---
>> 3 files changed, 9 insertions(+), 9 deletions(-)
>> 
>> diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs
>> index f5be30a..d3b27be 100755
>> --- a/scripts/runqemu-gen-tapdevs
>> +++ b/scripts/runqemu-gen-tapdevs
>> @@ -59,10 +59,10 @@ if [ ! -x "$RUNQEMU_IFUP" ]; then
>>        exit 1
>> fi
>> 
>> -IFCONFIG=`which ifconfig 2> /dev/null`
>> +IFCONFIG=`which ip 2> /dev/null`
>> if [ -z "$IFCONFIG" ]; then
> 
>>        # Is it ever anywhere else?
>> -       IFCONFIG=/sbin/ifconfig
>> +       IFCONFIG=/sbin/ip
> 
> Is the "command" command a Bourne shell builtin? If so, using
> 
>    IFCONFIG=$(command -pv ip)
> 
> might be better? (same applies to the other, following instances)

this would be for another day. 

>> 
>> -POSSIBLE=`$IFCONFIG -a | grep '^tap' | awk '{print $1}' | sed s/://`
>> +POSSIBLE=`$IFCONFIG link | grep 'tap' | awk '{print $2}' | sed s/://`
>> TAP=""
>> LOCKFILE=""
>> for tap in $POSSIBLE; do
> 
> It does seem a little silly to continue to use a variable named
> IFCONFIG now that you're switching away from "ifconfig" :-)

ip would replace more commands there eventually, thats why I left the variable as it is
since eventually we want to replace all net-tools with iproute2 provides utilities.






More information about the Openembedded-core mailing list