]> code.ossystems Code Review - openembedded-core.git/commitdiff
runqemu-nfs: check for required programs
authorJoshua Lock <josh@linux.intel.com>
Fri, 3 Sep 2010 17:27:20 +0000 (18:27 +0100)
committerJoshua Lock <josh@linux.intel.com>
Tue, 7 Sep 2010 09:48:21 +0000 (10:48 +0100)
The unfs server requires either rpcbind or portmap to be installed and
running to start so check for their presence in the script.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
scripts/runqemu-nfs

index bccbc4c5c8f4b72d7c27c5360f25d16769c31243..79b41ca79abe8d5c923bf35feeca86e17d0ad86b 100755 (executable)
@@ -65,6 +65,23 @@ fi
 PSEUDO_LOCALSTATEDIR=~/.poky-sdk/pseudo
 export PSEUDO_LOCALSTATEDIR
 
+RPC=`which rpcbind`
+if [ "x$RPC" = "x" ]; then
+    RPC=`which portmap`
+    if [ "x$RPC" = "x" ]; then
+       echo "You need rpcbind or portmap installed and running to run the"
+       echo "userspace NFS server."
+       exit 1
+    fi
+fi
+
+rpcbind_running=`ps ax | grep rpcbind | wc -l`
+portmap_running=`ps ax | grep portbind | wc -l`
+if [ rpcbind_running == 1 -a portmap_running == 1 ]; then
+    echo "You need to be running either rpcbind or portmap to continue"
+    exit 1
+fi
+
 # Start the userspace NFS server
 echo "poky-export-rootfs restart $SDK_ROOTFS_DIR"
 poky-export-rootfs restart $SDK_ROOTFS_DIR