netbooting.txt
来自「EFI(Extensible Firmware Interface)是下一代BI」· 文本 代码 · 共 411 行 · 第 1/2 页
TXT
411 行
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, at least on IA-64 platforms. 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 in examples/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: Layer 0 : to get the name of the boot loader (elilo.efi) Layer 1 : to get the name of the elilo config file Layer 2 : to get the name of the kernel image 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). a/ 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: - use the name provide by the PXE server Layer 1 or - elilo-ia64.conf/elilo-ia32.conf or - elilo.conf 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. b/ 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'. c/ 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. d/ 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: - 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 of how to use the variable.4/ Netbooting and using a local root filesystem This is the simplest configuration where the boot loader, its config file, the kernel and its optional initial ramdisk are downloaded from the network BUT the kernel uses the local disk for its root filesystem. For such configuration there is no special option necessary in the elilo config file. You simply need to specify which partition is the root partition. A typical elilo.conf would look as follows: image=vmlinuz.249 label=linux-up root=/dev/sdb2 initrd=ramdisk/initrd.2495/ Netbooting a diskless machine In this configuration we do not use the local machine's disks but instead rely on a remote server to provide the root filesystem via NFS. a/ Prerequisites By default most kernels shipped by distributors do not have the support compiled in for such configuration. This means that you need to recompile your own kernel. For instance, vmlinuz-2.4.9 as shipped in Redhat7.2 on both ia32 and ia64 platforms does not have the support builtin. To get this configuration to work, you need to have a kernel compiled such that it accepts a root filesystem over NFS (CONFIG_ROOT_NFS). This necessitates that the network stack be configured with the, so called, IP plug-and-play support (CONFIG_IP_PNP). b/ On the server side You need to have: - a NFS file server to provide the root filesystem. - a DHCP/PXE server to get the IP address and download the boot loader. Note that both do not need to be on the same machine. There is no special DHCP/PXE configuration option required to get this working. All you need is a kernel compiled with the options mentioned in a/. You also need to make sure that the permission on the NFS server are set appropriately to allow root access from the client machine (no_root_squash), see man 'exports' for more on this. c/ The elilo configuration file To boot successfully, the kernel needs to: - get an IP address and related networking parameters - contact the NFS server to get its root filesystem The 2.4.x kernel series provides several options to get the IP address: - it can do an internal DHCP request (CONFIG_IP_PNP_DHCP) - it can do an internal RARP request (CONFIG_IP_PNP_RARP) - it can do an internal BOOTP request (CONFIG_IP_PNP_BOOTP) - it can get the IP address from the command line The choice is up to you but it is a little bit stupid to go through a DHCP/BOOTP/RARP phase again when this is already done by the EFI firmware. So in this document, we describe how you can pass the information provided by EFI on the command line of the kernel. The syntax used to pass IP information on the command line is described in the kernel source tree in Documentation/nfsroot.txt. The option is called "ip=" and has the following syntax: ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf> To designate the NFS server, you must use the "nfsroot=" option. It has the following syntax: nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>] Depending on how you want your system configured you can hardcode the values of the parameters in the elilo configuration file. For instance: image=/vmlinuz label=nfsroot description="kernel with NFS root" 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" Note the root=/dev/nfs indicates that the root filesystem is over NFS. This example works fine however, it is not very flexible because the IP address, the gateway, netmask and hostname are fixed and do not used the values EFI used to download the boot loader and the kernel. Elilo provides a way to dynamically customize the parameters passed on the command line using substitution variables. We describe those variables in elilovar.txt. The basic idea is to allow the parameters to use the dynamic information obtained by the DHCP/PXE phase. The network support in elilo defines several variables which contained network related information produced by the DHCP/PXE phase. The set of variable is: %I -> the IP address obtained by DHCP/PXE %M -> the netmask obtained by DHCP/PXE %G -> the gateway obtained by DHCP/PXE %H -> the hostname obtained by DHCP/PXE %D -> the domain name obtained by DHCP/PXE So, the configuration file can then be customized as follows: image=/vmlinuz label=nfsroot description="kernel with NFS root" append="root=/dev/nfs nfsroot=192.168.2.22:/ia64_rootfs ip=%I::%G:%M:%H:eth0:on" Not all parameters are necessary or even used by the kernel or the user level configuration scripts. There is no variable to substitute the NFS server or the mount point on that server. In the case of a DHCP boot, this type of customization makes sense only for the shared configuration file, elilo-ia64.conf/elilo-ia32.conf or elilo.conf. The configuration file based on the IP address (such as C0A80205.conf in this case) would provide another way of customizing parameters for a specific client (IP address). The same thing holds if the name of the config file returned by the PXE server is specific to a client.6/ References More information on the PXE protocol can be found at the following web site: http://developer.intel.com/ial/wfm/ The source code for the standard and (possibly) PXE-enhanced DHCPD can be downloaded from: http://www.isc.org/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?