Chapter 6. Available PXE Bootstraps

Table of Contents

6.1. What is a PXE Bootstrap
6.1.1. Definition
6.1.2. Differences between Real PXE and TCP/IP PXE
6.2. PXELinux
6.2.1. What is PXELinux ?
6.2.2. Architecture
6.2.2.1. Root directory
6.2.2.2. Configuration directory
6.2.2.3. Images directory
6.2.3. Options of pxelinux.cfg
6.2.3.1. PROMPT flag_val
6.2.3.2. DEFAULT kernel options
6.2.3.3. DISPLAY filename
6.2.3.4. TIMEOUT timeout
6.2.3.5. LABEL label
6.2.3.6. F[1-9] filename
6.2.3.7. SERIAL port [baudrate]
6.2.4. Booting a kernel directly
6.2.4.1. How does it works ?
6.2.4.2. Advantages and drawbacks
6.2.5. Booting a disk image directly
6.2.5.1. How does it work ?
6.2.5.2. How to build a disk boot image ?
6.2.5.3. Advantages and drawbacks
6.2.6. Sample config file
6.3. PxeGrub
6.3.1. What is PxeGrub ?
6.3.2. How does it work ?
6.3.3. Options of menu.lst
6.3.3.1. TIMEOUT time
6.3.3.2. TITLE label
6.3.3.3. DHCP
6.3.3.4. TFTPSERVER ip_address
6.3.3.5. KERNEL vmlinuz_path
6.3.3.6. INITRD initrd_path
6.3.4. Booting a kernel directly
6.3.5. How can i obtain a pxegrub for my ethernet card ?
6.3.6. Sample config file
6.3.7. Advantages and drawbacks
6.4. NbGrub
6.4.1. What is NbGrub ?
6.4.2. How does it works ?
6.4.3. How can i obtain an etherboot disk for my ethernet card ?
6.4.4. menu.lst options
6.4.5. Advantages and drawbacks
6.5. NBP
6.5.1. How does it work ?
6.5.2. Where can I find it ?

6.1. What is a PXE Bootstrap

6.1.1. Definition

The bootstrap is downloaded by the client PXE ROM and executed in local. This a dependent binary architecture, so you should compile a bootstrap for intel x86, intel ia64, alpha...

The aim of a PXE Bootstrap is to give a minimalist user interface to choose the system you wish to boot.

6.1.2. Differences between Real PXE and TCP/IP PXE

The TCP/IP PXE system gets its bootstrap filename from the dhcp and determines its root directory from this filename. See Chapter 4, DHCP server for more details.

The Real PXE system gets its bootstrap from the pxe server depending on the client's architecture. See Chapter 3, PXE server for more details.

6.2. PXELinux

6.2.1. What is PXELinux ?

PXELinux is provided by Syslinux [7] and is called "pxelinux.0". Its main features are:

  • You can define a config file for each PXE Client IP address

  • The TFTP root directory is the one which contains pxelinux.0

  • PXEClient vendor-class-identifier request compilant.[8]

  • The Ability to boot a disk image (i.e floppy disk image)

6.2.2. Architecture

6.2.2.1. Root directory

All the configuration files are stored in the root path of the TFTP server (i.e /tftpboot). You can create a subdirectory that contains all the files needed by the PXE Client. In our case, I choose PXEClient, so all the files needed by my PXE Client will be stored in /tftpboot/PXEClient (PXEPATH). So your pxelinux.0 should be in PXEPATH and set in the dhcp configuration file. See Chapter 4, DHCP server for more details. Then create a pxelinux.cfg directory in PXEPATH (CFGPATH)

6.2.2.2. Configuration directory

It will contain all the configuration files (one by PXE Client IP Address) and/or a "default" configuration file. The naming mecanism is to convert your IP address in a hexadecimal form. 192.168.200.1 will give you the name of "C0A8C801"CFGFILE [9] This file contains options of the PXE Client that will make the request with its 192.168.200.1 IP address.

Note: You can use soft links for CFGFILE (i.e C0A8C801 can be linked to default) but you can't link if the source file isn't in the same directory. You can use soft links but just with one directory level !

6.2.2.3. Images directory

In PXEPATH, you must make a directory called images (IMGPATH) that will contain subdirectories (BOOTIMAGEPATH) for each boot system (i.e linux for linux boot images or a kernel and its initrd). Each BOOTIMAGEPATH contains a boot images or a kernel and its initrd and a help file.

Now you have the choice to boot directly from a disk boot image or from a kernel.

6.2.3. Options of pxelinux.cfg

As we've seen before, the PXE client downloads the bootstrap (pxelinux.0 in our case), execute it locally and the tries to download its configuration file CFGFILE.

6.2.3.1. PROMPT flag_val

If flag_val is 0, display the boot: prompt only if the Shift or Alt key is pressed, or Caps Lock or Scroll lock is set (this is the default).

If flag_val is 1, always displays the boot: prompt.

6.2.3.2. DEFAULT kernel options

Sets the default command line. If SYSLINUX boots automatically, it will act just as if the entries after DEFAULT had been typed in at the "boot:" prompt, except that the option "auto" is automatically added, indicating an automatic boot.

If no configuration file is present, or no DEFAULT entry is present in the config file, the default is kernel name "linux", with no options

6.2.3.3. DISPLAY filename

Displays the indicated file on the screen at boot time (before the boot: prompt, if displayed). This option takes the place of the LINUXMSG.TXT and BOOTMSG.TXT files in SYSLINUX 1.0.

NOTE: If the file is missing, this option is simply ignored.

6.2.3.4. TIMEOUT timeout

Indicates how long to wait at the boot: prompt until booting automatically, in units of 1/10 s. The timeout is cancelled as soon as the user types anything on the keyboard, the assumption being that the user will complete the command line already begun. A timeout of zero will disable the timeout completely, this is also the default.

NOTE: The maximum possible timeout value is 35996; corresponding to just below one hour.

6.2.3.5. LABEL label

KERNEL image APPEND options... IPAPPEND flag_val [PXELINUX only]

Indicates that if label is entered as the kernel to boot, SYSLINUX should instead boot image, and the specified APPEND and IPAPPEND options should be used instead of the ones specified in the global section of the file (before the first LABEL command.) The default for image is the same as label, and if no APPEND is given the default is to use the global entry (if any). Up to 128 LABEL entries are permitted. (for ISOLINUX, 64 LABEL entries.)

Note that LILO uses the syntax:

        image = mykernel
        label = mylabel
        append = "myoptions"
                                

whereas SYSLINUX uses the syntax:
        label mylabel
        kernel mykernel
        append myoptions
                                

Notes: Labels are mangled as if they were filenames, and must be unique after mangling. For example, two labels "v2.1.30" and "v2.1.31" will not be distinguishable under SYSLINUX, since both mangle to the same DOS filename.

6.2.3.5.1. LOCALBOOT type

On PXELINUX, specifying LOCALBOOT 0 instead of a KERNEL option means invoking this particular label will cause a local disk boot instead of booting a kernel.

The argument 0 means perform a normal boot. The argument 4 will perform a local boot with the Universal Network Driver Interface (UNDI) driver still resident in memory.

Finally, the argument 5 will perform a local boot with the entire PXE stack, including the UNDI driver, still resident in memory.

All other values are undefined. If you don't know what the UNDI or PXE stacks are, don't worry -- you don't want them, just specify 0.

On ISOLINUX, the "type" specifies the local drive number to boot from; 0x00 is the primary floppy drive and 0x80 is the primary hard drive.

The special value -1 causes ISOLINUX to report failure to the BIOS, which, on recent BIOSes, should mean that the next boot device in the boot sequence should be activated.

6.2.3.6. F[1-9] filename

Displays the content of filename on the screen when a function key is pressed at the boot: prompt. This can be used to implement pre-boot online help (presumably for the kernel command line options.)

Note that F10 MUST be entered in the config file as "F0", not "F10", and that there is currently no way to bind file names to F11 and F12. Please see the section Section 6.2.3.3, “DISPLAY filename” on DISPLAY files.

6.2.3.7. SERIAL port [baudrate]

Enables a serial port to act as the console. port is a number (0 = /dev/ttyS0 = COM1, etc.); if baudrate is omitted, the baud rate defaults to 9600 bps. The serial parameters are hardcoded to be 8 bits, no parity, 1 stop bit.

For this directive to be guaranteed to work properly, it should be the first directive in the configuration file.

6.2.4. Booting a kernel directly

6.2.4.1. How does it works ?

The PXE client will download (using a tftp server) the kernel in the path given in the KERNEL option. Then it downloads the initrd in the path given in APPEND initrd= option.

The PXE client then executes the kernel with the initrd and the option given by the APPEND option.

6.2.4.2. Advantages and drawbacks

  • You can specify many options for your kernel

  • You can't boot a boot disk image

6.2.5. Booting a disk image directly

6.2.5.1. How does it work ?

The PXE client will download (using a tftp server) a special kernel called memdisk (provided by syslinux) in the path given in the KERNEL option then it downloads the boot disk image in the path given in APPEND initrd= option. So your disk boot image is considered as an initrd of this virtual kernel. Then it tells the bios to boot on this image as it was a real floppy. Your drive A: under dos like systems is this boot image but that's not the case under linux.

6.2.5.2. How to build a disk boot image ?

In this a subdirectory of IMGPATH (maybe called linux) copy a boot image and call it boot.img (BOOTIMAGE) and create a file called help.txt with the description. The BOOTIMAGE is for example a network.img from the Mandrake Linux Distribution (in images/ directory of the cdrom) or a boot disk image. Then edit your config file in CFGPATH (the IP address converted in hexa or the "default" file) and add an entry.

Get a dos like boot image and execute

dd if=/dev/fd0 of=IMGPATH/dos/boot.img

you can do the same with rawwrite [10] under Microsoft Windows systems.

6.2.5.3. Advantages and drawbacks

  • You can't specify many options for your real kernel unless you mount this image on a loopback device.

  • You can boot any kind of OS that can be installed on a floppy disk (DOS like system, QNX, linux)

  • You can boot a Mandrake Linux network boot image directly without extracting the kernel and its initrd.

6.2.6. Sample config file

This file should be stored in CFGPATH and called like a CFGFILE (i.e /tftpboot/PXEClient/pxelinux.cfg/default or /tftpboot/PXEClient/pxelinux.cfg/C0A8C801)

PROMPT 1
DEFAULT local
DISPLAY messages
TIMEOUT 50
label local
        LOCALBOOT 0
label linux
        KERNEL memdisk
        APPEND initrd=images/linux/network.img

label freedos
        KERNEL memdisk
        APPEND initrd=images/freedos/boot.img

label autoinstall
        KERNEL images/autoinstall/vmlinuz 
        APPEND initrd=images/autoinstall/network.rdz ramdisk=32000 vga=788 kickstart=Mandrake/base/auto_inst.cfg.pl useless_thing_accepted automatic=method:nfs,network:dhcp,interface:eth0,dns:192.168.100.11,server:192.168.200.1,directory:/install root=/dev/ram3

F1 images/local/help.txt
F2 images/linux/help.txt
F3 images/freedos/help.txt
F4 images/autoinstall/help.txt
                        

6.3. PxeGrub

6.3.1. What is PxeGrub ?

PxeGrub is a bootstrap for PXE Client that gives you the ability to execute Grub through the network.

6.3.2. How does it work ?

The PXE client downloads PxeGrub and executes it locally, PxeGrub tries to initialize the network card then downloads the menu (/boot/grub/menu.lst) and shows it. You can tell PxeGrub to download the kernel and its initrd on a tftp server. See Section 6.3.4, “Booting a kernel directly”.

6.3.3. Options of menu.lst

6.3.3.1. TIMEOUT time

Indicates how long to wait at the boot: prompt until booting automatically, in units of 1 second. The time is cancelled as soon as the user types anything on the keyboard, the assumption being that the user will complete the command line already begun. A timeout of zero will disable the timeout completely.

6.3.3.2. TITLE label

Create a new boot menu entry called label

6.3.3.3. DHCP

Tell PxeGrub to make a dhcp request before downloading the kernel and its initrd. If this entry is not set, pxegrub will use the one given to the PXE ROM by the DHCP.

6.3.3.4. TFTPSERVER ip_address

Tell PxeGrub to contact a tftp server on the computer that uses the IP address ip_address.

6.3.3.5. KERNEL vmlinuz_path

Tell PxeGrub to get vmlinuz at vmlinuz_path with the options given. (nd)/ indicates that the file will be stored on the /boot located in the root directory of the tftpserver.

6.3.3.6. INITRD initrd_path

Tell PxeGrub to get initrd at initrd_path. (nd)/ indicates that the file will be stored on the /boot located in the root directory of the tftpserver.

6.3.4. Booting a kernel directly

You just need to specify a new title, add a tftpserver name and give the right kernel path and the right initrd path. Save this file in /boot/grub/ GRUBPATH in tftp server home (TFTPHOME). i.e /tftpboot/boot/grub

Remember that your kernel and your initrd must be stored in GRUBPATH.

6.3.5. How can i obtain a pxegrub for my ethernet card ?

PxeGrub must be compiled for your ethernet card because it can't be compiled for multiple architectures. The first solution is to download grub [11] 0.91 or later and compile it with --enable-eepro100 option if you're using an Intel Ethernet Express Pro 100 or get the package called pxe-1.2.0-sample in the Mandrake Linux distribution : it contains all the images that Grub can provide.

6.3.6. Sample config file

This example shows you the way of auto_installing a Mandrake Linux through a ftp server after downloading a kernel (vmlinuz) and the initrd (network.rdz).

timeout 0
title linux
tftpserver 192.168.200.1
kernel (nd)/vmlinuz vga=788 kickstart=Mandrake/base/auto_inst.cfg.pl useless_thing_accepted automatic=method:ftp,network:static,ip:192.168.200.25,dns:192.168.100.11,server:192.168.200.39,directory:/export,use a,pass:a
initrd (nd)/network.rdz
                         

6.3.7. Advantages and drawbacks

  • All the PXE Client will download the same menu !

  • So all the PXE Client will load the same kernels !

  • PxeGrub should be compiled for the each kind of ethernet card you use !

6.4. NbGrub

6.4.1. What is NbGrub ?

NbGrub is a bootstrap for Etherboot [12] that gives you the ability to execute Grub through the network.

6.4.2. How does it works ?

Etherboot loads a virtual ROM for your network card, makes a PXE request then downloads nbgrub and executes it locally, NbGrub tries to initialize the network card then it downloads the menu (/boot/grub/menu.lst) and shows it. You can tell NbGrub to download the kernel and its initrd on a tftp server. See Section 6.3.4, “Booting a kernel directly”.

6.4.3. How can i obtain an etherboot disk for my ethernet card ?

The simplest way is to download a floppy boot image from the rom-o-matic website [13] and choose the 5.0.5 version at least. Choose your network card, set the REQUIRE_VCI_ETHERBOOT option, and choose Floppy Bootable ROM image.

Then make a

dd if=the_file_you_ve_download of=/dev/fd0

You can execute now it by booting this floppy disk.

Note : Etherboot version 5.0 and later needs an option vendor-class-identifier set to Etherboot-5.0 and a special vendor-encapsulated-options set to 3c:09:45:74:68:65:72:62:6f:6f:74:ff. See Chapter 3, PXE server for more details.

6.4.4. menu.lst options

Options are the same as PxeGrub so read the PxeGrub documention above, see Section 6.3.3, “Options of menu.lst”.

6.4.5. Advantages and drawbacks

The same as PxeGrub, see Section 6.3.7, “Advantages and drawbacks”.

6.5. NBP

6.5.1. How does it work ?

The PXE client ask the Pxe Server for its configuration then shows a menu. User selects an entry or waits until the timeout expires. Then the client loads the kernel and its initrd on a tftp server defined in the pxe.conf file. NBP is the only client that can use the menu features is NBP. See Section 3.2, “Options in pxe.conf” for details.

6.5.2. Where can I find it ?

NBP is the PXE client designed by RedHat ™ available in the source rpm of pxe [14] NBP is also packaged in pxe-1.2.0 rpm from the Mandrake Linux distribution. NBP bootstrap is usually called linux.0 and stored in /tftpboot/X86PC/linux/. See Section 3.2, “Options in pxe.conf” for details.



[8] i.e Etherboot is not compilant.

[9] Syslinux contains a program called "gethostip" that helps you build this name from the IP address.