30.2. Network Boot Configuration

The next step is to copy the files necessary to start the installation to the tftp server so they can be found when the client requests them. The tftp server is usually the same server as the network server exporting the installation tree.
The PXE boot configuration procedure differs for BIOS and EFI. A separate yaboot configuration procedure is provided for Power Systems servers.

Note

Red Hat Satellite has the ability to automate the setup of a PXE server. See the Red Hat Satellite User Guide for more information.

30.2.1. Configuring PXE Boot for BIOS

  1. If tftp-server is not yet installed, run yum install tftp-server.
  2. In the tftp-server config file at /etc/xinetd.d/tftp, change the disabled parameter from yes to no.
  3. Configure your DHCP server to use the boot images packaged with SYSLINUX. (If you do not have a DHCP server installed, refer to the DHCP Servers chapter in the Red Hat Enterprise Linux Deployment Guide.)
    A sample configuration in /etc/dhcp/dhcpd.conf might look like:
      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;
    
      subnet 10.0.0.0 netmask 255.255.255.0 {
              option routers 10.0.0.254;
              range 10.0.0.2 10.0.0.253;
    
              class "pxeclients" {
                      match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
                      next-server 10.0.0.1;
    
                      if option arch = 00:06 {
                              filename "pxelinux/bootia32.efi";
                      } else if option arch = 00:07 {
                              filename "pxelinux/bootx64.efi";
                      } else {
                              filename "pxelinux/pxelinux.0";
                      }
              }
    
              host example-ia32 {
                      hardware ethernet XX:YY:ZZ:11:22:33;
                      fixed-address 10.0.0.2;
              }
      }
    
  4. You now need the pxelinux.0 file from the SYSLINUX package in the ISO image file. To access it, run the following commands as root:
    mount -t iso9660 /path_to_image/name_of_image.iso /mount_point -o loop,ro
    cp -pr /mount_point/Packages/syslinux-version-architecture.rpm /publicly_available_directory
    umount /mount_point
    Extract the package:
    rpm2cpio syslinux-version-architecture.rpm | cpio -dimv
  5. Create a pxelinux directory within tftpboot and copy pxelinux.0 into it:
    mkdir /var/lib/tftpboot/pxelinux
    cp publicly_available_directory/usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/pxelinux
  6. Create a pxelinux.cfg directory within pxelinux:
    mkdir /var/lib/tftpboot/pxelinux/pxelinux.cfg
  7. Add a config file to this directory. The file should either be named default or named after the IP address, converted into hexadecimal format without delimiters. For example, if your machine's IP address is 10.0.0.1, the filename would be 0A000001.
    A sample config file at /var/lib/tftpboot/pxelinux/pxelinux.cfg/default might look like:
    default vesamenu.c32
    prompt 1
    timeout 600
    
    display boot.msg
    
    label linux
      menu label ^Install or upgrade an existing system
      menu default
      kernel vmlinuz
      append initrd=initrd.img
    label vesa
      menu label Install system with ^basic video driver
      kernel vmlinuz
      append initrd=initrd.img xdriver=vesa nomodeset
    label rescue
      menu label ^Rescue installed system
      kernel vmlinuz
      append initrd=initrd.img rescue
    label local
      menu label Boot from ^local drive
      localboot 0xffff
    label memtest86
      menu label ^Memory test
      kernel memtest
      append -
    
    For instructions on how to specify the installation source, refer to Section 7.1.3, “Additional Boot Options”
  8. Copy the splash image into your tftp root directory:
    cp /boot/grub/splash.xpm.gz /var/lib/tftpboot/pxelinux/splash.xpm.gz
  9. Copy the boot images into your tftp root directory:
    cp /path/to/x86_64/os/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/pxelinux/rhel6/
  10. Boot the client system, and select the network device as your boot device when prompted.

30.2.2. Configuring PXE Boot for EFI

  1. If tftp-server is not yet installed, run yum install tftp-server.
  2. In the tftp-server config file at /etc/xinetd.d/tftp, change the disable parameter from yes to no.
  3. Create a directory within tftpboot for the EFI boot images, and then copy them from your boot directory. In these examples we will name the subdirectory pxelinux, but any other name could be used.
    mkdir /var/lib/tftpboot/pxelinux
    cp /boot/efi/EFI/redhat/grub.efi /var/lib/tftpboot/pxelinux/bootx64.efi
  4. Configure your DHCP server to use the EFI boot images packaged with GRUB. (If you do not have a DHCP server installed, refer to the DHCP Servers chapter in the Red Hat Enterprise Linux Deployment Guide.)
    A sample configuration in /etc/dhcp/dhcpd.conf might look like:
      option space PXE;
      option PXE.mtftp-ip    code 1 = ip-address;
      option PXE.mtftp-cport code 2 = unsigned integer 16;
      option PXE.mtftp-sport code 3 = unsigned integer 16;
      option PXE.mtftp-tmout code 4 = unsigned integer 8;
      option PXE.mtftp-delay code 5 = unsigned integer 8;
      option arch code 93 = unsigned integer 16; # RFC4578
    
      subnet 10.0.0.0 netmask 255.255.255.0 {
              option routers 10.0.0.254;
              range 10.0.0.2 10.0.0.253;
    
              class "pxeclients" {
                      match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
                      next-server 10.0.0.1;
    
                      if option arch = 00:06 {
                              filename "pxelinux/bootia32.efi";
                      } else if option arch = 00:07 {
                              filename "pxelinux/bootx64.efi";
                      } else {
                              filename "pxelinux/pxelinux.0";
                      }
              }
    
              host example-ia32 {
                      hardware ethernet XX:YY:ZZ:11:22:33;
                      fixed-address 10.0.0.2;
              }
      }
    
  5. Add a config file to /var/lib/tftpboot/pxelinux. The file should either be named efidefault or named after the IP address, converted into hexadecimal format without delimiters. For example, if your machine's IP address is 10.0.0.1, the filename would be 0A000001.
    A sample config file at /var/lib/tftpboot/pxelinux/efidefault might look like:
    default=0
    timeout=1
    splashimage=(nd)/splash.xpm.gz
    hiddenmenu
    title RHEL
            root (nd)
            kernel /rawhide-x86_64/vmlinuz
            initrd /rawhide-x86_64/initrd.img
    
    For instructions on how to specify the installation source, refer to Section 7.1.3, “Additional Boot Options”
  6. Copy the splash image into your tftp root directory:
    cp /boot/grub/splash.xpm.gz /var/lib/tftpboot/pxelinux/splash.xpm.gz
  7. Copy the boot images into your tftp root directory:
    cp /path/to/x86_64/os/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/pxelinux/rhel6/
  8. Boot the client system, and select the network device as your boot device when prompted.

30.2.3. Configuring for Power Systems Servers

  1. If tftp-server is not yet installed, run yum install tftp-server.
  2. In the tftp-server config file at /etc/xinetd.d/tftp, change the disabled parameter from yes to no.
  3. Configure your DHCP server to use the boot images packaged with yaboot. (If you do not have a DHCP server installed, refer to the DHCP Servers chapter in the Red Hat Enterprise Linux Deployment Guide.)
    A sample configuration in /etc/dhcp/dhcpd.conf might look like:
              host bonn {
                    filename "yaboot";
                    next-server             10.32.5.1;
                    hardware ethernet 00:0e:91:51:6a:26;
                    fixed-address 10.32.5.144;
            }
    
  4. You now need the yaboot binary file from the yaboot package in the ISO image file. To access it, run the following commands as root:
    mkdir /publicly_available_directory/yaboot-unpack
    mount -t iso9660 /path_to_image/name_of_image.iso /mount_point -o loop,ro
    cp -pr /mount_point/Packages/yaboot-version.ppc.rpm /publicly_available_directory/yaboot-unpack
    Extract the package:
    cd /publicly_available_directory/yaboot-unpack
    rpm2cpio yaboot-version.ppc.rpm | cpio -dimv
  5. Create a yaboot directory within tftpboot and copy the yaboot binary file into it:
    mkdir /var/lib/tftpboot/yaboot
    cp publicly_available_directory/yaboot-unpack/usr/lib/yaboot/yaboot /var/lib/tftpboot/yaboot
  6. Add a config file named yaboot.conf to this directory. A sample config file might look like:
    init-message = "\nWelcome to the Red Hat Enterprise Linux 6 installer!\n\n"
    timeout=60
    default=rhel6
    image=/rhel6/vmlinuz-RHEL6
            label=linux
            alias=rhel6
            initrd=/rhel6/initrd-RHEL6.img
            append="repo=http://10.32.5.1/mnt/archive/redhat/released/RHEL-6/6.x/Server/ppc64/os/"
            read-only
    
    For instructions on how to specify the installation source, refer to Section 7.1.3, “Additional Boot Options”
  7. Copy the boot images from the extracted ISO into your tftp root directory:
    cp /mount_point/images/ppc/ppc64/vmlinuz /var/lib/tftpboot/yaboot/rhel6/vmlinuz-RHEL6
    cp /mount_point/images/ppc/ppc64/initrd.img /var/lib/tftpboot/yaboot/rhel6/initrd-RHEL6.img
  8. Clean up by removing the yaboot-unpack directory and unmounting the ISO:
    rm -rf /publicly_available_directory/yaboot-unpack
    umount /mount_point
  9. Boot the client system, and select the network device as your boot device when prompted.