This page describes how to configure the DT7837 as an NFS client and a development Linux host computer as an NFS server so that the contents of a directory on the Linux computer are visible on the DT7837 module.
Once mapped, you have local access on the DT7837 module to all files in the development computer's nfs exported subdirectory. This mapped file system is fully read-write by both devices. Any changes to the files in this tree by either the development computer or the DT78xx module are reflected immediately to the other end by NFS.
To set up NFS mounting, following these steps:
Notes:
You must be root, both in the development host computer and target DT78xx module, for the following steps to work.
Make sure of the IP address of the development host computer and netmask. The target DT78xx module must be in the same subnet as the development host computer.
References:
Mounting an NFS Volume in Section 14.2. Linux Network Administrators Guide
Linux NFS-HOWTO by Christopher Smith
Setting up an NFS Client Section 4. Linux NFS-HOWTO
On the Linux host computer, perform the following steps to set up the host computer as an NFS server:
Install the required packages by entering the following command:
# apt-get install nfs-kernel-server
Create an export file system by entering the following command. Note that in this example, the directory is named DT78XX-NFS but you can change it to a different name, if desired (remember to substitute your chosen name in all steps that follow!).
# mkdir -p /export/DT78XX-NFS
Make sure the permissions for the exported directory are 777 by entering this command:
# chmod 777 /export/DT78XX-NFS
Mount the directory that you want to map into the export file system using the following command. In this example, the DT78xx example directory under the TI SDK directory is mounted, and the TI SDK is installed under /opt/ti-sdk-am335x-evm-07.00.00.00:
# mount --bind /opt/ti-sdk-am335x-evm-07.00.00.00/example-applications/dt78xx-examples /export/DT78XX-NFS
Edit the file /etc/default/nfs-kernel-server (use these steps as an example of editing future files):
Open the file:
# vi /etc/default/nfs-kernel-server
Verify that following entry in the /etc/default/nfs-kernel-server directory is either blank or "no"
NEED_SVCGSSD="no"
Save the file.
Edit the file /etc/idmapd.conf, and ensure that the following lines are added to the file:
Nobody-User = nobody
Nobody-Group = nogroup
Edit the file /etc/exports, and add the following line to the file, substituting the correct netmask for the 1.2.3 placeholder below (and in all steps that follow):
/export/DT78XX-NFS 1.2.3.0/255.255.255.0(rw,sync,no_root_squash,no_subtree_check)
Restart the NFS server by entering the following command:
# /etc/init.d/nfs-kernel-server restart
Edit the file /etc/hosts, and add the following line to the file to allow the DT78xx module's IP address:
rcpbind mountd nfsd statd lockd rquotad : 1.2.3.0/255.255.255.0 127.0.0.1
Restart the NFS server a second time by entering this command:
# /etc/init.d/nfs-kernel-server restart
Edit the file /etc/fstab, and add the following line (note the two trailing zeroes) to the file so that the exported file system is mounted automatically on boot-up:
# DT78xx examples
mapped for NFS
/opt/ti-sdk-am335x-evm-07.00.00.00/example-applications/dt78xx-examples
/export/DT78XX-NFS none bind 0 0
Verify exports by entering this command
# showmount -e
At this point, the development Linux host computer is prepared to serve the contents of the /opt/ti-sdk-am335x-evm-07.00.00.00/example-applications/dt78xx-examples subdirectory to any NFS client in the same subnet as the host. The next task is to set up an NFS Client on the DT78xx module, described below.
On the DT78xx module, perform the following steps to set up the DT78xx module as an NFS client:
Install the NFS client by entering this command:
# apt-get install nfs-common
Make a mount point for the NFS drive mapped from the development computer by entering the following command (note that you can choose any directory name below):
# mkdir /usr/local/dt78xx-nfs
Mount the exported NFS drive using the following command. Note that the IP address 1.2.3.4 is the address of the Linux development host computer; substitute the correct IP address of the host computer for the 1.2.3.4 placeholder below and in all steps that follow:
# mount -t nfs 1.2.3.4:/export/DT78XX-NFS /usr/local/dt78xx-nfs
List the /usr/local/dt78xx-nfs directory using the following command. It should list the file system that exists in the Linux development host computer's exported directory ( /opt/ti-sdk-am335x-evm-07.00.00.00/example-applications/dt78xx-examples):
# ls -l /usr/local/dt78xx-nfs
(Optional) Edit the file /etc/fstab, and add the following line (note the two trailing zeroes) so that the mapped filesystem is mounted automatically on boot-up:
# nfs mount development
PC mapped directory
1.2.3.4:/export/DT78XX-NFS
/usr/local/dt78xx-nfs nfs rw,hard,intr 0 0