1. install and configure NFS on the host (server)
Install NFS service software
$ Sudo apt-Get isntall nfs-kernel-Server
Modify the NFS configuration file/etc/exports
$ Sudo Emacs exports
Add the following line to the file:
/Srv * (RW, sync, no_root_squash, no_subtree_check)
/Srv is the file path you allow the client to access, * is the IP address or machine name of the client you allow (using * to indicate that all customers can access it ),() the parameters in are access control methods:
RO read-only access
RW read/write access
Sync all data written for sharing upon request
Async NFS can respond to requests before writing data
Secure NFS is sent through the secure TCP/IP ports below 1024
Insecure NFS is sent over port 1024
Wdelay if multiple users want to write data to the NFS Directory, group write (default)
No_wdelay if multiple users want to write data to the NFS Directory, write the data immediately. This setting is not required when async is used.
Hide does not share its subdirectories in the NFS shared directory.
No_hide shares the subdirectory of the NFS Directory
Subtree_check if sub-directories such as/usr/bin are shared, force NFS to check the permissions of the parent directory (default)
No_subtree_check is opposite to the above. The parent directory permission is not checked.
All_squash: The UID and gid of the shared file are mapped to the anonymous user anonymous, which is suitable for public directories.
No_all_squash retains the UID and gid of the shared file (default)
Root_squash all requests of the root user are mapped to the same permissions as those of the anonymous user (default)
The no_root_squas root user has full management access permissions to the root directory.
Anonuid = xxx specifies the UID of an anonymous user in the NFS server/etc/passwd file
Anongid = xxx specifies the GID of anonymous users in the NFS server/etc/passwd file
Start NFS service
$ Sudo/etc/init. d/Portmap restart
$ Sudo/etc/init. d/nfs-kernel-server restart
Test the NFS service
$ Showmount-e
Export list for user:
/Srv *
Now the NFS installation and configuration have been completed. In addition to mounting the root file system of Android, we can also use the following command to mount the shared file to a local disk:
$ Sudo Mount-t nfs localhostip:/srv/mnt/Disk
You can run the mount command to check whether the mounting is successful. Run the following command to uninstall the SDK:
$ Sudo umount/mnt
2. Create and create the android root file directory in/srv
$ Sudo mkdir NFS
$ Sudo mV/root_nfs/*/srv/nfs
For more information about how to create root_nfs, see the article http://zhougaofeng.ixiezi.com/2010/03/02/android%e7%9a%84%e6%96%87%e4%bb%b6%e7%b3%bb%e7%bb%9f%e7%bb%93%e6%9e%84%e5%8f%8a%e5%85%b6%e5%bc%95%e5%af%bc%e8%bf%87%e7%a8%8b/.
3. Set the U-boot and kernel command parameters.
> Setenv ipaddr 192.168.1.101
> Setenv serverip 192.168.1.100
> Setenv bootargs root =/dev/nfs rootfstype = NFS rsize = 1024, wsize = 1024 nfsroot =$ {serverip}:/srv/nfs/IP =$ {ipaddr }: $ {serverip }:: 255.255.255.0: eth0: On console = ttys0, 115200 init =/init Android Video = dovefb: lcd0: 1024x600-16 @ 60, lcd1: 1024x768-16 @ 60 clcd. lcd0_enable = 1 clcd. lcd1_enable = 0 pm_disable
> Saveenv
The IP address and nfsroot are determined based on your actual situation.
Okay, all work is done.