Wind River Support Network

HomeDefectsLIN5-17398
Fixed

LIN5-17398 : Export multiple areas with userspace NFS does not work

Created: Apr 4, 2013    Updated: Mar 10, 2016
Resolved Date: Nov 30, 2013
Found In Version: 5.0.1
Fix Version: 5.0.1.3,Invalid Version
Severity: Standard
Applicable for: Wind River Linux 5
Component/s: Workbench Integration

Description

When using QEMU the userspace NFS server is used to export the root filesystem. Reading the man page for this server indicates that it is possible to export additional areas just like the kernel NFS server.

A customer has tried this at it would allow him to make other data and programs available to the qemu target without having to copy it to the export/dist area each time (doing a "make fs" always deletes everything in this directory before repopulating).

It would also allow data to be shared between multiple qemu instances.

However, it does not work.

Workaround

workaround1:
============
This workaround is suitable only for cases where only one "make start-target" running on the server.
1. Run "make config-target" and change as the following:
NFS0_MOUNTPROG=100005
NFS0_NFSPROG=100003

2. remove "-p" option from NFSD_OPTS:
$ diff scripts/user-nfs.sh.orig scripts/user-nfs.sh
71c71
< NFSD_OPTS="-p -N -i $NFSPID -e $EXPORTS -x $NFS_NFSPROG -n $NFS_PORT -y $NFS_MOUNTPROG -m $MOUNT_PORT "
---
> NFSD_OPTS="-N -i $NFSPID -e $EXPORTS -x $NFS_NFSPROG -n $NFS_PORT -y $NFS_MOUNTPROG -m $MOUNT_PORT "

3. Start target and mount with:
mount -t nfs -o \
nfsvers=3,port=3049,mountport=3048 \
10.0.2.2:/home/user /mnt


workaround 2:
============
This workaround is suitable only for cases where the developer has root or sudo access, so not applicable to every customer.

Use the host system kernel NFS server to export the desired area by editing /etc/exports.
Use the TUN/TAP interface for the QEMU network:

  $ make net-start TOPTS="-t"
  $ make start-target TOPTS="-t"

Once logged in, mount the area as before, but this time use the host IP address rather than the QEMU virtual network address.

  # mount -t nfs 192.168.200.1:/home/user /mnt

Steps to Reproduce

Configure and build a qemu project

  $ configure --enable-board=qemux86 --enable-kernel=standard --enable-rootfs=glibc_std
  $ make fs

Verify it works

  $ make start-target

After shutting down the target:

  $ make stop-target

Then edit the exports file:

  $ vi var/exports0

and add a line for some additional area, for example if you added a home area you would end up with this:

<projDir> (rw,no_root_squash,no_all_squash,insecure)
/home/user (rw,no_root_squash,no_all_squash,insecure)

Then start the target again and try to mount this extra area like this:

# mount -t nfs -o \
> nfsvers=3,mountprog=21111,nfsprog=11111,port=3049,mountport=3048,udp \
> 10.0.2.2:/home/user /mnt



The man page for the server indicates that this should work.

Other Downloads


Live chat
Online