summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAdrian Freihofer <adrian.freihofer@gmail.com>2023-06-22 19:01:27 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-06-24 12:21:48 +0100
commit03566537a5a1f01bdc1a923ec41816d91ed8f6ab (patch)
tree8f57c3f2d8331b0154f4ba8ac9745cb0e6114107 /scripts
parent6321e1fe7ab25fef5300986fe5df35fdb6c28bd7 (diff)
downloadpoky-03566537a5a1f01bdc1a923ec41816d91ed8f6ab.tar.gz
runqemu-gen-tapdevs: configurable tap names
Feature: Hard-coding the interface names to tap* is not always a good idea. (From OE-Core rev: 739f20481d14a66b23d6195c3837f83d7370434a) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu-gen-tapdevs10
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
45fi 45fi
46 46
47 47
48if [ -z "$OE_TAP_NAME" ]; then
49 OE_TAP_NAME=tap
50fi
51
48# check if COUNT is a number and >= 0 52# check if COUNT is a number and >= 0
49if ! [ $COUNT -ge 0 ]; then 53if ! [ $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
64fi 68fi
65 69
66if interfaces=`ip tuntap list` 2>/dev/null; then 70if interfaces=`ip tuntap list` 2>/dev/null; then
67 interfaces=`echo "$interfaces" |cut -f1 -d:` 71 interfaces=`echo "$interfaces" |cut -f1 -d: `
68else 72else
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
84echo "Creating $COUNT tap devices for GID: $GID..." 88echo "Creating $COUNT tap devices for GID: $GID..."
85for ((index=0; index < $COUNT; index++)); do 89for ((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"
95echo "Note: NetworkManager.conf file. Add the following lines to" 99echo "Note: NetworkManager.conf file. Add the following lines to"
96echo "Note: /etc/NetworkManager/NetworkManager.conf" 100echo "Note: /etc/NetworkManager/NetworkManager.conf"
97echo "[keyfile]" 101echo "[keyfile]"
98echo "unmanaged-devices=interface-name:tap*" 102echo "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