This page describes how to verify PXE boot on Huawei D01 board.



General Guide

Steps:

  1. PXE boot is built upon DHCP and TFTP. So, to verify PXE, the first thing you need to do is to create and set up a TFTP server and DHCP server on your local network. In the description below, we suppose you have config:

    • TFTP root path is: /var/lib/tftpboot
    • DHCP default download filename is: grub2.efi
  2. Download default PXE related files from HiSilicon LT private git repository. https://hisilicon.git.linaro.org/gitweb?p=d01.git;a=tree;f=PXE;h=bf2e2af1a090cbdd8544c2653363de5d336d749f;hb=refs/heads/master. Files are in d01.git/PXE, listed here:

     ~d01.git/PXE$ tree .
    .
    ├── EFI-BOOT-pxe.fd
    ├── grub2.efi
    ├── grub.cfg
    └── README
  3. Create folder structure under your TFTP root path, and copy files into it like this:

    /var/lib/tftpboot$ tree .
    .
    ├── boot
    │   └── grub
    │       └── grub.cfg
    ├── grub2.efi
    ├── hip04-d01.dtb
    └── zImage
    • Note: zImage and hip04-d01.dtb are built according wiki page here.

  4. On D01 board. Upgrade UEFI to a version which can support PXE boot.
    • A version is attached here. EFI-BOOT-PXE-boot-sata.fd. Rename it to 'EFI-BOOT.fd' before flashing into the board.

    • Guide to flash UEFI to the board is here.

  5. When booting D01, enter into UEFI Shell, then input these commands in turn:

    a      //Boot Manager
    1      //Add Boot Device Entry
    3      //PXE on MAC Address:...
    PXE      //Description for this new Entry
    5      //Return to main menu
    2      //PXE
    These will enable the board to download 'grub2.efi' and launch it, then in 3 seconds, grub2 will download and boot linux.


Note: To set up a TFTP server on Ubuntu

Refer to these for a :

  1. http://importgeek.wordpress.com/2013/09/04/install-configure-and-test-tftp-server-in-ubuntu/

  2. http://www.cyberciti.biz/faq/install-configure-tftp-server-ubuntu-debian-howto/

For a simplified direction, try these steps:

  1. sudo apt-get install xinetd dhcp3-server tftpd-hpa
  2. sudo touch /etc/xinetd.d/tftp

edit:

service tftp
{
        protocol = udp
        port = 69
        socket_type = dgram
        wait = yes
        user = root
        server = /usr/sbin/in.tftpd
        server_args = -u nobody -s /var/lib/tftpboot
        disable = no
        cps = 100 2
        flags = IPv4
}
  1. sudo mkdir /var/lib/tftpboot
  2. sudo chmod -R 777 /var/lib/tftpboot/
  3. restart tftpd-hpa server.

service tftpd-hpa status
service tftpd-hpa stop
service tftpd-hpa start
service tftpd-hpa restart
service tftpd-hpa force-reload

Note: To set up a DHCP server on Ubuntu

Refer to these for a :

  1. https://help.ubuntu.com/community/isc-dhcp-server

For a simplified direction, try these steps:

  1. sudo apt-get install isc-dhcp-server
    • Edit /etc/dhcp/dhcpd.conf to suit your needs and particular configuration.
    • Edit /etc/default/isc-dhcp-server to specify the interfaces dhcpd should listen to. By default it listens to eth0.
    • Assign a static ip to the interface that you will use for dhcp.
  2. use these commands to start / check dhcp service

       sudo service isc-dhcp-server status
       sudo service isc-dhcp-server start
  3. modify your dhcpd.conf accordingly. Make sure filename is "grub2.efi". Here is an example:

    $ cat /etc/dhcp/dhcpd.conf
    # Sample /etc/dhcpd.conf
    # (add your comments here)
    default-lease-time 600;
    max-lease-time 7200;
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.0.255;
    option routers 192.168.0.1;
    option domain-name-servers 192.168.0.1;
    option domain-name "mydomain.example";
    subnet 192.168.0.0 netmask 255.255.255.0 {
            range 192.168.0.160 192.168.0.180;
            option subnet-mask 255.255.255.0;
            filename "grub2.efi";
    }
    #

Note: To set up a combined DHCP/TFTP server on Debian/Ubuntu

dnsmasq can do the job on both PXE/DHCP server and TFTP server in one config.

Note that you should be very careful setting up a DHCP server on your ethernet port as if you plug into any network whilst running it you can start overriding the DHCP already on the network and handing out useless addresses to other people's machines. This config is designed to only hand out 1 address. Ideally you would tie it to the MAC address of your board so no other machine could get wrong config.

  1. sudo apt-get install dnsmasq
  2. /etc/dnsmaq.conf should contain:

interface=eth0
dhcp-range=192.168.0.180,192.168.0.180,1m
dhcp-boot=grub.efi
enable-tftp
tftp-root=/srv/tftp

There are 1001 other config items but this is all you need.

Boards/D01/PXE (last modified 2015-05-01 21:38:59)