NFS Setup

Below are the steps required to setup the NFS server on the Host Machine.


Setting Up the NFS server

  1. Install the following packages
    
        $ sudo apt-get install nfs-kernel-server
      
  2. Added the path to the target sysroot directory to /etc/exports. Refer to Toolchain Directory Layout for information on the target sysroot directory.
    
        /opt/poky/1.3/sysroots/cpu_3xx-poky-linux-gnueabi  *(rw,sync,no_root_squash,no_subtree_check)
      
  3. After setting up /etc/exports, export the shares using the following command. You need to do this whenever /etc/exports is modified.
    
        $ sudo exportfs -ra
      
  4. Restart the NFS kernel server.
    
        $ sudo service nfs-kernel-server restart
      


Testing the NFS server

The NFS server can be tested by mouting the NFS share folder (created above) locally using the following command. It is assumed that we have a folder called /workspace. If the contents of /opt/poky/1.3_sdk/sysroots/cpu_3xx-poky-linux-gnueabi can be seen in /media after running the following command then the NFS server is working.

    $ sudo mount -t nfs localhost:/opt/poky/1.3_sdk/sysroots/cpu_3xx-poky-linux-gnueabi /media
Once tested unmount it using

    $ sudo umount localhost:/opt/poky/1.3_sdk/sysroots/cpu_3xx-poky-linux-gnueabi