diff options
Diffstat (limited to 'scripts/runqemu-export-rootfs')
| -rwxr-xr-x | scripts/runqemu-export-rootfs | 53 |
1 files changed, 5 insertions, 48 deletions
diff --git a/scripts/runqemu-export-rootfs b/scripts/runqemu-export-rootfs index bbdaf5ba0f..2d879961d0 100755 --- a/scripts/runqemu-export-rootfs +++ b/scripts/runqemu-export-rootfs | |||
| @@ -88,8 +88,7 @@ MOUNT_PORT=$[ 3048 + 2 * $NFS_INSTANCE ] | |||
| 88 | 88 | ||
| 89 | ## For debugging you would additionally add | 89 | ## For debugging you would additionally add |
| 90 | ## --debug all | 90 | ## --debug all |
| 91 | MOUNTD_OPTS="--allow-non-root --mount-pid $MOUNTPID -f $EXPORTS --rmtab $RMTAB --prog $NFS_MOUNTPROG -r -P $MOUNT_PORT" | 91 | UNFSD_OPTS="-p -N -i $NFSPID -e $EXPORTS -x $NFS_NFSPROG -n $NFS_PORT -y $NFS_MOUNTPROG -m $MOUNT_PORT" |
| 92 | NFSD_OPTS="--allow-non-root --nfs-pid $NFSPID -f $EXPORTS --prog $NFS_NFSPROG -P $NFS_PORT -r" | ||
| 93 | 92 | ||
| 94 | # Setup the exports file | 93 | # Setup the exports file |
| 95 | if [ "$1" = "start" ]; then | 94 | if [ "$1" = "start" ]; then |
| @@ -115,53 +114,18 @@ case "$1" in | |||
| 115 | exit 1 | 114 | exit 1 |
| 116 | fi | 115 | fi |
| 117 | 116 | ||
| 118 | echo "Starting User Mode rpc.mountd" | ||
| 119 | echo " $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 | ||
| 121 | if [ ! $? = 0 ]; then | ||
| 122 | echo "=====================" | ||
| 123 | echo "Error starting MOUNTD" | ||
| 124 | echo "=====================" | ||
| 125 | if [ ! "x$RPCBIND_RUNNING" = "x" ] ; then | ||
| 126 | echo " If you see an error above that says:" | ||
| 127 | echo " RPC: Authentication error; why = Client credential too weak" | ||
| 128 | echo " You need to add the -i option when running rpcbind" | ||
| 129 | echo "===============================================" | ||
| 130 | echo "For recent Fedora/RedHat hosts:" | ||
| 131 | echo "Add RPCBIND_ARGS=-i to /etc/sysconfig/rpcbind" | ||
| 132 | echo " or" | ||
| 133 | echo "Add RPCBIND_OPTIONS=-i to /etc/sysconfig/rpcbind" | ||
| 134 | echo "Then run as root: /etc/init.d/rpcbind restart" | ||
| 135 | echo "===============================================" | ||
| 136 | echo "For recent Debian/Ubuntu hosts:" | ||
| 137 | echo "Add OPTIONS=\"-i -w\" to /etc/default/rpcbind" | ||
| 138 | echo "sudo service portmap restart" | ||
| 139 | fi | ||
| 140 | |||
| 141 | exit 1 | ||
| 142 | fi | ||
| 143 | |||
| 144 | echo "Starting User Mode nfsd" | 117 | echo "Starting User Mode nfsd" |
| 145 | echo " $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/rpc.nfsd $NFSD_OPTS" | 118 | echo " $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/unfsd $UNFSD_OPTS" |
| 146 | $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/rpc.nfsd $NFSD_OPTS | 119 | $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/unfsd $UNFSD_OPTS |
| 147 | if [ ! $? = 0 ]; then | 120 | if [ ! $? = 0 ]; then |
| 148 | echo "Error starting nfsd" | 121 | echo "Error starting nfsd" |
| 149 | exit 1 | 122 | exit 1 |
| 150 | fi | 123 | fi |
| 151 | # Check to make sure everything started ok. | 124 | Check to make sure everything started ok. |
| 152 | if [ ! -f $MOUNTPID ]; then | ||
| 153 | echo "rpc.mountd did not start correctly" | ||
| 154 | exit 1 | ||
| 155 | fi | ||
| 156 | if [ ! -f $NFSPID ]; then | 125 | if [ ! -f $NFSPID ]; then |
| 157 | echo "rpc.nfsd did not start correctly" | 126 | echo "rpc.nfsd did not start correctly" |
| 158 | exit 1 | 127 | exit 1 |
| 159 | fi | 128 | fi |
| 160 | ps -fp `cat $MOUNTPID` > /dev/null 2> /dev/null | ||
| 161 | if [ ! $? = 0 ]; then | ||
| 162 | echo "rpc.mountd did not start correctly" | ||
| 163 | exit 1 | ||
| 164 | fi | ||
| 165 | ps -fp `cat $NFSPID` > /dev/null 2> /dev/null | 129 | ps -fp `cat $NFSPID` > /dev/null 2> /dev/null |
| 166 | if [ ! $? = 0 ]; then | 130 | if [ ! $? = 0 ]; then |
| 167 | echo "rpc.nfsd did not start correctly" | 131 | echo "rpc.nfsd did not start correctly" |
| @@ -169,16 +133,9 @@ case "$1" in | |||
| 169 | fi | 133 | fi |
| 170 | echo " " | 134 | echo " " |
| 171 | echo "On your target please remember to add the following options for NFS" | 135 | echo "On your target please remember to add the following options for NFS" |
| 172 | echo "nfsroot=IP_ADDRESS:$NFS_EXPORT_DIR,nfsvers=2,mountprog=$NFS_MOUNTPROG,nfsprog=$NFS_NFSPROG,udp" | 136 | echo "nfsroot=IP_ADDRESS:$NFS_EXPORT_DIR,nfsvers=3,port=$NFSD_PORT,mountprog=$MOUNTD_RPCPORT,nfsprog=$NFSD_RPCPORT,udp,mountport=$MOUNTD_PORT" |
| 173 | ;; | 137 | ;; |
| 174 | stop) | 138 | stop) |
| 175 | if [ -f "$MOUNTPID" ]; then | ||
| 176 | echo "Stopping rpc.mountd" | ||
| 177 | kill `cat $MOUNTPID` | ||
| 178 | rm -f $MOUNTPID | ||
| 179 | else | ||
| 180 | echo "No PID file, not stopping rpc.mountd" | ||
| 181 | fi | ||
| 182 | if [ -f "$NFSPID" ]; then | 139 | if [ -f "$NFSPID" ]; then |
| 183 | echo "Stopping rpc.nfsd" | 140 | echo "Stopping rpc.nfsd" |
| 184 | kill `cat $NFSPID` | 141 | kill `cat $NFSPID` |
