回答

收藏

[原创] 搭建NFS网络文件系统

飞凌嵌入式 飞凌嵌入式 2502 人阅读 | 0 人回复 | 2014-01-22

本帖最后由 forlinx2013 于 2014-1-24 09:35 编辑

欢迎大家来到飞凌爱板网专区,对嵌入式技术感兴趣的朋友不妨多多关注一下,我们提供了公司所有开发板的所有资料,也会更新大量技术文章,欢迎大家一块学习提高!!!

搭建NFS网络文件系统
NFS (Network File System)是由Sun开发的一种在不同机器之间通过网络共享文件的
技术。在嵌入式Linux系统的开发调试阶段,可以利用该技术在主机上建立基于NFS
的根文件系统,挂载到嵌入式设备,可以很方便地修改根文件系统的内容。
根文件系统是Linux启动时使用的第一个文件系统。没有根文件系统,Linux将无法正
常启动。通过以上四讲我们已经把文件内核启动和一些简单的驱动做了实现,因为没有文件系统所以我们没法看到具体类似终端的操作。通过本讲就可以实现终端操作。
1、创建根文件系统的目录
1 mkdir rootfs  
2 cd rootfs  
3 mkdir bin dev etc lib proc sbin sys usr mnt tmp var  
4 mkdir usr/bin usr/lib usr/sbin lib/modules  

2、创建设备文件
5 cd dev/  
6 mknod -m 666 console c 5 1  
7 mknod -m 666 null c 1 3  
8 cd ..  
3、安装/etc         可以将飞凌的etc目录直接拷贝过来
9 tar etc.tar.gz C /xxx/rootfs  
4、编译内核模块  进入Linux内核目录(linux 3.3.5
10 make modules ARCH=arm  
11 CROSS_COMPILE=arm-linux-  
5、安装内核模块
12 make modules_install ARCH=arm  
13 INSTALL_MOD_PATH=/xxx/rootfs  
6busybox的配置和安装
下载最新的瑞士军刀busybox的官网http://www.busybox.net 的版本为busybox-1.20.0
修改busyboxmakefile
14 CROSS_COMPILE ?= arm-linux-  
15 ARCH ?= arm  
Make menuconfig配置busybox
file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps_clip_image-26714.png
file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps_clip_image-27587.png
file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps_clip_image-7529.png
7、编译、安装busybox
16 make  
17 make install  
到此整个基本的文件系统已经完成,下面将进行nfs的配置
######################################################################################################
关于如何修改ubootbootargs的内容请参考飞凌官方的文档里面讲的非常清楚了。
下面进行内核配置
       Networking support --->
file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps_clip_image-32394.png
File systems --->
    Network File Systems --->
file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps_clip_image-15322.png最后启动如下:
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP cubic registered
NET: Registered protocol family 15
lib80211: common routines for IEEE802.11 drivers
Registering the dns_resolver key type
VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
gpio-keys gpio-keys: failed to request GPIO 149, error -16
gpio-keys: probe of gpio-keys failed with error -16
s3c-rtc s3c64xx-rtc: setting system clock to 2000-04-25 16:17:57 UTC (956679477)
dm9000 dm9000.0: eth0: link down
IP-Config: Complete:
     device=eth0, addr=192.168.0.232, mask=255.255.255.0, gw=255.255.255.255,
     host=192.168.0.232, domain=, nis-domain=(none),
     bootserver=255.255.255.255, rootserver=192.168.0.231, rootpath=
dm9000 dm9000.0: eth0: link up, 100Mbps, full-duplex, lpa 0xC1E1
VFS: Mounted root (nfs filesystem) on device 0:10.
Freeing init memory: 152K
hwclock: can't open '/dev/rtc': No such file or directory
/etc/init.d/rcS: line 45: /bin/hotplug: not found
Try to bring eth0 interface up......NFS root ...Done

Laoyl
[root@Laoyl ~]#
到此内核移植到文件系统的启动已经结束



分享到:
回复

使用道具 举报

您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

站长推荐上一条 /3 下一条