📄 pxelinux.doc
字号:
PXELINUX A bootloader for Linux using the PXE network booting protocol Copyright (C) 1994-2003 H. Peter AnvinThis program is provided under the terms of the GNU General PublicLicense, version 2 or, at your option, any later version. There is nowarranty, neither expressed nor implied, to the function of thisprogram. Please see the included file COPYING for details.----------------------------------------------------------------------PXELINUX is a SYSLINUX derivative, for booting Linux off a networkserver, using a network ROM conforming to the Intel PXE (Pre-ExecutionEnvironment) specification. PXELINUX is *not* a program that isintended to be flashed or burned into a PROM on the network card; ifyou want that, check out NILO (http://www.nilo.org/). NILO can alsobe used to create a PXE-compliant boot PROM for most network cardswhich have drivers for Linux or FreeBSD. ++++ HOW TO CONFIGURE PXELINUX ++++PXELINUX operates in many ways like SYSLINUX. If you are not familiarwith SYSLINUX, read syslinux.doc first, since this documentation onlyexplains the differences.On the TFTP server, create the directory "/tftpboot", and copy thefollowing files to it: pxelinux.0 - from the SYSLINUX distribution any kernel or initrd images you want to bootFinally, create the directory "/tftpboot/pxelinux.cfg". Theconfiguration file (equivalent of syslinux.cfg -- see syslinux.doc forthe options here) will live in this directory. Because more than onesystem may be booted from the same server, the configuration file namedepends on the IP address of the booting machine. PXELINUX willsearch for its config file on the boot server in the following way: First, it will search for the config file using its own IP address in upper case hexadecimal, e.g. 192.0.2.91 -> C000025B (you can use the included progam "gethostip" to compute the hexadecimal IP address for any host.) If that file is not found, it will remove one hex digit and try again. Ultimately, it will try looking for a file named "default" (in lower case). As an example, for 192.0.2.91, it will try C000025B, C000025, C00002, C0000, C000, C00, C0, C, and default, in that order.(See also the section on special DHCP options.)It should be noted that all filename references are relative to thedirectory pxelinux.0 lives in (usually /tftpboot). PXELINUXgenerally requires that filenames (including any relative path) are 127characters or shorter in length.PXELINUX does not support MTFTP, and I have no immediate plans ofdoing so. It is of course possible to use MTFTP for the initial boot,if you have such a setup. MTFTP server setup is beyond the scope ofthis document. ++++ SETTING UP THE TFTP SERVER ++++PXELINUX currently requires that the boot server has a TFTP serverwhich supports the "tsize" TFTP option (RFC 1784/RFC 2349). The"tftp-hpa" TFTP server, which support options, is available at: http://www.kernel.org/pub/software/network/tftp/ ftp://www.kernel.org/pub/software/network/tftp/... and on any kernel.org mirror (see http://www.kernel.org/mirrors/).Another TFTP server which supports this is atftp by Jean-PierreLefebvre: ftp://ftp.mamalinux.com/pub/atftp/If your boot server is running Windows (and you can't fix that), trytftpd32 by Philippe Jounin (you need version 2.11 or later; previousversions had a bug which made it incompatible with PXELINUX): http://tftpd32.jounin.net/ ++++ SETTING UP THE DHCP SERVER ++++The PXE protocol uses a very complex set of extensions to DHCP orBOOTP. However, most PXE implementations -- this includes all Intelones version 0.99n and later -- seem to be able to boot in a"conventional" DHCP/TFTP configuration. Assuming you don't have tosupport any very old or otherwise severely broken clients, this isprobably the best configuration unless you already have a PXE bootserver on your network.A sample DHCP setup, using the "conventional TFTP" configuration,would look something like the following, using ISC dhcp 2.0 dhcpd.confsyntax: allow booting; allow bootp; # Standard configuration directives... option domain-name "<domain name>"; option subnet-mask <subnet mask>; option broadcast-address <broadcast address>; option domain-name-servers <dns servers>; option routers <default router>; # Group the PXE bootable hosts together group { # PXE-specific configuration directives... next-server <TFTP server address>; filename "/tftpboot/pxelinux.0"; # You need an entry like this for every host # unless you're using dynamic addresses host <hostname> { hardware ethernet <ethernet address>; fixed-address <hostname>; } }Note that if your particular TFTP daemon runs under chroot (tftp-hpawill do this if you specify the -s (secure) option; this is highlyrecommended), you almost certainly should not include the /tftpbootprefix in the filename statement.If this does not work for your configuration, you probably should setup a "PXE boot server" on port 4011 of your TFTP server; a free PXEboot server is available at: http://www.kano.org.uk/projects/pxe/With such a boot server defined, your DHCP configuration should lookthe same except for an "option dhcp-class-identifier" ("optionvendor-class-identifier" if you are using DHCP 3.0): allow booting; allow bootp; # Standard configuration directives... option domain-name "<domain name>"; option subnet-mask <subnet mask>; option broadcast-address <broadcast address>; option domain-name-servers <dns servers>; option routers <default router>; # Group the PXE bootable hosts together group { # PXE-specific configuration directives... option dhcp-class-identifier "PXEClient"; next-server <pxe boot server address>; # You need an entry like this for every host # unless you're using dynamic addresses host <hostname> { hardware ethernet <ethernet address>; fixed-address <hostname>; } }Here, the boot file name is obtained from the PXE server.If the "conventional TFTP" configuration doesn't work on your clients,and setting up a PXE boot server is not an option, you can attempt thefollowing configuration. It has been known to boot someconfigurations correctly; however, there are no guarantees: allow booting; allow bootp; # Standard configuration directives... option domain-name "<domain name>"; option subnet-mask <subnet mask>; option broadcast-address <broadcast address>; option domain-name-servers <dns servers>; option routers <default router>; # Group the PXE bootable hosts together group { # PXE-specific configuration directives... option dhcp-class-identifier "PXEClient"; option vendor-encapsulated-options 09:0f:80:00:0c:4e:65:74:77:6f:72:6b:20:62:6f:6f:74:0a:07:00:50:72:6f:6d:70:74:06:01:02:08:03:80:00:00:47:04:80:00:00:00:ff; next-server <TFTP server>; filename "/tftpboot/pxelinux.0"; # You need an entry like this for every host # unless you're using dynamic addresses host <hostname> { hardware ethernet <ethernet address>; fixed-address <hostname>; } }Note that this *will not* boot some clients that *will* boot with the"conventional TFTP" configuration; Intel Boot Client 3.0 and later areknown to fall into this category. ++++ SPECIAL DHCP OPTIONS ++++PXELINUX (starting with version 1.62) supports the followingnonstandard DHCP options, which depending on your DHCP server you maybe able to use to customize the specific behaviour of PXELINUX:Option 208 pxelinux.magic - Must be set to F1:00:74:7E (241.0.116.126) for PXELINUX to recognize any special DHCP options whatsoever.Option 209 pxelinux.configfile - Specifies the PXELINUX configuration file name.Option 210 pxelinux.pathprefix - Specifies the PXELINUX common path prefix, instead of deriving it from the boot file name. This almost certainly needs to end in whatever character the TFTP server OS uses as a pathname separator, e.g. slash (/) for Unix.Option 211 pxelinux.reboottime - Specifies, in seconds, the time to wait before reboot in the event of TFTP failure. 0 means wait "forever" (in reality, it waits approximately 136 years.)ISC dhcp 3.0 supports a rather nice syntax for specifying customoptions; you can use the following syntax in dhcpd.conf if you arerunning this version of dhcpd: option space pxelinux; option pxelinux.magic code 208 = string; option pxelinux.configfile code 209 = text; option pxelinux.pathprefix code 210 = text; option pxelinux.reboottime code 211 = unsigned integer 32; NOTE: In earlier versions of PXELINUX, this would only work as a "site-option-space". Since PXELINUX 2.07, this will work both as a "site-option-space" (unencapsulated) and as a "vendor-option-space" (type 43 encapsulated.) This may avoid messing with the dhcp-parameter-request-list, as detailed below.Then, inside your PXELINUX-booting group or class (whereever you havethe PXELINUX-related options, such as the filename option), you canadd, for example: # Always include the following lines for all PXELINUX clients site-option-space "pxelinux"; option pxelinux.magic f1:00:74:7e; if exists dhcp-parameter-request-list { # Always send the PXELINUX options (specified in hexadecimal) option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,d0,d1,d2,d3); } # These lines should be customized to your setup option pxelinux.configfile "configs/common"; option pxelinux.pathprefix "/tftpboot/pxelinux/files/"; option pxelinux.reboottime 30; filename "/tftpboot/pxelinux/pxelinux.bin";Note that the configfile is relative to the pathprefix: this will lookfor a config file called /tftpboot/pxelinux/files/configs/common onthe TFTP server.The "option dhcp-parameter-request-list" statement forces the DHCPserver to send the PXELINUX-specific options, even though they are notexplicitly requested. Since the DHCP request is done before PXELINUXis loaded, the PXE client won't know to request them.Using ISC dhcp 3.0 you can create a lot of these strings on the fly.For example, to use the hexadecimal form of the hardware address asthe configuration file name, you could do something like: site-option-space "pxelinux"; option pxelinux.magic f1:00:74:7e; if exists dhcp-parameter-request-list { # Always send the PXELINUX options (specified in hexadecimal) option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,d0,d1,d2,d3); } option pxelinux.configfile = concat("pxelinux.cfg/", binary-to-ascii(16, 8, ":", hardware)); filename "/tftpboot/pxelinux.bin";If you used this from a client whose Ethernet address was58:FA:84:CF:55:0E, this would look for a configuration file named"/tftpboot/pxelinux.cfg/1:58:fa:84:cf:55:e". ++++ SOME NOTES ++++If the boot fails, PXELINUX (unlike SYSLINUX) will not wait forever;rather, if it has not received any input for approximately fiveminutes after displaying an error message, it will reset the machine.This allows an unattended machine to recover in case it had bad enoughluck of trying to boot at the same time the TFTP server goes down.Lots of PXE stacks, especially old ones, have various problems ofvarying degrees of severity. Please see: http://syslinux.zytor.com/hardware.php... for a list of currently known hardware problems, with workaroundsif known. ++++ KEEPING THE PXE STACK AROUND ++++Normally, PXELINUX will unload the PXE and UNDI stacks before invokingthe kernel. In special circumstances (for example, when using MEMDISKto boot an operating system with an UNDI network driver) it might bedesirable to keep the PXE stack in memory. If the option "keeppxe"is given on the kernel command line, PXELINUX will keep the PXE andUNDI stacks in memory. (If you don't know what this means, youprobably don't need it.) ++++ CURRENTLY KNOWN PROBLEMS ++++The following problems are known with PXELINUX, so far:+ Requires a TFTP server which supports the "tsize" option.+ The error recovery routine doesn't work quite right. For right now, it just does a hard reset - seems good enough.+ We should probably call the UDP receive function in the keyboard entry loop, so that we answer ARP requests.+ Boot sectors/disk images are not supported yet.If you have additional problems, please contact the SYSLINUX mailinglist (see syslinux.doc for the address.)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -