summaryrefslogtreecommitdiff
path: root/scripts/runqemu-export-rootfs
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/runqemu-export-rootfs')
-rwxr-xr-xscripts/runqemu-export-rootfs74
1 files changed, 14 insertions, 60 deletions
diff --git a/scripts/runqemu-export-rootfs b/scripts/runqemu-export-rootfs
index bbdaf5ba0f..c7992d8223 100755
--- a/scripts/runqemu-export-rootfs
+++ b/scripts/runqemu-export-rootfs
@@ -44,10 +44,10 @@ if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
echo "Did you forget to source your build environment setup script?"
exit 1
fi
-. $SYSROOT_SETUP_SCRIPT
+. $SYSROOT_SETUP_SCRIPT meta-ide-support
-if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/sbin/rpc.mountd" ]; then
- echo "Error: Unable to find rpc.mountd binary in $OECORE_NATIVE_SYSROOT/usr/sbin/"
+if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/unfsd" ]; then
+ echo "Error: Unable to find unfsd binary in $OECORE_NATIVE_SYSROOT/usr/bin/"
if [ "x$OECORE_DISTRO_VERSION" = "x" ]; then
echo "Have you run 'bitbake meta-ide-support'?"
@@ -78,24 +78,17 @@ if [ ! -d "$PSEUDO_LOCALSTATEDIR" ]; then
fi
# rpc.mountd RPC port
-NFS_MOUNTPROG=$[ 21111 + $NFS_INSTANCE ]
+MOUNTD_RPCPORT=${MOUNTD_RPCPORT:=$[ 21111 + $NFS_INSTANCE ]}
# rpc.nfsd RPC port
-NFS_NFSPROG=$[ 11111 + $NFS_INSTANCE ]
-# NFS port number
-NFS_PORT=$[ 3049 + 2 * $NFS_INSTANCE ]
+NFSD_RPCPORT=${NFSD_RPCPORT:=$[ 11111 + $NFS_INSTANCE ]}
+# NFS server port number
+NFSD_PORT=${NFSD_PORT:=$[ 3049 + 2 * $NFS_INSTANCE ]}
# mountd port number
-MOUNT_PORT=$[ 3048 + 2 * $NFS_INSTANCE ]
+MOUNTD_PORT=${MOUNTD_PORT:=$[ 3048 + 2 * $NFS_INSTANCE ]}
## For debugging you would additionally add
## --debug all
-MOUNTD_OPTS="--allow-non-root --mount-pid $MOUNTPID -f $EXPORTS --rmtab $RMTAB --prog $NFS_MOUNTPROG -r -P $MOUNT_PORT"
-NFSD_OPTS="--allow-non-root --nfs-pid $NFSPID -f $EXPORTS --prog $NFS_NFSPROG -P $NFS_PORT -r"
-
-# Setup the exports file
-if [ "$1" = "start" ]; then
- echo "Creating exports file..."
- echo "$NFS_EXPORT_DIR (rw,async,no_root_squash,no_all_squash,insecure)" > $EXPORTS
-fi
+UNFSD_OPTS="-p -N -i $NFSPID -e $EXPORTS -x $NFSD_RPCPORT -n $NFSD_PORT -y $MOUNTD_RPCPORT -m $MOUNTD_PORT"
# See how we were called.
case "$1" in
@@ -115,53 +108,21 @@ case "$1" in
exit 1
fi
- echo "Starting User Mode rpc.mountd"
- echo " $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/rpc.mountd $MOUNTD_OPTS"
- $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/rpc.mountd $MOUNTD_OPTS
- if [ ! $? = 0 ]; then
- echo "====================="
- echo "Error starting MOUNTD"
- echo "====================="
- if [ ! "x$RPCBIND_RUNNING" = "x" ] ; then
- echo " If you see an error above that says:"
- echo " RPC: Authentication error; why = Client credential too weak"
- echo " You need to add the -i option when running rpcbind"
- echo "==============================================="
- echo "For recent Fedora/RedHat hosts:"
- echo "Add RPCBIND_ARGS=-i to /etc/sysconfig/rpcbind"
- echo " or"
- echo "Add RPCBIND_OPTIONS=-i to /etc/sysconfig/rpcbind"
- echo "Then run as root: /etc/init.d/rpcbind restart"
- echo "==============================================="
- echo "For recent Debian/Ubuntu hosts:"
- echo "Add OPTIONS=\"-i -w\" to /etc/default/rpcbind"
- echo "sudo service portmap restart"
- fi
-
- exit 1
- fi
+ echo "Creating exports file..."
+ echo "$NFS_EXPORT_DIR (rw,no_root_squash,no_all_squash,insecure)" > $EXPORTS
echo "Starting User Mode nfsd"
- echo " $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/rpc.nfsd $NFSD_OPTS"
- $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/rpc.nfsd $NFSD_OPTS
+ echo " $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/bin/unfsd $UNFSD_OPTS"
+ $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/bin/unfsd $UNFSD_OPTS
if [ ! $? = 0 ]; then
echo "Error starting nfsd"
exit 1
fi
# Check to make sure everything started ok.
- if [ ! -f $MOUNTPID ]; then
- echo "rpc.mountd did not start correctly"
- exit 1
- fi
if [ ! -f $NFSPID ]; then
echo "rpc.nfsd did not start correctly"
exit 1
fi
- ps -fp `cat $MOUNTPID` > /dev/null 2> /dev/null
- if [ ! $? = 0 ]; then
- echo "rpc.mountd did not start correctly"
- exit 1
- fi
ps -fp `cat $NFSPID` > /dev/null 2> /dev/null
if [ ! $? = 0 ]; then
echo "rpc.nfsd did not start correctly"
@@ -169,16 +130,9 @@ case "$1" in
fi
echo " "
echo "On your target please remember to add the following options for NFS"
- echo "nfsroot=IP_ADDRESS:$NFS_EXPORT_DIR,nfsvers=2,mountprog=$NFS_MOUNTPROG,nfsprog=$NFS_NFSPROG,udp"
+ echo "nfsroot=IP_ADDRESS:$NFS_EXPORT_DIR,nfsvers=3,port=$NFSD_PORT,mountprog=$MOUNTD_RPCPORT,nfsprog=$NFSD_RPCPORT,udp,mountport=$MOUNTD_PORT"
;;
stop)
- if [ -f "$MOUNTPID" ]; then
- echo "Stopping rpc.mountd"
- kill `cat $MOUNTPID`
- rm -f $MOUNTPID
- else
- echo "No PID file, not stopping rpc.mountd"
- fi
if [ -f "$NFSPID" ]; then
echo "Stopping rpc.nfsd"
kill `cat $NFSPID`