diff options
Diffstat (limited to 'scripts/runqemu-gen-tapdevs')
| -rwxr-xr-x | scripts/runqemu-gen-tapdevs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs index 7f67ee5540..cbf8008929 100755 --- a/scripts/runqemu-gen-tapdevs +++ b/scripts/runqemu-gen-tapdevs | |||
| @@ -45,6 +45,10 @@ else | |||
| 45 | fi | 45 | fi |
| 46 | 46 | ||
| 47 | 47 | ||
| 48 | if [ -z "$OE_TAP_NAME" ]; then | ||
| 49 | OE_TAP_NAME=tap | ||
| 50 | fi | ||
| 51 | |||
| 48 | # check if COUNT is a number and >= 0 | 52 | # check if COUNT is a number and >= 0 |
| 49 | if ! [ $COUNT -ge 0 ]; then | 53 | if ! [ $COUNT -ge 0 ]; then |
| 50 | echo "Error: Incorrect count: $COUNT" | 54 | echo "Error: Incorrect count: $COUNT" |
| @@ -64,7 +68,7 @@ if [ ! -x "$RUNQEMU_IFUP" ]; then | |||
| 64 | fi | 68 | fi |
| 65 | 69 | ||
| 66 | if interfaces=`ip tuntap list` 2>/dev/null; then | 70 | if interfaces=`ip tuntap list` 2>/dev/null; then |
| 67 | interfaces=`echo "$interfaces" |cut -f1 -d:` | 71 | interfaces=`echo "$interfaces" |cut -f1 -d: ` |
| 68 | else | 72 | else |
| 69 | echo "Failed to call 'ip tuntap list'" >&2 | 73 | echo "Failed to call 'ip tuntap list'" >&2 |
| 70 | exit 1 | 74 | exit 1 |
| @@ -83,7 +87,7 @@ fi | |||
| 83 | 87 | ||
| 84 | echo "Creating $COUNT tap devices for GID: $GID..." | 88 | echo "Creating $COUNT tap devices for GID: $GID..." |
| 85 | for ((index=0; index < $COUNT; index++)); do | 89 | for ((index=0; index < $COUNT; index++)); do |
| 86 | echo "Creating tap$index" | 90 | echo "Creating $OE_TAP_NAME$index" |
| 87 | if ! ifup=`$RUNQEMU_IFUP $GID 2>&1`; then | 91 | if ! ifup=`$RUNQEMU_IFUP $GID 2>&1`; then |
| 88 | echo "Error bringing up interface: $ifup" | 92 | echo "Error bringing up interface: $ifup" |
| 89 | exit 1 | 93 | exit 1 |
| @@ -95,7 +99,7 @@ echo "Note: that the tap devices be set as unmanaged in the" | |||
| 95 | echo "Note: NetworkManager.conf file. Add the following lines to" | 99 | echo "Note: NetworkManager.conf file. Add the following lines to" |
| 96 | echo "Note: /etc/NetworkManager/NetworkManager.conf" | 100 | echo "Note: /etc/NetworkManager/NetworkManager.conf" |
| 97 | echo "[keyfile]" | 101 | echo "[keyfile]" |
| 98 | echo "unmanaged-devices=interface-name:tap*" | 102 | echo "unmanaged-devices=interface-name:$OE_TAP_NAME*" |
| 99 | 103 | ||
| 100 | # The runqemu script will check for this file, and if it exists, | 104 | # The runqemu script will check for this file, and if it exists, |
| 101 | # will use the existing bank of tap devices without creating | 105 | # will use the existing bank of tap devices without creating |
