we use the below IP address for nfs.
IP address for Host PC: 192.168.200.1
IP address for target board: 192.168.200.2
Steps:
1. target board side configuration:
1.1 make sure nfs configuration is enabled in configuration file.
File systems ---> Network File Systems
1.2 make sure network device is ok for the kernel.
for example, eth0
1.3 modify cmdline to support NFS booting:
the below is a example, we use /download/root as the nfs folder, and use eth0 as the link network device.
CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.200.1:/download/root ip=192.168.200.2:192.168.100.1::255.255.255.0::eth0:on console=ttyS0,115200"
1.4 build the kernel and flash it to target board.
2. Host PC side configuration:
2.1 add IP addr auto-config in /etc/network/interfaces:
auto eth0
iface eth0 inet static
address 192.168.200.1
netmask 255.255.255.0
network 192.168.0.0
2.2 add device info in /etc/hosts, like the last line:
192.168.200.2 phone
2.3 install nfs service:
apt-get install nfs-kernel-server nfs-common
2.4 add export directory(for example, /download/root) to NFS service by editing /etc/exports:
/download/root *(rw,no_root_squash,no_all_squash,sync,no_subtree_check)
2.5 copy your root files to /download/root.
2.6. check initial file in your root filles
for example, /etc/init.d/rcS, maybe also configure eth0 network device, we need set the configuration to 192.168.200.2 to keep the original configuration.
阅读(1118) | 评论(0) | 转发(0) |