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

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.

主站蜘蛛池模板: 安塞县| 旺苍县| 枣阳市| 湘西| 固阳县| 乐清市| 东海县| 镇赉县| 肃南| 嘉祥县| 辽阳县| 东城区| 珠海市| 女性| 济阳县| 河北省| 德昌县| 绥滨县| 会东县| 延川县| 洛川县| 湟源县| 本溪市| 宁远县| 襄城县| 陇南市| 新绛县| 河津市| 吴桥县| 全椒县| 通海县| 宁南县| 抚州市| 闻喜县| 阜新| 建昌县| 澄城县| 曲水县| 桂平市| 白银市| 承德市|