zoukankan      html  css  js  c++  java
  • ARM开发板搭建NFS网络文件共享方法

    前边 已经提到过吧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)

    在最后加上自己共享目录的路径。

    重启服务器:

    1. sudo /etc/init.d/portmap start
    2. sudo /etc/init.d/nfs-kernel-server start
    3. 若是找不到portmap有可能ubuntu是64位的没有这个东东(自己猜的),需要重启这个命令(sudo /etc/init.d/rpcbind restart),再打开步骤2就ok了。

    配置ARM(am335x开发板)板的IP,可以在/etc/init.d/rcS中直接配置:

    #   ---------------------------------------------
    #   Mount the default 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 挂在开发板上还需要:

    [root@zyr-am335x ]#mount -t nfs -o nolock 192.168.200.123:/home/zyr/Source_code/text/nfs /mnt
    [root@zyr-am335x ]#cd /mnt
    [root@zyr-am335x mnt]#ls
    led_test      zyr-hello.ko
    [root@zyr-am335x mnt]#insmod zyr-hello.ko
    [ 5299.759382] misc-register led_core
    [root@zyr-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

    后续:当PC机与开发板都断电后,如果下次还需要重新共享PC机的文件,要对PC机进行一下配置:

    1、根据之前的配置,custom---VMnet,网络编辑选择有线连接1

    2、开启nfs服务,终端输入:

    sudo /etc/init.d/portmap start
     sudo /etc/init.d/nfs-kernel-server start

    3、ping开发板:ping 192.168.200.70(可以ping通的)

    4、挂载:

    [root@zyr-am335x ]#mount -t nfs -o nolock 192.168.200.123:/home/zyr/Source_code/
    
    text/nfs /mnt
    [root@zyr-am335x ]#ls
    123           fisl.sh       mnt           self1.tar.gz  var
    bin           home          proc          self2.tar.gz
    boot          lib           root          sys
    dev           linuxrc       sbin          tmp
    etc           lost+found    self.tar.gz   usr
    [root@zyr-am335x ]#cd mnt/
    [root@zyr-am335x mnt]#ls
    led_test      zyr-hello.ko
    [root@zyr-am335x mnt]#
  • 相关阅读:
    GNU make manual 翻译(九十九)
    GNU make manual 翻译( 九十五)
    Shell的 for 循环小例子
    makefile中对目录遍历的小例子
    GNU make manual 翻译(九十三)
    GNU make manual 翻译( 一百)
    GNU make manual 翻译( 九十七)
    GNU make manual 翻译( 九十八)
    mapserver4.8.3 的readme.win32的中文翻译文件
    遥控器编程
  • 原文地址:https://www.cnblogs.com/BigOBlue/p/7071353.html
Copyright © 2011-2022 走看看