官术网_书友最值得收藏!

Configuring network booting for a development setup

Most professional i.MX6 boards will have an internal embedded MMC (eMMC) flash memory, and that would be the recommended way to boot firmware. The Wandboard is not really a product meant for professional use, so it does not have one. But neither the eMMC nor the microSD card are ideal for development work, as any system change would involve a reprogramming of the firmware image.

Getting ready

The ideal setup for development work is to use both TFTP and NFS servers in your host system and to only store the U-Boot bootloader in either the eMMC or a microSD card. With this setup, the bootloader will fetch the Linux kernel from the TFTP server and the kernel will mount the root filesystem from the NFS server. Changes to either the kernel or the root filesystem are available without the need to reprogram. Only bootloader development work would need you to reprogram the physical media.

Installing a TFTP server

If you are not already running a TFTP server, follow the next steps to install and configure a TFTP server on your Ubuntu 14.04 host:

$ sudo apt-get install tftpd-hpa

The tftpd-hpa configuration file is installed in /etc/default/tftpd-hpa. By default, it uses /var/lib/tftpboot as the root TFTP folder. Change the folder permissions to make it accessible to all users using the following command:

$ sudo chmod 1777 /var/lib/tftpboot

Now copy the Linux kernel and device tree from your build directory as follows:

$ cd /opt/yocto/fsl-community-bsp/wandboard- quad/tmp/deploy/images/wandboard-quad/
$ cp zImage-wandboard-quad.bin zImage-imx6q-wandboard.dtb /var/lib/tftpboot

Installing an NFS server

If you are not already running an NFS server, follow the next steps to install and configure one on your Ubuntu 14.04 host:

$ sudo apt-get install nfs-kernel-server

We will use the /nfsroot directory as the root for the NFS server, so we will "untar" the target's root filesystem from our Yocto build directory in there:

$ sudo mkdir /nfsroot
$ cd /nfsroot
$ sudo tar xvf /opt/yocto/fsl-community-bsp/wandboard- quad/tmp/deploy/images/wandboard-quad/core-image-minimal-wandboard- quad.tar.bz2

Next, we will configure the NFS server to export the /nfsroot folder:

/etc/exports:
/nfsroot/ *(rw,no_root_squash,async,no_subtree_check)

We will then restart the NFS server for the configuration changes to take effect:

$ sudo service nfs-kernel-server restart

How to do it...

Boot the Wandboard and stop at the U-Boot prompt by pressing any key on the serial console. Then run through the following steps:

  1. Get an IP address by DHCP:
    > dhcp
    

    Alternatively, you can configure a static IP address with:

    > setenv ipaddr <static_ip>
    
  2. Configure the IP address of your host system, where the TFTP and NFS servers have been set up:
    > setenv serverip <host_ip>
    
  3. Configure the root filesystem mount:
    > setenv nfsroot /nfsroot
    
  4. Configure the Linux kernel and device tree filenames:
    > setenv image zImage-wandboard-quad.bin
    > setenv fdt_file zImage-imx6q-wandboard.dtb
    
  5. If you have configured a static IP address, you need to disable DHCP on boot by running:
    > setenv ip_dyn no
    
  6. Save the U-Boot environment to the microSD card:
    > saveenv
    
  7. Perform a network boot:
    > run netboot
    

The Linux kernel and device tree will be fetched from the TFTP server, and the root filesystem will be mounted by the kernel from the NFS share after getting a DHCP address from your network (unless using static IP addresses).

You should be able to log in with the root user without a password prompt.

主站蜘蛛池模板: 蒙阴县| 宝坻区| 新闻| 邯郸县| 沙湾县| 磴口县| 龙江县| 岱山县| 漳州市| 赤壁市| 林州市| 邵武市| 辽中县| 马龙县| 诏安县| 遂平县| 宁夏| 元江| 辽宁省| 海南省| 米泉市| 霞浦县| 平湖市| 大埔县| 嘉峪关市| 驻马店市| 刚察县| 曲周县| 建德市| 佛冈县| 蒙自县| 玉树县| 凤台县| 合水县| 涪陵区| 滦平县| 资源县| 淮阳县| 葵青区| 南阳市| 武定县|