From: http://blog.csdn.net/wlr_tang/article/details/6792387
[1] installing the NFS service on a PC
Sudo apt-Get install nfs-kernel-Server
Configure the NFS server and set the mounted directory to/nfs/rootfs.
Sudo VI/etc/exports
Add a line at the end of the exports file:
/Nfs/rootfs * (RW, sync, no_root_squash)
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:
/Nfs/rootfs *
Now the NFS installation and configuration have been completed.
[2] configure the kernel to support NFS. (Principle: 1. Configure the USB driver as a simulated Ethernet driver. 2. Cancel initial.
Ramfilesystem to enable the kernel to start from the NFS server)
Ensure that the android source code is successfully compiled once.
Go to the Linux kernel source code directory
CD Kernel
Make menuconfig
Remove the initial Ram filesystem option:
Generalsetup --->
[] Initial Ram filesystem and RAM disk (initramfs/initrd) suppor
Select the usbgadget driver as ethernetgadget:
Enter "/" to find the USB, and check the path of the USB Gadget to select the USB Gadget support.
--- USB Gadget support
<*> USB Gadget drivers (Ethernet gadget (with Fig supp)
Ethernet gadget (with CDC Ethernet Support)
[*] Rndis support
[3] Press the power key + return key to upgrade the kernel to your compiled NFS kernel uimage, and upgrade uboot to uboot. bin that can enter uboot mode.
[4] restart, press any key to enter uboot mode, and set Environment Variables
Setenv bootargs_nfs 'setenv bootargs $ {bootargs} IP = off root =/dev/nfs init =/init nfsroot = 192.168.1.10:/nfs/rootfs IP = 192.168.1.11 :::: usb0, v3, TCP'
Setenv bootargs_android 'setenv bootargs $ {bootargs }$ {bootargs_nfs} video = Tutorial: rgb24, XGA Video = Tutorial: rgb565, tutorial @ 60 di?primary =32 M androidboot. Console = tmxtyc0'
Saveenv
[5] restart. If you use VMWare, connect the USB device to VMware.
Note:
Because ubuntu has a network manager, when T3 is mounted to Ubuntu, It is simulated as a USB 0 Nic, and the Network Manager Automatically assigns an IP address to the USB 0 Nic, however, this IP address cannot be allocated to 192.168.1.11 configured for NFS. Therefore, we recommend that you uninstall the Ubuntu Network Manager and then manually set the Ubuntu IP address through/etc/Network/interfaces.
[1] How to uninstall the Ubuntu Network Manager:
Open the new software package manager and pull to the left to unmount all network-managers.
Network-Manager
Network-Manager-Dev
Network-Manager-gnome
[2] Set VMware to Nat to avoid IP conflicts on computers on the network.
First, let's take a look at the IP segment configured by vmwarenat. VMware is usually different for different users.
From this point, we can see that my VMware gateway is 192.168.0.1, so my virtual machine IP address should be set to 192.168.0. *, and the gateway should be set to 192.168.0.1, so that you can access the Internet through NAT. Please refer to step 3.
[3] You can manually set the IP address as follows:
VI/etc/Network/interfaces
Autolo
Ifacelo Inet loopback
Autoeth0
Ifaceeth0 Inet static
Address 192.168.0.115
Netmask 255.255.255.0
Gateway 192.168.0.1
Allow-hotplugusb0
Autousb0
Ifaceusb0 Inet static
Address 192.168.1.10
Netmask 255.255.255.0
Gateway 192.168.1.1
[4] add China Telecom DNS
VI/etc/resolv. conf
# Generated by NetworkManager
Domain ebensz.com
Search ebensz.com
Nameserver 192.168.1.5
Nameserver 202.96.128.86
Nameserver 202.96.128.68
Sudo/etc/init. d/networking restart
If you still cannot access the Internet or the network is disconnected, it may be that the network configuration of VMware is messy and you can restore the network configuration of VMware.
Click
[5] Create androidrootfs
Copy out \ target \ product \ imx51_bbg \ Root \ * to \ NFS \ rootfs
CP-dar out/target/product/imx51_bbg/root/*/nfs/rootfs
Copy out/target/product/imx51_bbg/system directory to/nfs/rootfs/
CP-dar out/target/product/imx51_bbg/system/nfs/rootfs/
Change the init. RC Script so that android can run on NFS.
Comment out all the mounts, because we do not need to start from the SD card or NAND.
# On FS
# Mount ext4 partitions
# Mount/system RW first to give the filesystem a chance to save acheckpoint
# Mount ext4/dev/block/mmcblk0p2/System
# Mount ext4/dev/block/mmcblk0p2/system Ro remount
# Mount ext4/dev/block/mmcblk0p5/Data nosuid nodev
# Mount ext4/dev/block/mmcblk0p6/cache nosuid nodev
# On Post-FS
# Once everything is setup, no need to modify/
# Mount rootfs/RO remount