mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-05 05:04:44 +02:00
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>
This commit is contained in:
parent
6321e1fe7a
commit
03566537a5
|
@ -45,6 +45,10 @@ else
|
|||
fi
|
||||
|
||||
|
||||
if [ -z "$OE_TAP_NAME" ]; then
|
||||
OE_TAP_NAME=tap
|
||||
fi
|
||||
|
||||
# check if COUNT is a number and >= 0
|
||||
if ! [ $COUNT -ge 0 ]; then
|
||||
echo "Error: Incorrect count: $COUNT"
|
||||
|
@ -64,7 +68,7 @@ if [ ! -x "$RUNQEMU_IFUP" ]; then
|
|||
fi
|
||||
|
||||
if interfaces=`ip tuntap list` 2>/dev/null; then
|
||||
interfaces=`echo "$interfaces" |cut -f1 -d:`
|
||||
interfaces=`echo "$interfaces" |cut -f1 -d: `
|
||||
else
|
||||
echo "Failed to call 'ip tuntap list'" >&2
|
||||
exit 1
|
||||
|
@ -83,7 +87,7 @@ fi
|
|||
|
||||
echo "Creating $COUNT tap devices for GID: $GID..."
|
||||
for ((index=0; index < $COUNT; index++)); do
|
||||
echo "Creating tap$index"
|
||||
echo "Creating $OE_TAP_NAME$index"
|
||||
if ! ifup=`$RUNQEMU_IFUP $GID 2>&1`; then
|
||||
echo "Error bringing up interface: $ifup"
|
||||
exit 1
|
||||
|
@ -95,7 +99,7 @@ echo "Note: that the tap devices be set as unmanaged in the"
|
|||
echo "Note: NetworkManager.conf file. Add the following lines to"
|
||||
echo "Note: /etc/NetworkManager/NetworkManager.conf"
|
||||
echo "[keyfile]"
|
||||
echo "unmanaged-devices=interface-name:tap*"
|
||||
echo "unmanaged-devices=interface-name:$OE_TAP_NAME*"
|
||||
|
||||
# The runqemu script will check for this file, and if it exists,
|
||||
# will use the existing bank of tap devices without creating
|
||||
|
|
Loading…
Reference in New Issue
Block a user