I'm trying to PXE boot UEFI clients. My current setup for BIOS clients uses pxelinux.0 with a pxelinux.cfg/default like this:
DEFAULT vmlinuz-3.8.0-25-generic
APPEND initrd=initrd.img-3.8.0-25-generic root=/dev/nfs nfsroot=10.17.76.1:/var/lib/tribble/ephemeral ip=dhcp ro nomodeset
But I'm struggling to do the same with UEFI, party because there are so many different approaches that can be taken, and there is so little good documentation out there.
Following this guide to PXE booting the netboot mini.iso on UEFI, I was able to PXE boot into the installer, but thus far I haven't figured out how to adapt those instructions to my use case.
So there are few things I'm after:
-
What boot loader is recommended for PXE booting UEFI clients?
-
Can you point me to a working example of using said boot loader to PXE boot a UEFI client whose rootfs is exported over NFS?
-
I've seen many tutorials referencing the pxe and pxecmd grub modules, but those aren't present on Ubuntu 13.04… are they deprecated, and if so, what replaces them?
Options I'm considering:
-
Use syslinux.efi
-
Use elilo
-
Use grub2
-
Use the Linux EFI stub loader (bit of a pain because we'd have to compile our own kernel with hard-coded boot parameters)
In this sea of options, I'm hoping to find a low risk solution that will continue to be well supported by Ubuntu.
Best Answer
How to netboot using ELILO
How to get EFI to netboot?
You do not need any additional software to get EFI to start a netboot session. Any EFI machine can be configured to start a PXE/DHCP session IF it has a network adapter that has support for the UNDI/PXE protocol. Most modern cards do have such support.
To enable netbooting, you need to go into the EFI boot manager maintenance menu and 'Add a boot option'. On the screen you see the list of devices to boot from. At least one of them should be of the form:
which represent Ethernet card (Mac address). If you don't have such option, it means that you either do not have a network adapter in your machine or it does not have the UNDI/PXE support in its option ROM.
You need to select this option and give it a logical name such as 'netboot', for instance. Next, you leave the maintenance menu and go back to the main menu. You now have a new boot menu option. If you select 'netboot' then EFI will start the PXE/DCHP discovery request and look for a server to get an IP address.
On the server side, you can use a standard DHCP server.
Netbooting using PXE
EFI has builtin support for PXE. In fact it first tries PXE and then default to DHCP when it does not find a valid PXE server.
There is a PXE server package available from Linux/ia32 however this package does not have the necessary extensions to talk to the EFI side.
There is no need for special options or compile time flags to get elilo to work with PXE instead of standard DHCP. When netbooted, elilo will automatically detect if it has been downloaded via PXE or DHCP and it will adujst how subsequent files are requested.
You need a special version of the DHCPD server developed by the Internet Software Consortium (http://www.isc.org) with a special patch to add the PXE extensions. Unfortunately as of version 3.0xx, the patch has not yet made it into the official tree. It is supposed to show up in version 3.1 of the dhcpd server.
In any case, the elilo package contains a simple example of how you can configure the
/etc/dhcpd.conf
file for a PXE-aware DHCP server using the extensions provided in the patch. You can look inexamples/dhcpd-pxe.conf
. The syntax is very different from a standard dhcpd server.The key elements to keep in mind are the PXE layers used by elilo to request the different files:
There is an IMPORTANT distinction between those layers. The first two (0,1) and requested systematically whereas the last one is used only when the configuration file is not found, i.e., what is the default kernel to boot. The actual files are STILL downloaded via TFTP. Therefore the TFTP server must also be configured (see previous section for more on this).
Getting the config file
In this mode, elilo use the PXE layer 1 to get the config file to use. Therefore this must be set on the server side. Elilo will use the following sequence when looking for a config file:
Sample elilo.conf file
Another one
Also take a look at elilo.conf, and Managing EFI Boot Loaders for Linux: Using ELILO
Elilo stops at the first match. With PXE, elilo does not try to download a config file named after the assigned IP address as it does for DHCP because there is enough flexibility in the PXE server configuration to do this.
Getting the kernel image
When there is no config file, elilo will use the kernel name returned by PXE layer 2. If it is not specified there, then it default to 'vmlinux'.
Getting the initial ramdisk
The filename for the ramdisk MUST come from the config file. Elilo does not use a PXE layer to ask for a default name.
Getting IP address information
When elilo is netbooted, the network filesystem module initializes some elilo variables with the information it received from the DHCP server. At a minimum, it received the IP address.
The following information is stored in the variables indicated below:
These variables can be used to dynamically adjust the command line arguments passed to the kernel.
For more information See PXE Linux and Implementing PXE Boot
Source:HP