How to add a custom splash screen when booting over PXE

Solution Unverified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL) 7

Issue

How to add a custom splash screen when booting over PXE (Preboot Execution Environment).

Resolution

  1. Install documentation, tools for image processing and other important files:

    # yum install syslinux netpbm-progs syslinux-perl
    

    Or copy content of RPM from a ISO file intended for PXE boot:

    # mount -o loop /rhel/RHEL-7.7-20190723.1-Client-x86_64-dvd1.iso /media/
    $ mkdir tmp
    $ cd tmp
    $ rpm2cpio /media/Packages/syslinux-4.05-15.el7.x86_64.rpm | cpio -dimv
    

    Documentation is available in /usr/share/doc/syslinux/syslinux.txt

  2. Perform a basic test using a standard splash screen:

    $ gunzip -cd /usr/share/doc/syslinux/sample/syslogo.ppm.gz | ppmtolss16 > /tftpboot/syslogo.lss
    $ cp /usr/share/doc/syslinux/sample/sample.msg /tftpboot/
    $ cat /tftpboot/pxelinux.cfg/default
    default linux
    prompt 1
    timeout 600
    
    display sample.msg
    
    label linux
    ...
    
    $ cat /tftpboot/sample.msg 
    sample.msg
    Note that <Ctrl-P>...<Ctrl-W> can be used to delimit something
    that is effectively a comment.
    This message is displayed before the image.
    syslogo.lss
    This message is displayed after the image.
    ...
    

    If the above steps work for you (the PXE syslogo.lss image appears), continue with the following steps:

  3. Prepare your own image splash.png (640x480 16-color mode) in GIMP and convert it to lss format:

    $ pngtopnm splash.png | ppmtolss16 > /tftpboot/splash.lss
    

    (you can try some other parameters for image conversion, see /usr/share/doc/syslinux-4.05/sample/Makefile)

    $ hexdump -C /tftpboot/boot.msg
    00000000  18 73 70 6c 61 73 68 2e  6c 73 73 0a              |.splash.lss.|
    0000000c
    
    $ cat /pxelinux.cfg/default 
    default linux
    prompt 0
    
    display boot.msg
    
    label linux
    ...
    
  4. Verify that PXE boot now shows your splash screen and it instantly boots the selected kernel from the section linux.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments