Use NFS server file as /usr file of a Imx6 device

256 views Asked by At

I am working with a imx6 device, I need to libraries which have size more than imx's empy memory. I am created a nfs server (/var/nfs/usr) on my desktop and I want to make the imx device doesn't use its own /usr file but use nfs server's /usr file on my desktop. Then, I have huge memory for necessary libraries which I need to run on my Imx device.

Is it possible? If yes, please guide me.

PS: please edit my question with better English.

2

There are 2 answers

0
thilinaur On

According to my knowladge if you are going for NFS, you have to put your entire root files system on NFS. Or else you can put your lib to SD card and load it from there. Another option is to move your entire root file system to SD from the device flash. All those boot methods are described in iMX6 Linux User Guide.

0
Brendan On

What you want to do is setup TFTP/NFS booting.

  1. Extract your rootfs to a location on your host machine

     sudo tar -xvf /dir/of/rootfs.tar.bz2 ~/nfs-rootfs
    
  2. Install nfs-kernel-server and enable through systemd (systemctl):

    sudo apt-get install nfs-kernel-server
    systemctl enable nfs-kernel-server
    systemctl start nfs-kernel-server
    
  3. Edit your /etc/exports file (using your favourite editor):

    sudo vi /etc/exports
    
  4. Add the following line to the file /home/user/nfs-rootfs *(rw,no_root_squash,async), exit and save the file.

  5. Update the nfs-server of the change made to the exports file:

    sudo exportfs -a
    
  6. Install the TFTP server, enable and start:

    sudo apt-get install tftpd-hpa
    systemctl enable tftpd-hpa
    systemctl start tftpd-hpa
    
  7. View or modify where the TFTP server will look for its files in /etc/default/tftpd-hpa. It should look something along the lines of:

    # /etc/default/tftpd-hpa
    
    TFTP_USERNAME="tftp"
    TFTP_DIRECTORY="/home/user/tftpboot"
    TFTP_ADDRESS=":69"
    TFTP_OPTIONS="--secure"
    
  8. Modify your firewall settings as required to enable connection between your host machine and your imx6 device.

  9. Place device tree (.dtb) and your bootloader (uImage or zImage) into the TFTP folder.

  10. Ensure that you have a serial connection to your imx6 device. Make modifications to your bootloader environment so that your device netboots.

A guide to TFTP/NFS booting can be found here: http://www.variwiki.com/index.php?title=Yocto_Setup_TFTP/NFS