1.Ubuntu12.04搭建nfs服务器:
简要流程如下:
1).
sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-kernel-server restart
showmount -e
sudo mount -t nfslocalhost:/opt/EmbedSky/root_nfs /mnt
2).把根文件放到root_nfs目录下
2.设置好uboot启动的参数
##### Boot for SKY2416/TQ2416 Main Menu #####
##### EmbedSky USB download mode #####
[1] Download u-boot or STEPLDR.nb1 or otherbootloader to Nand Flash
[2] Download Eboot (eboot.nb0) to NandFlash
[3] Download Linux Kernel (zImage.bin) toNand Flash
[4] Download LOGO Picture (logo.bin) toNand Flash
[5] Download UBIFS image (root.ubi) to NandFlash
[6] Download YAFFS image (root.bin) to NandFlash
[7] Download Program to SDRAM and Run it
[8] Boot the system
[9] Format the Nand Flash
[0] Set the boot parameters
[a] Download User Program
[c] Choice lcd type.
[n] Enter TFTP download mode menu
[r] Reboot u-boot
[t] Test Linux Image (zImage)
Enter your selection: n
##### Boot for SKY2416/TQ2416 Main Menu #####
##### EmbedSky TFTP download mode #####
[1] Download u-boot.bin to Nand Flash
[2] Download Eboot (eboot.nb0) to NandFlash
[3] Download Linux Kernel (zImage.bin) toNand Flash
[4] Download LOGO Picture (logo.bin) toNand Flash
[5] Download UBIFS image (root.ubi) to NandFlash
[6] Download YAFFS image (root.bin) to NandFlash
[7] Download Program to SDRAM and Run it
[8] Boot the system
[9] Format the Nand Flash
[0] Set the boot parameters
[a] Download User Program
[c] Choice lcd type.
[n] Set TFTP parameters(PCIP,SKY2416/TQ2416 IP,Mask IP...)
[p] Test network (TQ2416 Ping PC's IP)
[r] Reboot u-boot
[s] Download STEPLDR.nb1 to Nand Flash
[t] Test Linux Image (zImage)
[q] Return main Menu
Enter your selection: 0
##### Parameter Menu #####
[1] Set NFS boot parameter
[2] Set Yaffs boot parameter for StandardLinux
[3] Set UBIfs boot parameter for StandardLinux
[4] Set parameter
[5] View the parameters
[d] Delete parameter
[s] Save the parameters to Nand Flash
[q] Return main Menu
Enter your selection: 1
Enter the PC IP address:(xxx.xxx.xxx.xxx)
192.168.2.152
Enter the SKY2416/TQ2416 IPaddress:(xxx.xxx.xxx.xxx)
192.168.2.167
Enter the Mask IP address:(xxx.xxx.xxx.xxx)
255.255.255.0
Enter NFS directory:(eg:/opt/EmbedSky/root_nfs)
/opt/EmbedSky/root_nfs
bootargs: noinitrd init=/linuxrcconsole=ttySAC0 root=/dev/nfs nfsroot=?:192.168.2.152ip=/opt/EmbedSky/root_nfs:192.168.2.167:192.168.2.152:192.168.2.167:www.embedsky.net:eth0:off
3.设置好linux内核的nfs参数
然后编辑.config,找到CONFIG_CMDLINE="",然后设置成
CONFIG_CMDLINE="root=/dev/nfsnfsroot=宿主机ip:nfs目录 ip=开发板iprw console=ttySAC0"
Eg:
root=/dev/nfs nfsroot=192.168.2.131:/opt/EmbedSky/root_nfs ip=192.168.2.167 rw console=ttySAC0
4.重启开发板,挂载根文件系统
系统启动过程中,串口输出如下:
asoc: uda134x-hifi <->s3c24xx-iis mapping ok
ALSA device list:
#0: S3C24XX_UDA134X
IPv4 over IPv4 tunneling driver
TCP cubic registered
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
lib80211: common routines forIEEE802.11 drivers
Registering the dns_resolver key type
s3c-rtc s3c2416-rtc: setting systemclock to 2000-01-01 04:04:38 UTC (946699478)
dm9000 dm9000: eth0: link down
ADDRCONF(NETDEV_UP): eth0: link is notready
ADDRCONF(NETDEV_CHANGE): eth0: linkbecomes ready
IP-Config:Complete:
device=eth0, addr=192.168.2.167,mask=255.255.255.0, gw=192.168.2.167,
host=www, domain=,nis-domain=embedsky.com,
bootserver=192.168.2.131,rootserver=192.168.2.131, rootpath=
dm9000dm9000: eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
VFS: Mounted root (nfs filesystem) on device 0:13.
Freeing init memory: 612K
[01/Jan/2000:04:04:49 +0000] boa:server version Boa/0.94.13
[01/Jan/2000:04:04:49 +0000] boa:server built Mar 31 2012 at 14:18:16.
[01/Jan/2000:04:04:49 +0000] boa:starting server pid=1236, port 80
Please press Enter to activate thisconsole.
[root@EmbedSky/]#
[root@EmbedSky/]# ls
bin home mnt root sys usr work
dev lib opt sbin tmp var
etc linuxrc proc sddisk udisk web
[root@EmbedSky/]#
[root@EmbedSky/]#