diff options
author | Scott Garman <scott.a.garman@intel.com> | 2010-10-03 21:16:24 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-07 19:55:50 +0100 |
commit | e70c8981f250ead9e025ecd27aef94b67d784fc6 (patch) | |
tree | 0644d5cfb98596f71e5cce7ff8f1e23508c4a4a2 /scripts/poky-qemu-internal | |
parent | 8532405c1d6b2184ca88922506b725110a1f7627 (diff) | |
download | poky-e70c8981f250ead9e025ecd27aef94b67d784fc6.tar.gz |
Allow running of multiple QEMU nfs instances
These changes allow multiple instances of the userspace NFS server
to run, when brought up by consecutive instances of the poky-qemu
control script.
This fixes [BUGID #393]
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Diffstat (limited to 'scripts/poky-qemu-internal')
-rwxr-xr-x | scripts/poky-qemu-internal | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/scripts/poky-qemu-internal b/scripts/poky-qemu-internal index 0ea38eef60..532b255da9 100755 --- a/scripts/poky-qemu-internal +++ b/scripts/poky-qemu-internal | |||
@@ -50,8 +50,9 @@ if [ -z "$QEMU_MEMORY" ]; then | |||
50 | 50 | ||
51 | fi | 51 | fi |
52 | 52 | ||
53 | # This flag file is created when poky-gen-tapdevs creates a bank of | 53 | # This file is created when poky-gen-tapdevs creates a bank of tap |
54 | # tap devices, indicating that the user does not have sudo privs. | 54 | # devices, indicating that the user should not bring up new ones using |
55 | # sudo. | ||
55 | NOSUDO_FLAG="/etc/poky-nosudo" | 56 | NOSUDO_FLAG="/etc/poky-nosudo" |
56 | 57 | ||
57 | QEMUIFUP=`which poky-qemu-ifup` | 58 | QEMUIFUP=`which poky-qemu-ifup` |
@@ -113,18 +114,17 @@ else | |||
113 | fi | 114 | fi |
114 | 115 | ||
115 | release_lock() { | 116 | release_lock() { |
116 | if [ "$LOCKFILE" = "" ]; then | 117 | if [ ! -e "$NOSUDO_FLAG" ]; then |
117 | $QEMUIFDOWN $TAP $POKY_NATIVE_SYSROOT | 118 | $QEMUIFDOWN $TAP $POKY_NATIVE_SYSROOT |
118 | else | ||
119 | echo "Releasing lockfile of preconfigured tap device '$TAP'" | ||
120 | lockfile-remove $LOCKFILE | ||
121 | fi | ||
122 | |||
123 | if [ "$NFSRUNNING" = "true" ]; then | ||
124 | echo "Shutting down the userspace NFS server:" | ||
125 | echo "poky-export-rootfs stop $ROOTFS" | ||
126 | poky-export-rootfs stop $ROOTFS | ||
127 | fi | 119 | fi |
120 | echo "Releasing lockfile of preconfigured tap device '$TAP'" | ||
121 | lockfile-remove $LOCKFILE | ||
122 | |||
123 | if [ "$NFSRUNNING" = "true" ]; then | ||
124 | echo "Shutting down the userspace NFS server..." | ||
125 | echo "poky-export-rootfs stop $ROOTFS" | ||
126 | poky-export-rootfs stop $ROOTFS | ||
127 | fi | ||
128 | } | 128 | } |
129 | 129 | ||
130 | n1=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ] | 130 | n1=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ] |
@@ -136,6 +136,9 @@ QEMU_NETWORK_CMD="-net nic,vlan=0 $QEMU_TAP_CMD" | |||
136 | KERNCMDLINE="mem=$QEMU_MEMORY" | 136 | KERNCMDLINE="mem=$QEMU_MEMORY" |
137 | QEMU_UI_OPTIONS="-show-cursor -usb -usbdevice wacom-tablet" | 137 | QEMU_UI_OPTIONS="-show-cursor -usb -usbdevice wacom-tablet" |
138 | 138 | ||
139 | NFS_INSTANCE=`echo $TAP | sed 's/tap//'` | ||
140 | export NFS_INSTANCE | ||
141 | |||
139 | SERIALOPTS="" | 142 | SERIALOPTS="" |
140 | if [ "x$SERIAL_LOGFILE" != "x" ]; then | 143 | if [ "x$SERIAL_LOGFILE" != "x" ]; then |
141 | SERIALOPTS="-serial file:$SERIAL_LOGFILE" | 144 | SERIALOPTS="-serial file:$SERIAL_LOGFILE" |
@@ -172,7 +175,9 @@ fi | |||
172 | if [ "$FSTYPE" = "nfs" ]; then | 175 | if [ "$FSTYPE" = "nfs" ]; then |
173 | NFS_SERVER="192.168.7.1" | 176 | NFS_SERVER="192.168.7.1" |
174 | NFS_DIR=`echo $ROOTFS | sed 's/^[^:]*:\(.*\)/\1/'` | 177 | NFS_DIR=`echo $ROOTFS | sed 's/^[^:]*:\(.*\)/\1/'` |
175 | UNFS_OPTS="nfsvers=2,mountprog=21111,nfsprog=11111,udp" | 178 | MOUNTD_PORT=$[ 21111 + $NFS_INSTANCE ] |
179 | NFSD_PORT=$[ 11111 + $NFS_INSTANCE ] | ||
180 | UNFS_OPTS="nfsvers=2,mountprog=$MOUNTD_PORT,nfsprog=$NFSD_PORT,udp" | ||
176 | 181 | ||
177 | PSEUDO_LOCALSTATEDIR=~/.poky-sdk/pseudo | 182 | PSEUDO_LOCALSTATEDIR=~/.poky-sdk/pseudo |
178 | export PSEUDO_LOCALSTATEDIR | 183 | export PSEUDO_LOCALSTATEDIR |