summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorScott Garman <scott.a.garman@intel.com>2012-10-03 15:13:52 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-10-04 14:10:56 +0100
commit746a86758bccf5239e49db0a2f5fb71a53a2ebd5 (patch)
tree42ec23c63c8bd9001a39f96128931b7820417b15 /scripts
parentc435e4f9d2906d907510716b4800286aad9c8dfb (diff)
downloadpoky-746a86758bccf5239e49db0a2f5fb71a53a2ebd5.tar.gz
runqemu-export-rootfs: improve rpcbind error detection
mountd requires rpcbind or portmap. Check that one of these services is running before doing anything else, and report a user-friendly error when they are not found. (From OE-Core rev: 16d6ec51f4b976c9b86a8b6bf6251089df2d2732) Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu-export-rootfs33
1 files changed, 24 insertions, 9 deletions
diff --git a/scripts/runqemu-export-rootfs b/scripts/runqemu-export-rootfs
index ca79af340d..90edc8a216 100755
--- a/scripts/runqemu-export-rootfs
+++ b/scripts/runqemu-export-rootfs
@@ -100,6 +100,21 @@ fi
100# See how we were called. 100# See how we were called.
101case "$1" in 101case "$1" in
102 start) 102 start)
103 PORTMAP_RUNNING=`ps -ef | grep portmap | grep -v grep`
104 RPCBIND_RUNNING=`ps -ef | grep rpcbind | grep -v grep`
105 if [[ "x$PORTMAP_RUNNING" = "x" && "x$RPCBIND_RUNNING" = "x" ]]; then
106 echo "======================================================="
107 echo "Error: neither rpcbind nor portmap appear to be running"
108 echo "Please install and start one of these services first"
109 echo "======================================================="
110 echo "Tip: for recent Ubuntu hosts, run:"
111 echo " sudo apt-get install rpcbind"
112 echo "Then add OPTIONS=\"-i -w\" to /etc/default/rpcbind and run"
113 echo " sudo service portmap restart"
114
115 exit 1
116 fi
117
103 echo "Starting User Mode rpc.mountd" 118 echo "Starting User Mode rpc.mountd"
104 echo " $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/rpc.mountd $MOUNTD_OPTS" 119 echo " $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/rpc.mountd $MOUNTD_OPTS"
105 $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/rpc.mountd $MOUNTD_OPTS 120 $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/rpc.mountd $MOUNTD_OPTS
@@ -107,25 +122,25 @@ case "$1" in
107 echo "=====================" 122 echo "====================="
108 echo "Error starting MOUNTD" 123 echo "Error starting MOUNTD"
109 echo "=====================" 124 echo "====================="
110 ps -ef | grep -v grep | grep rpcbind 2>&1 > /dev/null 125 if [ ! "x$RPCBIND_RUNNING" = "x" ] ; then
111 if [ $? = 0 ] ; then
112 echo " If you see an error above that says:" 126 echo " If you see an error above that says:"
113 echo " RPC: Authentication error; why = Client credential too weak" 127 echo " RPC: Authentication error; why = Client credential too weak"
114 echo " You need to change the startup of rpcbind" 128 echo " You need to add the -i option when running rpcbind"
115 echo " on your host by doing the following as root:"
116 echo "===============================================" 129 echo "==============================================="
117 echo " According to /etc/sysconfig/rpcbind, then " 130 echo "For recent Fedora/RedHat hosts:"
118 echo " echo RPCBIND_ARGS=-i >> /etc/sysconfig/rpcbind" 131 echo "Add RPCBIND_ARGS=-i to /etc/sysconfig/rpcbind"
119 echo " or" 132 echo " or"
120 echo " echo RPCBIND_OPTIONS=-i >> /etc/sysconfig/rpcbind" 133 echo "Add RPCBIND_OPTIONS=-i to /etc/sysconfig/rpcbind"
121 echo " /etc/init.d/rpcbind restart" 134 echo "Then run as root: /etc/init.d/rpcbind restart"
122 echo "===============================================" 135 echo "==============================================="
123 echo "For Ubuntu 11.10 hosts" 136 echo "For recent Debian/Ubuntu hosts:"
124 echo "Add OPTIONS=\"-i -w\" to /etc/default/rpcbind" 137 echo "Add OPTIONS=\"-i -w\" to /etc/default/rpcbind"
125 echo "sudo service portmap restart" 138 echo "sudo service portmap restart"
126 fi 139 fi
140
127 exit 1 141 exit 1
128 fi 142 fi
143
129 echo "Starting User Mode nfsd" 144 echo "Starting User Mode nfsd"
130 echo " $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/rpc.nfsd $NFSD_OPTS" 145 echo " $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/rpc.nfsd $NFSD_OPTS"
131 $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/rpc.nfsd $NFSD_OPTS 146 $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/rpc.nfsd $NFSD_OPTS