1 How to netboot using ELILO
2 --------------------------
4 Copyright (C) 2002-2003 Hewlett-Packard Co.
5 Contributed by Stephane Eranian <eranian@hpl.hp.com>
9 EFI has full support for the PXE and DHCP protocol. As such
10 it is relatively easy to boot a machine from the network using EFI.
11 The elilo loader has full support for both PXE and DHCP, therefore
12 it is possible to download the elilo config file, the Linux kernel image
13 and the initial ramdisk from a remote server. There are many ways
14 netbooting can be configured but in this document we focus
15 only on two very common cases:
17 - netboot but use local root filesystem.
18 - booting a diskless machine, i.e., use a NFS root filesystem.
20 1/ How to get EFI to netboot?
22 You do not need any additional software to get EFI to start a netboot session.
23 Any EFI machine can be configured to start a PXE/DHCP session IF it has a network
24 adapter that has support for the UNDI/PXE protocol. Most modern cards do have such
27 To enable netbooting, you need to go into the EFI boot manager maintenance menu
28 and 'Add a boot option'. On the screen you see the list of devices to boot from.
29 At least one of them should be of the form:
31 Load File [Acpi(PNP0A03,0)/Pci(5|0)/Mac(00D0B7A6FC25)]
33 which represent Ethernet card (Mac address). If you don't have such option, it means that
34 you either do not have a network adapter in your machine or it does not have the
35 UNDI/PXE support in its option ROM.
37 You need to select this option and give it a logical name such as 'netboot', for instance.
38 Next, you leave the maintenance menu and go back to the main menu. You now have a new
39 boot menu option. If you select 'netboot' then EFI will start the PXE/DCHP discovery
40 request and look for a server to get an IP address.
42 On the server side, you can use a standard DHCP server, such as the one shipped on
43 Redhat7.2 (dhcpd) or a PXE server (not yet available for Linux, probably available for Windows).
44 In this document we show both options. You also need a TFTP server somewhere on the network,
45 it will be used to download the actual files.
48 2/ Netbooting using DHCP
50 There is nothing specific to EFI that needs to be set in the /etc/dhcpd.conf file.
51 Clearly the filename option must contains the path to the elilo.efi binary.
53 Elilo will auto-detect whether it was downloaded via PXE or DHCP and it will adapt
54 the kind of requests it makes to download the other files that it needs, such as
57 A simple dhcpd.conf file which uses fixed IP addresses could be as follows:
59 subnet 192.168.2.0 netmask 255.255.255.0 {
61 hardware ethernet 00:D0:B7:A6:FC:25;
62 fixed-address 192.168.2.10;
64 option domain-name "mydomain.com";
65 option host-name "test_machine";
66 option routers 192.168.2.1;
67 option subnet-mask 255.255.255.0;
72 For the tftp server, you need to make sure that it is ACTIVATED by inetd or xinetd depending
73 on your distribution. In most distributions, it is disabled by default for security reasons.
74 On distributions using xinetd, you need to check /etc/xinet.d/tftp. For inetd you need to
75 check /etc/inetd.conf. It is typical to have the root directory for tftp be /tftpboot but it
76 can be anything. In this document we will use /tftpboot as the root directory. The files
77 that we need are as follows:
79 - the elilo config file
81 - the initial ramdisk (optional)
84 a/ Location of the files in the tftp directory tree
86 For elilo version 3.3b or higher, it is possible to place the files listed above
87 in any subdirectory below the tftp root. Of course the dhcpd.conf file must
88 point to the location of elilo.efi and provide the path from the tftp root
91 Elilo will look for its config file, the kernel image, the initial ramdisk (optional)
92 only from the directory it was loaded from. This is useful when the same tftp server
93 is used to services many different kind of clients.
95 Here is a simple example, suppose the dhcpd.conf file contains the following definition:
97 subnet 192.168.2.0 netmask 255.255.255.0 {
99 hardware ethernet 00:D0:B7:A6:FC:25;
100 fixed-address 192.168.2.10;
102 filename "/rx6000/elilo.efi";
104 option domain-name "mydomain.com";
105 option host-name "test_machine";
106 option routers 192.168.2.1;
107 option subnet-mask 255.255.255.0;
112 Elilo will be downloaded from /tftpboot/rx6000. Then elilo will look
113 for all the other files it needs in /tftpboot/rx6000. This rule is
114 applied to all files, including the all the variation of the config
117 b/ Getting the config file
119 With DHCP, elilo will first try to download its configuration file. It will try
120 several file names and they are as follows:
123 where AABBCCDD is the hexadecimal representation of the IP address assigned to
124 the machine by DHCP. The hexadecimal string (AABBCCDD) MUST use upper case
127 This filename is an opportunity to specify a machine specific configuration file.
129 2) elilo-ia32.config or elilo-ia64.conf
131 Depending on the machine (client side) architecture elilo will try the IA-32 or
134 This filename is an opportunity to specify a architecture specific configuration file.
135 This distinction between the architectures is useful when the same TFTP server services
136 the two types of clients : IA32- and IA-64 machines.
140 All files use the same format. Elilo will stop at the first match. In case no file is found,
141 it will try to download a default kernel file name (vmlinux).
143 c/ Getting the kernel
145 The second request from elilo is typically the kernel image. The filename is based on what
146 is in the elilo config file. The path name depends on how the TFTP server is configured.
147 For security reasons it is customary to have the server do a change root in /tftpboot.
148 Hence filenames are relative to /tftpboot and therefore you don't need to specify it.
150 For instance if elilo.conf contains:
155 and the user selects linux-up, then elilo will request a filename of 'vmlinux.249'
156 which must therefore be in /tftpboot. Check the configuration of your TFTP server for
159 d/ Getting the initial ramdisk
161 This step is optional. It follows exactly the same naming rules explained for the kernel image.
162 The initial ramdisk file must therefore be somewhere under /tftpboot.
164 For instance if elilo.conf contains:
168 initrd=ramdisk/initrd.249
170 and the user selects linux-up, then elilo will request a filename of 'ramdisk/initrd.249'
171 which must therefore be under /tftpboot.
174 e/ Getting IP address information
176 When elilo is netbooted, the network filesystem module initializes some elilo variables
177 with the information it received from the DHCP server. At a minimum, it received the
180 The following information is stored in the elilo variables indicated below:
181 - assigned IP address -> %I
182 - assigned netmask -> %M
183 - assigned domainname -> %D
184 - assigned gateway -> %G
186 These variables can be used to dynamically adjust the command line arguments passed to the kernel.
187 See section 5/ below for an example.
189 3/ Netbooting using PXE
191 EFI has builtin support for PXE. In fact it first tries PXE and then default to DHCP
192 when it does not find a valid PXE server.
194 There is a PXE server package available from Linux/ia32 however this package does not
195 have the necessary extensions to talk to the EFI side, at least on IA-64 platforms.
197 There is no need for special options or compile time flags to get elilo to work
198 with PXE instead of standard DHCP. When netbooted, elilo will automatically detect
199 if it has been downloaded via PXE or DHCP and it will adujst how subsequent files
202 You need a special version of the DHCPD server developed by the Internet Software Consortium
203 (http://www.isc.org) with a special patch to add the PXE extensions. Unfortunately as of
204 version 3.0xx, the patch has not yet made it into the official tree. It is supposed to show
205 up in version 3.1 of the dhcpd server.
207 In any case, the elilo package contains a simple example of how you can configure the
208 /etc/dhcpd.conf file for a PXE-aware DHCP server using the extensions provided in the
209 patch. You can look in examples/dhcpd-pxe.conf. The syntax is very different from
210 a standard dhcpd server.
212 The key elements to keep in mind are the PXE layers used by elilo to request the different
215 Layer 0 : to get the name of the boot loader (elilo.efi)
216 Layer 1 : to get the name of the elilo config file
217 Layer 2 : to get the name of the kernel image
219 There is an IMPORTANT distinction between those layers. The first two (0,1) and requested
220 systematically whereas the last one is used only when the configuration file is not found, i.e.,
221 what is the default kernel to boot. The actual files are STILL downloaded via TFTP. Therefore
222 the TFTP server must also be configured (see previous section for more on this).
225 a/ Getting the config file
227 In this mode, elilo use the PXE layer 1 to get the config file to use. Therefore this must
228 be set on the server side. Elilo will use the following sequence when
229 looking for a config file:
231 - use the name provide by the PXE server Layer 1 or
233 - elilo-ia64.conf/elilo-ia32.conf or
237 Elilo stops at the first match. With PXE, elilo does not try to download a config file named after
238 the assigned IP address as it does for DHCP because there is enough flexibility in the PXE server
239 configuration to do this.
241 b/ Getting the kernel image
243 When there is no config file, elilo will use the kernel name returned by
244 PXE layer 2. If it is not specified there, then it default to 'vmlinux'.
246 c/ Getting the initial ramdisk
248 The filename for the ramdisk MUST come from the config file. Elilo does not use a PXE layer
249 to ask for a default name.
251 d/ Getting IP address information
253 When elilo is netbooted, the network filesystem module initializes some elilo variables
254 with the information it received from the DHCP server. At a minimum, it received the
257 The following information is stored in the variables indicated below:
258 - assigned IP address -> %I
259 - assigned netmask -> %M
260 - assigned domainname -> %D
261 - assigned gateway -> %G
263 These variables can be used to dynamically adjust the command line arguments passed to the kernel.
264 See section 5/ below for an example of how to use the variable.
267 4/ Netbooting and using a local root filesystem
269 This is the simplest configuration where the boot loader, its config file, the kernel
270 and its optional initial ramdisk are downloaded from the network BUT the kernel uses
271 the local disk for its root filesystem.
273 For such configuration there is no special option necessary in the elilo config file.
274 You simply need to specify which partition is the root partition. A typical elilo.conf
275 would look as follows:
280 initrd=ramdisk/initrd.249
282 5/ Netbooting a diskless machine
284 In this configuration we do not use the local machine's disks but instead rely on
285 a remote server to provide the root filesystem via NFS.
289 By default most kernels shipped by distributors do not have the support
290 compiled in for such configuration. This means that you need to recompile
291 your own kernel. For instance, vmlinuz-2.4.9 as shipped in Redhat7.2 on
292 both ia32 and ia64 platforms does not have the support builtin.
294 To get this configuration to work, you need to have a kernel compiled
295 such that it accepts a root filesystem over NFS (CONFIG_ROOT_NFS). This
296 necessitates that the network stack be configured with the, so called,
297 IP plug-and-play support (CONFIG_IP_PNP).
299 b/ On the server side
302 - a NFS file server to provide the root filesystem.
303 - a DHCP/PXE server to get the IP address and download the boot loader.
305 Note that both do not need to be on the same machine. There is no special
306 DHCP/PXE configuration option required to get this working. All you need
307 is a kernel compiled with the options mentioned in a/. You also need to
308 make sure that the permission on the NFS server are set appropriately
309 to allow root access from the client machine (no_root_squash), see
310 man 'exports' for more on this.
312 c/ The elilo configuration file
314 To boot successfully, the kernel needs to:
315 - get an IP address and related networking parameters
316 - contact the NFS server to get its root filesystem
318 The 2.4.x kernel series provides several options to get the IP address:
319 - it can do an internal DHCP request (CONFIG_IP_PNP_DHCP)
320 - it can do an internal RARP request (CONFIG_IP_PNP_RARP)
321 - it can do an internal BOOTP request (CONFIG_IP_PNP_BOOTP)
322 - it can get the IP address from the command line
324 The choice is up to you but it is a little bit stupid to go through a
325 DHCP/BOOTP/RARP phase again when this is already done by the EFI firmware.
326 So in this document, we describe how you can pass the information provided
327 by EFI on the command line of the kernel.
329 The syntax used to pass IP information on the command line is described in
330 the kernel source tree in Documentation/nfsroot.txt. The option is called
331 "ip=" and has the following syntax:
333 ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
335 To designate the NFS server, you must use the "nfsroot=" option. It has the
337 nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
339 Depending on how you want your system configured you can hardcode the
340 values of the parameters in the elilo configuration file. For instance:
344 description="kernel with NFS root"
345 append="root=/dev/nfs nfsroot=192.168.2.22:/ia64_rootfs ip=192.168.2.5::192.168.2.1:255.255.255.0:test_machine:eth0:on"
347 Note the root=/dev/nfs indicates that the root filesystem is over NFS.
349 This example works fine however, it is not very flexible because the IP
350 address, the gateway, netmask and hostname are fixed and do not used the
351 values EFI used to download the boot loader and the kernel.
353 Elilo provides a way to dynamically customize the parameters passed on the
354 command line using substitution variables. We describe those variables in
355 elilovar.txt. The basic idea is to allow the parameters to use the dynamic
356 information obtained by the DHCP/PXE phase.
358 The network support in elilo defines several variables which contained
359 network related information produced by the DHCP/PXE phase. The set of
361 %I -> the IP address obtained by DHCP/PXE
362 %M -> the netmask obtained by DHCP/PXE
363 %G -> the gateway obtained by DHCP/PXE
364 %H -> the hostname obtained by DHCP/PXE
365 %D -> the domain name obtained by DHCP/PXE
367 So, the configuration file can then be customized as follows:
370 description="kernel with NFS root"
371 append="root=/dev/nfs nfsroot=192.168.2.22:/ia64_rootfs ip=%I::%G:%M:%H:eth0:on"
373 Not all parameters are necessary or even used by the kernel or the user level
374 configuration scripts. There is no variable to substitute the NFS server or
375 the mount point on that server.
378 In the case of a DHCP boot, this type of customization makes sense only for
379 the shared configuration file, elilo-ia64.conf/elilo-ia32.conf or elilo.conf.
380 The configuration file based on the IP address (such as C0A80205.conf in this
381 case) would provide another way of customizing parameters for a specific
382 client (IP address). The same thing holds if the name of the config file
383 returned by the PXE server is specific to a client.
388 More information on the PXE protocol can be found at the following web site:
390 http://developer.intel.com/ial/wfm/
392 The source code for the standard and (possibly) PXE-enhanced DHCPD can be