mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 01:40:07 +00:00
runqemu-gen-tapdevs: remove uid parameter
The uid parameter is no longer needed since ip tuntap is used internally. Remove it. Backward compatibility to 3 or 4 parameters is still supported. (From OE-Core rev: a11c87b0a13f81beea8a9f33ef8379c9d2593e59) 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:
committed by
Richard Purdie
parent
14dcde95ec
commit
6321e1fe7a
+18
-15
@@ -8,39 +8,42 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
#
|
#
|
||||||
|
|
||||||
uid=`id -u`
|
|
||||||
gid=`id -g`
|
gid=`id -g`
|
||||||
if [ -n "$SUDO_UID" ]; then
|
|
||||||
uid=$SUDO_UID
|
|
||||||
fi
|
|
||||||
if [ -n "$SUDO_GID" ]; then
|
if [ -n "$SUDO_GID" ]; then
|
||||||
gid=$SUDO_GID
|
gid=$SUDO_GID
|
||||||
fi
|
fi
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: sudo $0 <uid> <gid> <num>"
|
echo "Usage: sudo $0 <gid> <num>"
|
||||||
echo "Where <uid> is the numeric user id the tap devices will be owned by"
|
|
||||||
echo "Where <gid> is the numeric group id the tap devices will be owned by"
|
echo "Where <gid> is the numeric group id the tap devices will be owned by"
|
||||||
echo "<num> is the number of tap devices to create (0 to remove all)"
|
echo "<num> is the number of tap devices to create (0 to remove all)"
|
||||||
echo "For example:"
|
echo "For example:"
|
||||||
echo "$ bitbake qemu-helper-native"
|
echo "$ bitbake qemu-helper-native"
|
||||||
echo "$ sudo $0 $uid $gid 4"
|
echo "$ sudo $0 $gid 4"
|
||||||
echo ""
|
echo ""
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Allow passing 4 arguments for backward compatibility with warning
|
# Allow passing 4 arguments for backward compatibility with warning
|
||||||
if [ $# -eq 4 ]; then
|
if [ $# -gt 4 ]; then
|
||||||
echo "Warning: The <native-sysroot-basedir> parameter is no longer needed. Ignoring."
|
echo "Error: Incorrect number of arguments"
|
||||||
|
usage
|
||||||
fi
|
fi
|
||||||
if [ $# -lt 3 ] || [ $# -gt 4 ]; then
|
if [ $# -gt 3 ]; then
|
||||||
|
echo "Warning: Ignoring the <native-sysroot-basedir> parameter. It is no longer needed."
|
||||||
|
fi
|
||||||
|
if [ $# -gt 2 ]; then
|
||||||
|
echo "Warning: Ignoring the <uid> parameter. It is no longer needed."
|
||||||
|
GID=$2
|
||||||
|
COUNT=$3
|
||||||
|
elif [ $# -eq 2 ]; then
|
||||||
|
GID=$1
|
||||||
|
COUNT=$2
|
||||||
|
else
|
||||||
echo "Error: Incorrect number of arguments"
|
echo "Error: Incorrect number of arguments"
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TUID=$1
|
|
||||||
GID=$2
|
|
||||||
COUNT=$3
|
|
||||||
|
|
||||||
# check if COUNT is a number and >= 0
|
# check if COUNT is a number and >= 0
|
||||||
if ! [ $COUNT -ge 0 ]; then
|
if ! [ $COUNT -ge 0 ]; then
|
||||||
@@ -78,10 +81,10 @@ if [ $COUNT -eq 0 ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Creating $COUNT tap devices for UID: $TUID GID: $GID..."
|
echo "Creating $COUNT tap devices for GID: $GID..."
|
||||||
for ((index=0; index < $COUNT; index++)); do
|
for ((index=0; index < $COUNT; index++)); do
|
||||||
echo "Creating tap$index"
|
echo "Creating tap$index"
|
||||||
if ! ifup=`$RUNQEMU_IFUP $TUID $GID 2>&1`; then
|
if ! ifup=`$RUNQEMU_IFUP $GID 2>&1`; then
|
||||||
echo "Error bringing up interface: $ifup"
|
echo "Error bringing up interface: $ifup"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user