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

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.

主站蜘蛛池模板: 孙吴县| 永仁县| 澳门| 卓尼县| 广东省| 东海县| 洪泽县| 且末县| 长寿区| 鄱阳县| 平乡县| 开远市| 大悟县| 涞源县| 万年县| 三穗县| 亳州市| 红河县| 双城市| 合作市| 桦甸市| 雷波县| 闽侯县| 宝兴县| 资阳市| 白城市| 吴川市| 游戏| 莱芜市| 九寨沟县| 乐亭县| 兴山县| 广南县| 藁城市| 江源县| 虹口区| 南昌县| 古丈县| 洱源县| 偏关县| 巴林左旗|