Set up NFS Environment and Boot up Board

Document created by Rita Wang Employee on Jul 15, 2015Last modified by Rita Wang Employee on Jul 15, 2015
Version 3Show Document
  • View in full screen mode

Platform: Ubuntu 12.04

Board: Freescale MCIMX6Q-SDP  and  MCIMX-LVDS1 Screen

BSP: L3.0.35_4.1.0_ER_SOURCE_BSP

Other device: PC , One Router, 3 Network Cable and 2 usb-otg lines

The  platform is as follow:

平台搭建.jpg

 

Boot form NFS is very convenient in porting and debugging, and will value us much time. If the customers have modified the kernel and rebuild the kernel to generate the uImage running on board, he can directly download the uImage to the board by TFTP network. It is fast and can avoid the normal operation ,  first customers need to copy the images to the mfgtool specified directory and download the u-boot, uImage and file sytem again to the flash device in board, and then change to boot up mode to boot up the board. If customers are doing debug this operation will waste lot of time. So use the NFS is vey convenient. Beyond this, in the target board customers can also read the files and content in host machine. In a word, use NFS it will help save much time and also convenient. So the follows is introduce and show how to set NFS and then boot up the board.

1 Preparation

(1)Build the BSP

Build up the L3.0.35_4.1.0_ER_SOURCE_BSP use LTIB on the Ubuntu12.04, you can refer to our user guide document here no details. The u-boot, uImage and file system are all under the directory of litb. Boot up from NFS, so when build uImage some items are needed, here you can see the build details in the section of  Setting Target Linux Image to use NFS in this articel.

(2)Download the u-boot to the target board

Use the mfgtool Mfgtools-Rel-4.1.0_130816_MX6Q_UPDATER to download the u-boot to the SD card of MCIMX6Q-SDP board or use dd command to write the u-boot to SD card.( By the way, writing to the EMMC is also OK)

 

2 Setting the NFS Environment

Set host machine

1 - Install NFS Service on host typing:

   

$sudo apt-get install nfs-kernel-server

     

2 - Create symbolic link to ltib/rootfs

   

$sudo ln -s <ltib instalation folder>/rootfs /tftpboot/rootfs

     

3 - Setup exports typing:

   

$sudo gedit /etc/exports

     

and add the following line:

   

/tftpboot/rootfs/ *(rw,no_root_squash,no_subtree_check,async)

2export.PNG

 

4 - Restart the NFS server:

   

$sudo /etc/init.d/nfs-kernel-server restart

     

Now the host is ready to use NFS

 

 

Setting Target Linux Image to use NFS

     

1. Run LTIB configuration by typing:

$cd <ltib instalation folder>

     

$./ltib -c

     

2. On first page menu, go to "Target Image Generation -> Options"      

3. Select the option NFS only and exit LTIB configuration to compile with the new configuration.

1target image NFS ONLY.PNG

4. LTIB should start new compiling and create a new Linux image on /<ltib instalation folder>/rootfs/boot/uImage

    

5. Copy the created image on /<ltib instalation folder>/rootfs/boot/uImage to /tftpboot/uImage

3tftpboot.PNG

6. The system is ready to run with NFS. The root file system on target will be located on host on /<ltib instalation folder>/rootfs/

 

3 Setting the u-boot command line

(1)Download the u-boot to the target board fist according to the section 1 (2) Download the u-boot to the target board. Then give the power to the board, boot up board, u-boot boot up.

(2)Configuration the Network

Configure the Network and IP , to make the target board and the host machine IP are in the local area network of Router.

(3)Set the u-boot command line

As follow is my setting for you to refer to :

u-boot command.PNG

 

4 Boot up the board

Running the “run bootcmd” after setting the u-boot parameters then boot up the kernel and file system. We can see that the board download the uImage by the TFTP from host machine, then boot up the kernel and finally mount the NFS in the kernel. As follows is the details:

download and boot up.PNG

Downloading the uImage success and boot up kernel:

logoin.PNG

Input root and access the system.

 

Test: Create a new file in the host machine directory, you can see in the next picture:

host make dir atest.PNG

 

Then open the target board, in the terminal go to the same directory  in the unit_test we can see the same name. So as we can see in the above operation we can see it is very convenient and fast use the NFS. It will help save time and speed the development time.

 

target.PNG

Attachments

    Outcomes