ARM開發板搭建NFS網絡文件系統方法
阿新 • • 發佈:2017-06-23
安裝 http ext 博客 主機 文件 oot ini first
前邊 已經提到過吧vmare的IP改成了靜態IP,對於上網來說,這個是個麻煩的事。現在重新配置Vmware的IP
VMware-Edit-Virtual network editor
選擇PC機的無線網卡(可以上網),name:VMnet0
2、VMware-VM-Setting-Network adapter
選擇custom-VMnet0
3、在ubuntu系統中編輯網絡:
選擇編輯連接,添加網絡命名無線連接:
如圖配置,然後就可以重現上網了。
配置虛擬機與ARM(am335x開發板)的NFS網絡文件共享方法:
安裝NFS服務器:sudo apt-get install nfs-kernel-server
配置NFS服務器:sudo gedit /etc/exports
# /etc/exports: the access control list for filesystems which may be exported # to NFS clients. See exports(5). # # Example for NFSv2 and NFSv3: # /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check) # # Example for NFSv4: # /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check) # /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check) # /home/zyr/Source_code/text/nfs 192.168.200.*(rw,sync,no_root_squash)
在最後加上自己共享目錄的路徑。
重啟服務器:
- sudo /etc/init.d/rpcbind restart
- sudo /etc/init.d/nfs-kernel-server restart
配置ARM(am335x開發板)板的IP,可以在/etc/init.d/rcS中直接配置:
# --------------------------------------------- # Mount thedefault file systems # --------------------------------------------- echo -n " Mounting other filesystems : " mount -a status $? 0 #######配置網絡################################ echo "config_network : " /sbin/ifconfig lo 127.0.0.1 netmask 255.0.0.0 /sbin/ifconfig eth0 192.168.200.70 /sbin/ifconfig eth0 netmask 255.255.255.0 /sbin/route add default gw 192.168.200.255 eth0 /sbin/ifconfig eth1 192.168.200.71 netmask 255.255.255.0 /sbin/route add default gw 192.168.200.255 eth1
重新配置VMare的網絡為有線連接1,如圖:
目的是主機IP靜態:192.168.200.123
最後將主機(虛擬機)目錄的/hmoe/zyr/Source_code/text/nfs 掛在開發板上還需要:
[[email protected] ]#mount -t nfs -o nolock 192.168.200.123:/home/zyr/Source_code/text/nfs /mnt [[email protected]-am335x ]#cd /mnt [[email protected]-am335x mnt]#ls led_test zyr-hello.ko [[email protected]-am335x mnt]#insmod zyr-hello.ko [ 5299.759382] misc-register led_core [[email protected]-am335x mnt]#./led_test Start led test. [ 5309.324907] GPIO LED set low. [ 5310.338522] GPIO LED set high. [ 5311.342169] GPIO LED set low. [ 5312.345413] GPIO LED set high.
NFS掛載結束,以後在內核中編寫驅動時再也不用SD卡插拔插拔插拔了,所有的所有只要敲敲命令就OK了。
參考:博客
http://jingyan.eeboard.com/article/75498
ARM開發板搭建NFS網絡文件系統方法