runqemu-gen-tapdevs: remove /etc/runqemu-nosudo when remove taps
It creats /etc/runqemu-nosudo when creats taps, so should remove it when remove taps. (From OE-Core rev: 3d4bf5b0ea581e3e9b388328b086d03f9174fd61) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
fad4caf84e
commit
fbb99b22f9
|
@ -69,32 +69,38 @@ if [ ! -x "$IFCONFIG" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ensure we start with a clean slate
|
if [ $COUNT -ge 0 ]; then
|
||||||
for tap in `$IFCONFIG link | grep tap | awk '{ print \$2 }' | sed s/://`; do
|
# Ensure we start with a clean slate
|
||||||
echo "Note: Destroying pre-existing tap interface $tap..."
|
for tap in `$IFCONFIG link | grep tap | awk '{ print \$2 }' | sed s/://`; do
|
||||||
$TUNCTL -d $tap
|
echo "Note: Destroying pre-existing tap interface $tap..."
|
||||||
done
|
$TUNCTL -d $tap
|
||||||
|
done
|
||||||
echo "Creating $COUNT tap devices for UID: $TUID GID: $GID..."
|
rm -f /etc/runqemu-nosudo
|
||||||
for ((index=0; index < $COUNT; index++)); do
|
else
|
||||||
echo "Creating tap$index"
|
echo "Error: Incorrect count: $COUNT"
|
||||||
ifup=`$RUNQEMU_IFUP $TUID $GID $SYSROOT 2>&1`
|
exit 1
|
||||||
if [ $? -ne 0 ]; then
|
fi
|
||||||
echo "Error running tunctl: $ifup"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ $COUNT -gt 0 ]; then
|
if [ $COUNT -gt 0 ]; then
|
||||||
|
echo "Creating $COUNT tap devices for UID: $TUID GID: $GID..."
|
||||||
|
for ((index=0; index < $COUNT; index++)); do
|
||||||
|
echo "Creating tap$index"
|
||||||
|
ifup=`$RUNQEMU_IFUP $TUID $GID $SYSROOT 2>&1`
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Error running tunctl: $ifup"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
echo "Note: For systems running NetworkManager, it's recommended"
|
echo "Note: For systems running NetworkManager, it's recommended"
|
||||||
echo "Note: that the tap devices be set as unmanaged in the"
|
echo "Note: that the tap devices be set as unmanaged in the"
|
||||||
echo "Note: NetworkManager.conf file. Add the following lines to"
|
echo "Note: NetworkManager.conf file. Add the following lines to"
|
||||||
echo "Note: /etc/NetworkManager/NetworkManager.conf"
|
echo "Note: /etc/NetworkManager/NetworkManager.conf"
|
||||||
echo "[keyfile]"
|
echo "[keyfile]"
|
||||||
echo "unmanaged-devices=interface-name:tap*"
|
echo "unmanaged-devices=interface-name:tap*"
|
||||||
fi
|
|
||||||
|
|
||||||
# The runqemu script will check for this file, and if it exists,
|
# The runqemu script will check for this file, and if it exists,
|
||||||
# will use the existing bank of tap devices without creating
|
# will use the existing bank of tap devices without creating
|
||||||
# additional ones via sudo.
|
# additional ones via sudo.
|
||||||
touch /etc/runqemu-nosudo
|
touch /etc/runqemu-nosudo
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue