diff options
author | Elizabeth Flanagan <elizabeth.flanagan@intel.com> | 2012-07-31 11:00:08 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-08-02 23:01:34 +0100 |
commit | dee07308c170afca44748aebab768f461e6208ac (patch) | |
tree | 3ba3d8e21736b1863b51eb55e5a1ec57ef154d3f /scripts/runqemu-gen-tapdevs | |
parent | c4a7517f8ae6e176a0b8e59b1176cf65bb45aa78 (diff) | |
download | poky-dee07308c170afca44748aebab768f461e6208ac.tar.gz |
runqemu-gen-tapdevs: add UID to CL options
runqemu-if* now requires UID as a command line option which means
runqemu-gen-tapdevs needs to take it as an option.
(From OE-Core rev: a624ec02c4acec83efbe66406f22abafbdce5d63)
Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu-gen-tapdevs')
-rwxr-xr-x | scripts/runqemu-gen-tapdevs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs index 15bccd4484..2c1ff0eefb 100755 --- a/scripts/runqemu-gen-tapdevs +++ b/scripts/runqemu-gen-tapdevs | |||
@@ -23,7 +23,8 @@ | |||
23 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 23 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
24 | 24 | ||
25 | usage() { | 25 | usage() { |
26 | echo "Usage: sudo $0 <gid> <num> <native-sysroot-basedir>" | 26 | echo "Usage: sudo $0 <uid> <gid> <num> <native-sysroot-basedir>" |
27 | echo "Where <uid> is the numeric user id the tap devices will be owned by" | ||
27 | echo "Where <gid> is the numeric group id the tap devices will be owned by" | 28 | echo "Where <gid> is the numeric group id the tap devices will be owned by" |
28 | echo "<num> is the number of tap devices to create (0 to remove all)" | 29 | echo "<num> is the number of tap devices to create (0 to remove all)" |
29 | echo "<native-sysroot-basedir> is the path to the build system's native sysroot" | 30 | echo "<native-sysroot-basedir> is the path to the build system's native sysroot" |
@@ -35,14 +36,15 @@ if [ $EUID -ne 0 ]; then | |||
35 | exit | 36 | exit |
36 | fi | 37 | fi |
37 | 38 | ||
38 | if [ $# -ne 3 ]; then | 39 | if [ $# -ne 4 ]; then |
39 | echo "Error: Incorrect number of arguments" | 40 | echo "Error: Incorrect number of arguments" |
40 | usage | 41 | usage |
41 | fi | 42 | fi |
42 | 43 | ||
43 | GID=$1 | 44 | TUID=$1 |
44 | COUNT=$2 | 45 | GID=$2 |
45 | SYSROOT=$3 | 46 | COUNT=$3 |
47 | SYSROOT=$4 | ||
46 | 48 | ||
47 | TUNCTL=$SYSROOT/usr/bin/tunctl | 49 | TUNCTL=$SYSROOT/usr/bin/tunctl |
48 | if [[ ! -x "$TUNCTL" || -d "$TUNCTL" ]]; then | 50 | if [[ ! -x "$TUNCTL" || -d "$TUNCTL" ]]; then |
@@ -73,10 +75,10 @@ for tap in `$IFCONFIG | grep ^tap | awk '{ print \$1 }'`; do | |||
73 | $TUNCTL -d $tap | 75 | $TUNCTL -d $tap |
74 | done | 76 | done |
75 | 77 | ||
76 | echo "Creating $COUNT tap devices for GID $GID..." | 78 | echo "Creating $COUNT tap devices for UID: $TUID GID: $GID..." |
77 | for ((index=0; index < $COUNT; index++)); do | 79 | for ((index=0; index < $COUNT; index++)); do |
78 | echo "Creating tap$index" | 80 | echo "Creating tap$index" |
79 | ifup=`$RUNQEMU_IFUP $GID $SYSROOT 2>&1` | 81 | ifup=`$RUNQEMU_IFUP $TUID $GID $SYSROOT 2>&1` |
80 | if [ $? -ne 0 ]; then | 82 | if [ $? -ne 0 ]; then |
81 | echo "Error running tunctl: $ifup" | 83 | echo "Error running tunctl: $ifup" |
82 | exit 1 | 84 | exit 1 |