2.1 KiB
PXE-booting with iPXE
UEFI
iPXE supports UEFI and so do we. This requires the
ipxe.efi boot image.
Process
When a system PXE boots, the DHCP server will boot either pxelinux in
legacy mode or grub on UEFI. It is still possible to load ipxe from
either of these. With the right option, the boot process is pointed to
boot00.psi.ch and one of the following boot images:
ipxe.efifor systems using UEFIipxe.lkrnfor all other systems
The system downloads the image and executes it.
The image contains a small iPXE script, which makes iPXE retrieve its
actual configuration from a web service running (usually) on
boot00.psi.ch. Specifically, it queries the URL
https://boot00.psi.ch/ipxe/v1/config?mac=<MAC>, where
<MAC> is the MAC address of the interface used by
iPXE.
The web service on boot00.psi.ch will generate the iPXE
configuration on the fly, depending on whether the system is supposed to
be reinstalled and if so, which distribution it is supposed to use. The
menu offers other options as well, e.g. an interactive iPXE shell and a
memory test.
Sequence Diagram of the UEFI Boot Process
Sequence Diagram of the BIOS (Legacy) Boot Process
Building the iPXE boot image
The steps for building an iPXE image are
- Clone
git@git.psi.ch:linux-infra/ipxe-build.git - Change into the new directory
- Run the
refresh-ipxe.shscript. This will check out the iPXE source code mirror fromgit.psi.ch. - Run the
build.shscript. This will use the named configurations in theipxe-buildrepository to compile two iPXE images:src/bin/ipxe.lkrn(legacy boot) andsrc/bin-x86_64-efi/ipxe.efi(UEFI).
As described above, we use an iPXE boot image with an embedded script looking roughly like the following:
#!ipxe
dhcp && goto dhcp_succeeded
shell
#prompt for network info
:dhcp_succeeded
chain http://boot00.psi.ch/ipxe/v1/config?mac=${netX/mac}

