[syslinux] Syslinux EFI + TFTPBOOT Support

Steven Shiau steven at nchc.org.tw
Fri Mar 7 03:32:18 PST 2014


On 2014年03月07日 18:24, Ady wrote:
> Hi Steven,
>
> Perhaps this could be of some basic sample/help, being based on 
> Debian:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720589
>
> where:
> _ if gpxelinux.0 is needed, it should probably be replaced by ipxe.
> _ lpxelinux.0 (from official Syslinux archive) could optionally be 
> added.
>
> _ from the Syslinux official archive, "efi32/efi/syslinux.efi" should 
> be copied as:
> tftp/
>     +-- pxelinux
>         +-- bootia32.efi
>
> _ from the Syslinux official archive, "efi64/efi/syslinux.efi" should 
> be copied as:
> tftp/
>     +-- pxelinux
>         +-- bootx64.efi
>
> The layout of the TFTP server being used is included in there too.
>
> Regards,
> Ady.
Hi Ady,
Thanks.
Yes, I followed
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720589
to test.
However, somehow I had similar issue like this:
http://www.syslinux.org/archives/2013-June/020242.html
My screen only shows:
====================
Getting cached packets
My IP is 192.168.1.3
====================
(See attached file "uefi-netboot.png")

I am sure I use the precompiled binaries from 6.03-pre7 from kernel.org:
strings /tftpboot/nbi_img/bootx64.efi | grep -i "^syslinux 6.03"
Syslinux 6.03 (EFI; 6.03-pre7)

I also compared its sha1sum (attached file "sha1sum.txt") and confirmed
that.
>From the system log file (attached file "daemon-log.txt"), apparently
the uEFI x86_64 did try to fetch bootx64.efi and ldlinux.e64.
My dhcp, pxelinux, tftpd config files are attached, too. The files list
in /tftpboot/nbi_img/ is attached in file "tree.txt".

My server is running Debian Wheezy, and I tested the client on Lenovo
X230, and VMWare WS 10.0 (firmware = "efi")
Both clients gave me the same issue.

If I switch to boot from PXE BIOS by changing the setting in the BIOS,
it works.

Where am I wrong?
Thanks in advance.

Steven.

-- 
Steven Shiau <steven _at_ nchc org tw> <steven _at_ stevenshiau org>
National Center for High-performance Computing, Taiwan. http://www.nchc.org.tw
Public Key Server PGP Key ID: 4096R/47CF935C
Fingerprint: 0240 1FEB 695D 7112 62F0  8796 11C1 12DA 47CF 935C

-------------- next part --------------
A non-text attachment was scrubbed...
Name: uefi-netboot.png
Type: image/png
Size: 3083 bytes
Desc: not available
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20140307/1c688126/attachment.png>
-------------- next part --------------
ddf2af2d65850d7d51e21ca2ef7bb165e4d1405c  /tftpboot/nbi_img/bootia32.efi
d0ca7d52228231b08c36967262cb796be9e71499  /tftpboot/nbi_img/bootx64.efi
a8fccbd2ab32f4aa628ac5c7704e8e4767eea0fb  /tftpboot/nbi_img/client_kernel_arch.txt
07b859038f97b769c3a5c5112b01d775157bc54c  /tftpboot/nbi_img/drblwp.png
813fa09f2278b0b83b67c6d2bda68a46cd83234d  /tftpboot/nbi_img/fdos1440_drbl.img
9c942087c3f1bcf322cbce59463637aa714615f6  /tftpboot/nbi_img/gpxelinux.0
2d3bdd9ef889f17ffeb3409e551cfa70dfc547c2  /tftpboot/nbi_img/initrd-pxe.3.12-0.bpo.1-amd64.img
2d3bdd9ef889f17ffeb3409e551cfa70dfc547c2  /tftpboot/nbi_img/initrd-pxe.img
9fd26276009d2502b45a3910d923df0860ba5b3e  /tftpboot/nbi_img/kernel_version_in_initrd.txt
505c374cb843d096e21a5b8aa5edeaf0b3addaa7  /tftpboot/nbi_img/ldlinux.c32
3f138f80d539a195f82684381ea63f1849481d33  /tftpboot/nbi_img/ldlinux.e32
55f17d57e1790071af0cb84e0ac6109a210f06ca  /tftpboot/nbi_img/ldlinux.e64
03bbf9cf85051a1d77fd8e520f9217f61886585f  /tftpboot/nbi_img/lpxelinux.0
e261008ae43dedabecf116abd9ddd9d404e6a6c7  /tftpboot/nbi_img/memtest86
38991067d531932a1b685c122d2ffd4773238b30  /tftpboot/nbi_img/MEMTEST86+_VERSION
1c25091f7d4df6204569aea7bb90149a4272c0b2  /tftpboot/nbi_img/pxelinux.0
86922fc94602a2fc70dee83a69ab0d90aefa8d34  /tftpboot/nbi_img/PXELINUX_VERSION
8909ef75fb9edd1b8ccece72de5bb2cd02ab00e2  /tftpboot/nbi_img/vmlinuz-3.12-0.bpo.1-amd64
8909ef75fb9edd1b8ccece72de5bb2cd02ab00e2  /tftpboot/nbi_img/vmlinuz-pxe
-------------- next part --------------
Mar  7 19:16:03 dhcpd: Client 0:c:29:6e:ac:93 requests 1:2:3:4:5:6:c:d:f:11:12:16:17:1c:28:29:2a:2b:32:33:36:3a:3b:3c:42:43:61:80:81:82:83:84:85:86:87 - PXEClient:Arch:00007:UNDI:003000 - no dhcp-client-id
Mar  7 19:16:03 dhcpd: WARNING: site-local option codes less than 224 have been deprecated by RFC3942.  You have options listed in site local space pxelinux that number as low as 208.  Please investigate if these should be declared as regular options rather than site-local options, or migrated up past 224.
Mar  7 19:16:03 dhcpd: DHCPDISCOVER from 00:0c:29:6e:ac:93 via eth1
Mar  7 19:16:04 dhcpd: DHCPOFFER on 192.168.1.3 to 00:0c:29:6e:ac:93 via eth1
Mar  7 19:16:06 dhcpd: Client 0:c:29:6e:ac:93 requests 1:2:3:4:5:6:c:d:f:11:12:16:17:1c:28:29:2a:2b:32:33:36:3a:3b:3c:42:43:61:80:81:82:83:84:85:86:87 - PXEClient:Arch:00007:UNDI:003000 - no dhcp-client-id
Mar  7 19:16:06 dhcpd: DHCPREQUEST for 192.168.1.3 (192.168.1.182) from 00:0c:29:6e:ac:93 via eth1
Mar  7 19:16:06 dhcpd: DHCPACK on 192.168.1.3 to 00:0c:29:6e:ac:93 via eth1
Mar  7 19:16:06 dhcpd: Client 0:c:29:6e:ac:93 requests 1:2:3:4:5:6:c:d:f:11:12:16:17:1c:28:29:2a:2b:32:33:36:3a:3b:3c:42:43:61:80:81:82:83:84:85:86:87 - PXEClient:Arch:00007:UNDI:003000 - no dhcp-client-id
Mar  7 19:16:06 in.tftpd[24451]: RRQ from 192.168.1.3 filename bootx64.efi
Mar  7 19:16:06 in.tftpd[24451]: tftp: client does not accept options
Mar  7 19:16:06 in.tftpd[24452]: RRQ from 192.168.1.3 filename bootx64.efi
Mar  7 19:16:07 dhcpd: DHCPREQUEST for 192.168.1.3 (192.168.1.182) from 00:0c:29:6e:ac:93 via eth1
Mar  7 19:16:07 dhcpd: DHCPACK on 192.168.1.3 to 00:0c:29:6e:ac:93 via eth1
Mar  7 19:16:20 in.tftpd[24455]: RRQ from 192.168.1.3 filename ldlinux.e64
-------------- next part --------------
# Generated by DRBL. 
# Do NOT modify this file unless you know what you are doing!

default-lease-time			300;
max-lease-time				300;
option subnet-mask			255.255.255.0;
option domain-name-servers  		8.8.8.8,8.8.4.4;
option domain-name			"nchc.org.tw";	
ddns-update-style                       none;
server-name 				drbl;

allow booting;
allow bootp;
    
option arch code 93 = unsigned integer 16;
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;

#filename = "pxelinux.0";
site-option-space "pxelinux";
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);
}
if option arch = 00:06 {
    filename "bootia32.efi";
    # option pxelinux.configfile "pxelinux.cfg/efi32";
} else if option arch = 00:07 {
    filename "bootx64.efi";
    # option pxelinux.configfile "pxelinux.cfg/efi64";
} else {
    filename "pxelinux.0";
    # option pxelinux.configfile "pxelinux.cfg/bios";
}

## Uncomment the following "if block" when you have some buggy PXE NIC card (such as annoying sis900 NIC). Remember to modify the MAC vendor prefix and restart dhcpd service!!!
## This is a workround for some network card with BAD PXE code in firmware.
## It will only affect those clients with MAC vendor prefix you assigned.
## Ref: http://syslinux.zytor.com/archives/2005-August/005640.html

#if substring (option vendor-class-identifier, 0, 3) = "PXE" {
#     # **************************************************************
#     # ***MODIFY*** the MAC vendor prefix of client network card here.
#     # **************************************************************
#     # For annoying sis900 network card, maybe it is 00:07:95, 00:0C:6E...
#     if substring (hardware, 1, 3) = 00:0C:6E {
#         # sis900.zpxe is specially for sis900 NIC, you can download it from 
#         # http://rom-o-matic.net/etherboot/etherboot-5.4.4/contrib/rom-o-matic
#         filename = "sis900.zpxe";
#     }
#}

# Uncomment the following to get the debug/verbose messages in system log. The messages like the following will be shown:
# Client 0:c:29:3b:34:fb requests 1:2:3:5:6:b:c:d:f:10:11:12:2b:36:3c:43:80:81:82:83:84:85:86:87 - PXEClient:Arch:00000:UNDI:002001 - no dhcp-client-id
# Client 0:c:29:3b:34:fb requests 1:3:6:c:f:1c:28:29:2a - DRBLClient - no dhcp-client-id
# Begin of log command
log(info, concat("Client ",
        binary-to-ascii(16, 8, ":", substring(hardware, 1, 6)),
        " requests ",
        binary-to-ascii(16, 8, ":", option dhcp-parameter-request-list),
        " - ",
        pick-first-value(option vendor-class-identifier, "no vendor-id"),
        " - ",
        pick-first-value(option dhcp-client-identifier, "no dhcp-client-id"))
   );
# End of log command

# This class 'DRBL-Client' defines 3 kind of clients: PXE, Etherboot (1st stage) or DRBL client (2nd stage, i.e. in network initrd/initramfs (mkpxeinitrd-net)) to lease IP address.  This will only affect 'range' statement only, not the 'host' statement.
# Note! The following line(s) in the pool statement: 'allow members of "DRBL-Client";' is/are commented to disable this mechanism by default.
# If you do want to use this mechanism, uncomment all 'allow members of "DRBL-Client";', then only PXE, etherboot and DRBL client can lease IP address from this DHCP service.
# ///NOTE/// In summary, two cases you can turn on this mechanism:
# (1) This DRBL server is not used as a clonezilla server.
# (2) This DRBL server is used as a Clonezilla server, with the following conditions:
#     (a) 'range' statement is used in this DRBL service.
#     (b) There is an existing DHCP service which can provide IP address leases to the restored OS (either GNU/inux or MS Windows) in the client. Otherwise if you uncomment 'allow members of "DRBL-Client";', restored OS won't be able to lease IP address.

# The DRBL client class: PXE, Etherboot or DRBL client
class "DRBL-Client" {
  match if 
  (substring(option vendor-class-identifier, 0, 9) = "PXEClient") or
  (substring(option vendor-class-identifier, 0, 9) = "Etherboot") or
  (substring(option vendor-class-identifier, 0, 10) = "DRBLClient") ;
}

# If you want to use special port for DHCP service, edit here:
# For more info, ref: http://drbl.sourceforge.net/faq/index.php#path=./2_System&entry=37_coexist_with_existing_dhcp.faq
# local-port 1067;
# remote-port 1068;

subnet 192.168.1.0 netmask 255.255.255.0 {
    option subnet-mask	255.255.255.0;
    option routers 192.168.1.182;
    next-server 192.168.1.182;

    pool {
      # allow members of "DRBL-Client";
      range 192.168.1.1 192.168.1.3;
    }
}

subnet 192.168.120.0 netmask 255.255.255.0 {
    option subnet-mask	255.255.255.0;
    option routers 192.168.120.254;
    next-server 192.168.120.254;

    pool {
      # allow members of "DRBL-Client";
      range 192.168.120.1 192.168.120.3;
    }
}

-------------- next part --------------
# Created by generate-pxe-menu! Do NOT edit unless you know what you are doing! 
# Keep those comment "MENU DEFAULT" and "MENU HIDE"! Do NOT remove them.
# Note!!! If "serial" directive exists, it must be the first directive

default vesamenu.c32
timeout 70
prompt 0
noescape 1
MENU MARGIN 5
MENU BACKGROUND drblwp.png
# Set the color for unselected menu item and timout message
MENU COLOR UNSEL 7;32;41 #c0000090 #00000000
MENU COLOR TIMEOUT_MSG 7;32;41 #c0000090 #00000000
MENU COLOR TIMEOUT 7;32;41 #c0000090 #00000000
MENU COLOR HELP 7;32;41 #c0000090 #00000000

# MENU MASTER PASSWD

say **********************************************
say Welcome to DRBL.
say NCHC Free Software Labs, Taiwan.
say http://drbl.org; http://drbl.nchc.org.tw
say **********************************************

# Allow client to edit boot parameters
ALLOWOPTIONS 1

# Set PATH to bios/, which is relative to PXE root dir (/tftpboot/nbi_img/pxelinux.cfg).
PATH efi64/

# simple menu title
MENU TITLE DRBL (http://drbl.org)

label drbl
  MENU DEFAULT
  # MENU HIDE
  MENU LABEL Debian 7.4 Linux (DRBL mode, mostly local resources)
  # MENU PASSWD
  kernel vmlinuz-pxe
  append initrd=initrd-pxe.img devfs=nomount drblthincli=off selinux=0 quiet    
  TEXT HELP
  * DRBL version: 2.7.31-drbl1. (C) 2003-2014, NCHC, Taiwan
  * Disclaimer: DRBL comes with ABSOLUTELY NO WARRANTY
  ENDTEXT

label clonezilla
  # MENU DEFAULT
  MENU HIDE
  MENU LABEL Clonezilla
  # MENU PASSWD
  kernel vmlinuz-pxe
  append initrd=initrd-pxe.img devfs=nomount drblthincli=off selinux=0 quiet text 1    
  TEXT HELP
  * Clonezilla version: 3.9.35-drbl1. (C) 2003-2014, NCHC, Taiwan
  * Disclaimer: Clonezilla comes with ABSOLUTELY NO WARRANTY
  ENDTEXT

label local
  # MENU DEFAULT
  # MENU HIDE
  MENU LABEL Local operating system (if available)
  # MENU PASSWD
  # 2 method to boot local device:
  # (1) For localboot 0, it is decided by boot order in BIOS, so uncomment the follow 1 line if you want this method:
  # localboot 0

  # (2) For chain.c32, you can assign the boot device.
  # Ref: extlinux.doc from syslinux
  # Syntax: APPEND [hd|fd]<number> [<partition>]
  # [<partition>] is optional.
  # Ex:
  # Second partition (2) on the first hard disk (hd0);
  # Linux would *typically* call this /dev/hda2 or /dev/sda2, then it's "APPEND hd0 2"
  #
  kernel chain.c32
  append hd0
  TEXT HELP
  Boot local OS from first hard disk if it's available
  ENDTEXT

# Note! *.bin is specially purpose for syslinux, 
# Do NOT use memtest86.bin, use memtest86 instead of memtest86.bin
label memtest
  # MENU DEFAULT
  # MENU HIDE
  MENU LABEL Memory test using Memtest86+
  # MENU PASSWD
  kernel memtest86
  TEXT HELP
  Run memory test using Memtest86+ Memtest86 v4.20
  ENDTEXT

# ref: http://syslinux.zytor.com/memdisk.php
label fdos
  # MENU DEFAULT
  MENU HIDE
  MENU LABEL FreeDOS
  # MENU PASSWD
  kernel memdisk
  append initrd=fdos1440_drbl.img
  TEXT HELP
  Run FreeDOS
  ENDTEXT

label drbl-terminal
  # MENU DEFAULT
  MENU HIDE
  MENU LABEL Debian 7.4 Linux (Terminal mode, mostly remote resources)
  # MENU PASSWD
  kernel vmlinuz-pxe
  append initrd=initrd-pxe.img devfs=nomount drblthincli=on quiet
  TEXT HELP
  Run DRBL in terminal mode.
  ENDTEXT

# Example for AoE booting
label AoE-client
  # MENU DEFAULT
  MENU HIDE
  MENU LABEL Diskless client (AoE booting)
  # MENU PASSWD
  kernel sanboot.c32
  append aoe:e0.0
  TEXT HELP
  Boot from AoE device
  ENDTEXT

# Example for Xen client. ///NOTE/// You might have to copy the required file, e.g. xen-3.0.3-1-i386-pae.gz in this case, from /boot to /tftpboot/nbi_img manually.
# label Xen client
#   # MENU DEFAULT
#   MENU HIDE
#   MENU LABEL Xen client 
#   # MENU PASSWD
#   kernel mboot.c32
#   append xen-3.0.3-1-i386-pae.gz --- vmlinuz-2.6.18-6-xen-vserver-686 root=/dev/sda1 ro console=tty0 --- initrd-pxe.2.6.18-6-xen-vserver-686.img
#   TEXT HELP
#   DRBL client running on Xen kernel
#   ENDTEXT

# Example for Clonezilla live PXE booting
# //NOTE// Remember to change the file names to match your files and check parameters in syslinux/syslinux.cfg from the zip file, copy them to here. It might be different from here, say vmlinuz1 path maybe different.
#label Clonezilla Live
#  # MENU DEFAULT
#  MENU HIDE
#  MENU LABEL Clonezilla Live
#  # MENU PASSWD
#  kernel vmlinuz1
#  append initrd=initrd1.img boot=live union=aufs noswap noprompt nolocales ip=frommedia vga=788 fetch=tftp://$YOUR_SERVER_IP/filesystem.squashfs
#  TEXT HELP
#  Boot Clonezilla live via network
#  ENDTEXT


# Example for GParted live PXE booting
# //NOTE// Remember to change the file names to match your files and check parameters in syslinux/syslinux.cfg from the zip file, copy them to here. It might be different from here, say vmlinuz1 path maybe different.
#label GParted Live
#  # MENU DEFAULT
#  MENU HIDE
#  MENU LABEL GParted Live
#  # MENU PASSWD
#  kernel vmlinuz1
#  append initrd=initrd1.img boot=live union=aufs noswap noprompt ip=frommedia vga=788 fetch=tftp://$YOUR_SERVER_IP/filesystem.squashfs
#  TEXT HELP
#  Boot GParted live via network
#  ENDTEXT

-------------- next part --------------
/tftpboot/nbi_img/
├── bios
│   ├── chain.c32
│   ├── hdt.c32
│   ├── isolinux.bin
│   ├── libcom32.c32
│   ├── libutil.c32
│   ├── mboot.c32
│   ├── mbr.bin
│   ├── memdisk
│   ├── menu.c32
│   ├── sanboot.c32
│   └── vesamenu.c32
├── bootia32.efi
├── bootx64.efi
├── client_kernel_arch.txt
├── drblwp.png
├── efi32
│   ├── chain.c32
│   ├── hdt.c32
│   ├── libcom32.c32
│   ├── libutil.c32
│   ├── mboot.c32
│   ├── menu.c32
│   ├── sanboot.c32
│   └── vesamenu.c32
├── efi64
│   ├── chain.c32
│   ├── hdt.c32
│   ├── libcom32.c32
│   ├── libutil.c32
│   ├── mboot.c32
│   ├── menu.c32
│   ├── sanboot.c32
│   └── vesamenu.c32
├── fdos1440_drbl.img
├── gpxelinux.0
├── initrd-pxe.3.12-0.bpo.1-amd64.img
├── initrd-pxe.img -> initrd-pxe.3.12-0.bpo.1-amd64.img
├── kernel_version_in_initrd.txt
├── ldlinux.c32
├── ldlinux.e32
├── ldlinux.e64
├── lpxelinux.0
├── memtest86
├── MEMTEST86+_VERSION
├── pxelinux.0
├── pxelinux.cfg
│   └── default
├── PXELINUX_VERSION
├── vmlinuz-3.12-0.bpo.1-amd64
└── vmlinuz-pxe -> vmlinuz-3.12-0.bpo.1-amd64

4 directories, 47 files
-------------- next part --------------
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot/nbi_img"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure --ipv4 -v -v -v"


More information about the Syslinux mailing list