2016年10月27日 星期四

PXE boot

PXE boot will download images as well as their configs, while tftp boot only download assigned image.

Preboot Execution Environment - Wikipedia
https://en.wikipedia.org/wiki/Preboot_Execution_Environment

After parsing a PXE enabled DHCP server DHCPOFFER, the client will be able to set its own network IP address, IP Mask, etc., and to point to the network located booting resources, based on the received TFTP Server IP address and the name of the NBP. The client next transfers the NBP into its own random-access memory (RAM) using TFTP, possibly verifies it (i.e. UEFI Secure Boot), and finally boots from it. NBPs are just the first link in the boot chain process and they generally request via TFTP a small set of complementary files in order to get running a minimalistic OS executive (i.e. WindowsPE, or a basic Linux kernel+initrd). The small OS executive loads its own network drivers and TCP/IP stack. At this point, the remaining instructions required to boot or install a full OS are provided not over TFTP, but using a robust transfer protocol (such as HTTP, CIFS, or NFS).
Ubuntu Netboot Images
http://cdimage.ubuntu.com/netboot/

Installation/Netboot - Community Help Wiki
https://help.ubuntu.com/community/Installation/Netboot#Set_Up_DHCP-BOOT
(Use DNSMASQ)

Ubuntu 14.04 LTS (Trusty Tahr) Netboot
http://cdimage.ubuntu.com/netboot/14.04/

Installation Guide for Ubuntu 14.04
https://help.ubuntu.com/14.04/installation-guide/

Ubuntu Installation Guide
https://help.ubuntu.com/14.04/installation-guide/amd64/install.en.txt

PXEInstallServer - Community Help Wiki
https://help.ubuntu.com/community/PXEInstallServer
(Use isc-dhcp-server)

tftpd-hpa + isc-dhcp-server + netboot.tar.gz
Dell PowerEdge R430, Ubuntu 14.04, 4.4, AMD64,
Cavium ThunderX, Ubuntu14.04, 4.2, ARM64

  1. Install the required services. Download and decompress the netboot.tgz to TFTP server directory.
    apt-get install tftpd-hpa isc-dhcp-server
    cd /var/lib/tftpboot
    tar xf netboot.tar.gz
  2. tftpd-hpa doesn't support symbolic link, but AMD64 netboot.tar.gz contains some links.
    ./ubuntu-installer/amd64/pxelinux.cfg/default -> ../boot-screens/syslinux.cfg
    ./pxelinux.0 -> ubuntu-installer/amd64/pxelinux.0
    ./pxelinux.cfg -> ubuntu-installer/amd64/pxelinux.cfg
    This result in "could not find image...". So I have the DHCP next file parameter to be the "ubuntu-installer/amd64/pxelinux.0" instead of "pxelinux.0", and make ./ubuntu-installer/amd64/pxelinux.cfg/default a real file by copy(or hard link) the linked file.
  3. (Only on R430, not on ThundeX)
    During booting, the screen shows:
    TFTP prefix: ubuntu-installer/amd64
    All the path in the config files should be changed to relative to ubuntu-installer/amd64/, or the bootloader will not be able to boot the installation procedure.
    $ sudo sed -e 's/ubuntu-installer\/amd64\///g' * -i
  4. /etc/dhcp/dhcpd.conf
    subnet 192.168.1.0 netmask 255.255.255.0 {
      range 192.168.1.10 192.168.1.15;
      option broadcast-address 192.168.1.255;
      option routers 192.168.1.1;             # our router
      option domain-name-servers 168.95.1.1;
      option domain-name-servers 168.95.192.1;
      filename "ubuntu-installer/arm64/bootnetaa64.efi"; # (this we will provide later)
    }

    group {
      next-server 192.168.1.204;                # our Server
      host tftpclient {
        filename "ubuntu-installer/arm64/bootnetaa64.efi"; # (this we will provide later)
      }
    }
  5. Restart the service.
    sudo service tftpd-hpa restart; sudo service isc-dhcp-server restart;

 





沒有留言: