netbooting.txt
来自「EFI(Extensible Firmware Interface)是下一代BI」· 文本 代码 · 共 411 行 · 第 1/2 页
TXT
411 行
How to netboot using ELILO--------------------------Copyright (C) 2002-2003 Hewlett-Packard Co.Contributed by Stephane Eranian <eranian@hpl.hp.com>Last updated: 03/08/11EFI has full support for the PXE and DHCP protocol. As such it is relatively easy to boot a machine from the network using EFI.The elilo loader has full support for both PXE and DHCP, thereforeit is possible to download the elilo config file, the Linux kernel image and the initial ramdisk from a remote server. There are many waysnetbooting can be configured but in this document we focus only on two very common cases: - netboot but use local root filesystem. - booting a diskless machine, i.e., use a NFS root filesystem.1/ 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: Load File [Acpi(PNP0A03,0)/Pci(5|0)/Mac(00D0B7A6FC25)] 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, such as the one shipped on Redhat7.2 (dhcpd) or a PXE server (not yet available for Linux, probably available for Windows). In this document we show both options. You also need a TFTP server somewhere on the network, it will be used to download the actual files.2/ Netbooting using DHCP There is nothing specific to EFI that needs to be set in the /etc/dhcpd.conf file. Clearly the filename option must contains the path to the elilo.efi binary. Elilo will auto-detect whether it was downloaded via PXE or DHCP and it will adapt the kind of requests it makes to download the other files that it needs, such as its config file. A simple dhcpd.conf file which uses fixed IP addresses could be as follows: subnet 192.168.2.0 netmask 255.255.255.0 { host test_machine { hardware ethernet 00:D0:B7:A6:FC:25; fixed-address 192.168.2.10; filename "elilo.efi"; option domain-name "mydomain.com"; option host-name "test_machine"; option routers 192.168.2.1; option subnet-mask 255.255.255.0; } } For the tftp server, you need to make sure that it is ACTIVATED by inetd or xinetd depending on your distribution. In most distributions, it is disabled by default for security reasons. On distributions using xinetd, you need to check /etc/xinet.d/tftp. For inetd you need to check /etc/inetd.conf. It is typical to have the root directory for tftp be /tftpboot but it can be anything. In this document we will use /tftpboot as the root directory. The files that we need are as follows: - elilo.efi - the elilo config file - the kernel image - the initial ramdisk (optional) a/ Location of the files in the tftp directory tree For elilo version 3.3b or higher, it is possible to place the files listed above in any subdirectory below the tftp root. Of course the dhcpd.conf file must point to the location of elilo.efi and provide the path from the tftp root directory. Elilo will look for its config file, the kernel image, the initial ramdisk (optional) only from the directory it was loaded from. This is useful when the same tftp server is used to services many different kind of clients. Here is a simple example, suppose the dhcpd.conf file contains the following definition: subnet 192.168.2.0 netmask 255.255.255.0 { host test_machine { hardware ethernet 00:D0:B7:A6:FC:25; fixed-address 192.168.2.10; filename "/rx6000/elilo.efi"; option domain-name "mydomain.com"; option host-name "test_machine"; option routers 192.168.2.1; option subnet-mask 255.255.255.0; } } Elilo will be downloaded from /tftpboot/rx6000. Then elilo will look for all the other files it needs in /tftpboot/rx6000. This rule is applied to all files, including the all the variation of the config file. b/ Getting the config file With DHCP, elilo will first try to download its configuration file. It will try several file names and they are as follows: 1) AABBCCDD.conf where AABBCCDD is the hexadecimal representation of the IP address assigned to the machine by DHCP. The hexadecimal string (AABBCCDD) MUST use upper case characters. This filename is an opportunity to specify a machine specific configuration file. 2) AA[BB[CC]][-ia32|ia64].conf As of version 3.5, elilo will also look for IPv4 class A,B,C subnet-specific versions of the config file. This is useful when you want to have a common config file for all machines connected to a particular subnet. For example, if your IP address is 10.0.0.1 (0A000001 in hex), elilo will look first for 0A000001.conf, then 0A0000.conf, then 0A00.conf, and finally 0A.conf. Elilo will also try architecture-specific versions of subnet-specific config files first (So for example, on an Itanium system, "0A0000-ia64.conf" will be tried before "0A0000.conf") 3) elilo-ia32.config or elilo-ia64.conf Depending on the machine (client side) architecture elilo will try the IA-32 or IA-64 file. This filename is an opportunity to specify a architecture specific configuration file. This distinction between the architectures is useful when the same TFTP server services the two types of clients : IA32- and IA-64 machines. 4) elilo.conf All files use the same format. Elilo will stop at the first match. In case no file is found, it will try to download a default kernel file name (vmlinux). c/ Getting the kernel The second request from elilo is typically the kernel image. The filename is based on what is in the elilo config file. The path name depends on how the TFTP server is configured. For security reasons it is customary to have the server do a change root in /tftpboot. Hence filenames are relative to /tftpboot and therefore you don't need to specify it. For instance if elilo.conf contains: image=vmlinuz.249 label=linux-up root=/dev/sdb2 and the user selects linux-up, then elilo will request a filename of 'vmlinux.249' which must therefore be in /tftpboot. Check the configuration of your TFTP server for more on this. d/ Getting the initial ramdisk This step is optional. It follows exactly the same naming rules explained for the kernel image. The initial ramdisk file must therefore be somewhere under /tftpboot. For instance if elilo.conf contains: image=vmlinuz.249 label=linux-up root=/dev/sdb2 initrd=ramdisk/initrd.249 and the user selects linux-up, then elilo will request a filename of 'ramdisk/initrd.249' which must therefore be under /tftpboot. e/ 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 elilo variables indicated below: - assigned IP address -> %I - assigned netmask -> %M - assigned domainname -> %D - assigned gateway -> %G These variables can be used to dynamically adjust the command line arguments passed to the kernel. See section 5/ below for an example.3/ 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.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?