Most of this article is based on others'ArticleWith some of my own changes, I use ubuntu9.10.
First, let me explain my basic configurations:
I connected my computer to the Development Board through a vro. The IP address of the computer is 192.168.1.167. the IP address of the Development Board is 192.168.1.230, the gateway is 192.168.1.1, And the subnet mask is 255.255.0.0. Both the Development Board and computer can access the Internet. A friend without a router can set the computer and the development board to the same network segment and subnet mask, the gateway is the same, the first three IP addresses are the same, the last section is different (for example, My above), and then connects the computer to the Development Board directly with a crossover network cable (not a common network cable), but cannot access the Internet (with a wireless network, configure the following wireless devices and access the Internet. In any case, the Development Board and the computer can ping each other ).
(Note * First press Sudo-I to enter the root permission)
1. Download and install necessary software:
Apt-Get install nfs-kernel-Server
2. Start Configuration:
First, configure the shared directory:
Vim/etc/exports
Enter the following content:
/Opt/friendlyarm/mini2440/root_qtopia * (RW, sync, no_root_squash)
"/Opt/friendlyarm/mini2440/root_qtopia" is the directory to be shared. "*" indicates that all IP addresses can be accessed, "RW" indicates that the user who has mounted the directory has the read and write permissions on the directory. no_root_squash indicates that if the user who has mounted the directory logs on with the root permission, it also has the root permission. (Note * I have not yet figured out why I can only use * when setting IP segments that can access this directory, instead of using many IP segment setting methods on the Internet, for example, 192.168.1. * If these IP segments are set, the following error occurs during mounting: Mount. NFS: Access denied by server while mounting XXXX: yyyyy permission prompt. In addition, it is worth noting that there is a space between the Directory and the "*" behind it. It took me nearly half an hour today because I didn't enter this space)
Then configure the access permission:
Vim/etc/hosts. Deny
Enter the following content:
Portmap: All
Lockd: All
MOUNTD: All
Rquotad: All
STATD: All
Save and exit (all IP addresses are disabled here)
Vim/etc/hosts. Allow
Enter the following content:
Portmap :*
Lockd :*
Rquotad :*
MOUNTD :*
STATD :*
Save and exit
(Please note that someone on the internet says "192.168.1. "instead of" * ", but I can't use it for a long time. I can only open it all, but it is not safe. You can do it yourself)
Then, change the permission of the directory you want to share to 777 (I am lazy, I didn't calculate it, it's not very good, you can calculate it yourself). The command is as follows:
Chomod-r 777/opt/friendlyarm/mini2440/root_qtopia
By now, everything to be configured is complete. Then start and verify the service.
Run the following command:
/Etc/init. d/Portmap start
/Etc/init. d/nfs-kernel-Server start
If the running result is as follows:
#/Etc/init. d/Portmap start
Rather than invoking init scripts through/etc/init. d, use the service (8)
Utility, e.g. Service Portmap start
Since the script you are attempting to invoke has been converted to
Upstart job, you may also use the START (8) utility, e.g. Start Portmap
#/Etc/init. d/nfs-kernel-Server start
* Exporting directories for NFS kernel daemon...
Exportfs:/etc/exports [3]: Neither 'subtree _ check' or 'no _ subtree_check 'specified for export "*:/opt/friendlyarm/mini2440/root_qtopia ". assuming default behaviour ('no _ subtree_check ').
Note: This default has changed since nfs-utils version 1.0.x
[OK]
* Starting NFS kernel daemon [OK]
Run the following command to test whether the shared directory exists:
Showmount-e
If a result similar to the following is displayed, the shared directory configuration is successful.
# Showmount-e
Export list for VRS-LAPTOP:
/Opt/friendlyarm/mini2440/root_qtopia *
If such a result is displayed, the following steps are successful:
Run the mount command to mount the directory on your computer.
# Mount-t nfs localhost:/opt/friendlyarm/mini2440/root_qtopia // MNT/
# Ls/mnt/
Bin etc lib MNT proc sbin test_nfs USR WWW
Dev home linuxrc opt root sys TMP VaR
Are you excited? This result indicates that the previous painstaking efforts are not vain. If you do what I said and there is a problem, please do not blame me, because the differences in Linux systems are too great, everyone is different. So please be patient and go to Google search (Chinese websites and foreign websites have a lot of solutions to this problem, and we recommend that you go to foreign websites, although it is in English, the steps for solving the problem are detailed and explained in patience and detail)
After completing the above configuration, connect to the Development Board, then enable minicom, power on the Development Board, start from NAND Flash, and in the flash of power-on or reset (this is officially given by the friendly arm, this is not the case, but it roughly means that it is very junk. Sometimes it is difficult to reset your hands several times.) press any key on the Development Board, go to supervivi mode, press the "Q" key, and in supervivi command line mode, enter:
Param set kernel "console = ttysac0 root =/dev/nfs nfsroot = 192.168.1.167:/opt/friendlyarm/mini2440/latest IP = 192.168.1.230: 192.168.1.167: 192.168.1.167: 255.255.255.0: VRS: eth0: off"
The meaning of this command is broken down as follows:
(1) "Param set linux_cmd_line" sets the Linux Command Line;
(2) Set "console = ttysac0" to ttysac0;
(3) the root directory of "root =/dev/nfs" is/dev/NFS.
(4) "nfsroot = 192.168.1.167:/opt/friendlyarm/mini2440/root_qtopia" the NFS service directory is IP Address "172.16.19.132"
"/Opt/friendlyarm/mini2440/root_qtopia" directory under the host
(5) "IP = 192.168.1.230: 192.168.1.167: 192.168.1.167: 255.255.255.0" the IP address of the Development Board is 192.168.1.230, And the IP address of the host is
192.168.1.167: the gateway and subnet mask of the Development Board and host are 192.168.1.167 and 255.255.255.0, respectively.
(6) The host name of the "sbc2440.arm9.net" host (that is, the host name of the PC). It doesn't matter. You can write anything.
(7) network device of the "eth0" Development Board (that is, the selected Nic)
(8) "off" As for this off, I haven't figured out what to close yet. I hope the expert can give me some advice.
The above explanation is my own understanding, which is not officially stated. If my understanding is incorrect, please correct it on the message board.
After entering the command, press enter and enter boot to start the development board from the NFS directory on the host.
Supervivi> boot
Copy Linux kernel from 0x00060000 to 0x30008000, size = 0x00500000... Done
Zimage magic = 0x016f2818
Setup Linux parameters at 0x30000100
Linux Command Line is: "console = ttysac0 root =/dev/nfs nfsroot = 172.16.19.132:/OP"
Machine Type = 1999
Now, booting LINUX ......
Now, NFS configuration is complete. In future development, you can directly start the development board from NFS, write on the host, compileProgram, And then run it directly under the Development Board for verification, instead of downloading the program to the Development Board in other ways, and the modifications made to the system under the Development Board are permanent, it won't be because the Development Board is restarted, power loss, or other loss of things, which is very good for the development of larger projects.
Original article: http://www.sxlongda.com/sbw3/20100811/5996.htm