Labels

Thursday, October 09, 2014

Graphical PXE Boot Menu example

Using syslinux 4.02. This example has nested menus that use separate menu files. Also a pretty background.

--

UI vesamenu.c32                                
PROMPT 0                                    
TIMEOUT 600                                  
TOTALTIMEOUT 6000                            
ONTIMEOUT local                              
#MENU RESOLUTION 1024 768
MENU BACKGROUND pxebackground.png
MENU TITLE Boot Menu    
MENU AUTOBOOT Will boot the next device as configured in your BIOS in # second{,s}.
MENU TABMSG   Press the key to edit the boot parameters of the highlighted option.
#MENU NOTABMSG Editing of this option is disabled.                                    
MENU COLOR screen      0  #80ffffff #00000000 std      # background colour not covered by the splash image
MENU COLOR border      0  #ffffffff #ee000000 std      # The wire-frame border                          
MENU COLOR title       0  #ffff3f7f #ee000000 std      # Menu title text                                
MENU COLOR sel         0  #ff00dfdf #ee000000 std      # Selected menu option                          
MENU COLOR hotsel      0  #ff7f7fff #ee000000 std      # The selected hotkey (set with ^ in MENU LABEL)
MENU COLOR unsel       0  #ffffffff #ee000000 std      # Unselected menu options                        
MENU COLOR hotkey      0  #ff7f7fff #ee000000 std      # Unselected hotkeys (set with ^ in MENU LABEL)  
MENU COLOR tabmsg      0  #c07f7fff #00000000 std      # Tab text                                      
MENU COLOR timeout_msg 0  #8000dfdf #00000000 std      # Timout text                                    
MENU COLOR timeout     0  #c0ff3f7f #00000000 std      # Timout counter                                
MENU COLOR disabled    0  #807f7f7f #ee000000 std      # Disabled menu options, including SEPARATORs    
MENU COLOR cmdmark     0  #c000ffff #ee000000 std      # Command line marker - The '> ' on the left when editing an option
MENU COLOR cmdline     0  #c0ffffff #ee000000 std      # Command line - The text being edited
# Options below haven't been tested, descriptions may be lacking.
MENU COLOR scrollbar   0  #40000000 #00000000 std      # Scroll bar
MENU COLOR pwdborder   0  #80ffffff #20ffffff std      # Password box wire-frame border
MENU COLOR pwdheader   0  #80ff8080 #20ffffff std      # Password box header
MENU COLOR pwdentry    0  #80ffffff #20ffffff std      # Password entry field
MENU COLOR help        0  #c0ffffff #00000000 std      # Help text, if set via 'TEXT HELP ... ENDTEXT'
MENU WIDTH 80
MENU MARGIN 20
MENU PASSWORDMARGIN 3
MENU ROWS 6
MENU TABMSGROW 18
MENU CMDLINEROW 18
MENU ENDROW -1
MENU PASSWORDROW 11
MENU TIMEOUTROW 13
MENU VSHIFT 8
MENU PASSPROMPT Enter Password:
NOESCAPE 1
ALLOWOPTIONS 0
LABEL local
        MENU LABEL ^A) Boot Local Disk
        MENU DEFAULT
        localboot 0
MENU BEGIN workstations
        MENU TITLE Workstation Images
        LABEL Previous
        MENU LABEL ^B) Previous Menu
        MENU EXIT
        MENU SEPARATOR
        MENU INCLUDE workstations
MENU END
MENU BEGIN tools
        MENU TITLE Tools
        LABEL Previous
        MENU LABEL ^C) Previous Menu
        MENU EXIT
        MENU SEPARATOR
        MENU INCLUDE tools
MENU END​

PXE menu black screen flashing cursor


Some older machines don't always boot past vesamenu.c32 on later versions of syslinux (>4.02).  This is documented on the syslinux machine, search for issues with LOCALBOOT.
I had this recently with a render farm containing some BIOS versions that wouldn't localboot. For this reason we could create a separate menu file for machines that network (0A02CC). This file is called render.default and symlinked.
lrwxrwxrwx 1 root root   14 Oct  8 09:46 0A02CC -> render.default
-rw-r--r-- 1 root root 2703 Sep 29 11:46 default
-rw-r--r-- 1 root root  214 Oct  8 09:49 readme.txt
-rw-r--r-- 1 root root   98 Oct  8 09:42 render.default
[root@zeus pxelinux.cfg]# cat 0A02CC
DEFAULT menu.c32
PROMPT 0
TIMEOUT 50
ONTIMEOUT local
MENU TITLE Render Node Menu

LABEL local
        MENU LABEL Boot Local Disk
        COM32 chain.c32
        APPEND hd0
The LOCALBOOT cannot work properly on some supermicro servers. The solution is using chain.c32 module and following syntax to boot up the first hard drive​