Browse Source

runqemu: work with tap device names that end with a colon

On Fedora systems (and likely others), ifconfig returns interface
names that end with a colon. Make sure we strip the colon off the
tap device name before using it.

This fixes [YOCTO #3028]

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Scott Garman 11 years ago
parent
commit
85ed217b60
2 changed files with 2 additions and 2 deletions
  1. 1 1
      scripts/runqemu-gen-tapdevs
  2. 1 1
      scripts/runqemu-internal

+ 1 - 1
scripts/runqemu-gen-tapdevs

@@ -70,7 +70,7 @@ if [ ! -x "$IFCONFIG" ]; then
 fi
 
 # Ensure we start with a clean slate
-for tap in `$IFCONFIG | grep ^tap | awk '{ print \$1 }'`; do
+for tap in `$IFCONFIG | grep ^tap | awk '{ print \$1 }' | sed s/://`; do
 	echo "Note: Destroying pre-existing tap interface $tap..."
 	$TUNCTL -d $tap
 done

+ 1 - 1
scripts/runqemu-internal

@@ -154,7 +154,7 @@ if [ ! -x "$IFCONFIG" ]; then
        exit 1
 fi
 
-POSSIBLE=`$IFCONFIG -a | grep '^tap' | awk '{print $1}'`
+POSSIBLE=`$IFCONFIG -a | grep '^tap' | awk '{print $1}' | sed s/://`
 TAP=""
 LOCKFILE=""
 for tap in $POSSIBLE; do