create new tag
view all tags

PXE Booting

LCFG Sprint 14 March 2019

Target build server: build-test.is.ed.ac.uk

next-server build-test.is.ed.ac.uk; filename "lpxelinux.0";

I also created a devel version of the pxeclient component to allow the IP address of a profile to be put in the pxeclient.mac resource. Users on the IS Devolved LCFG service can enable this by:

!profile.version_pxeclient mSET(4_dev)

Here's the patch from profile version 4.

# diff -u pxeclient-4*
--- pxeclient-4.def   2018-07-04 11:55:46.000000000 +0100
+++ pxeclient-4_dev.def   2019-03-05 16:01:43.012355465 +0000
@@ -8,13 +8,15 @@
+#include "validate.h"
 schema 4
 #define MAC /^(([0-9A-Fa-f]{1,2}(:|-)){5}[0-9A-Fa-f]{2})$/
 hostname <%profile.node%>
-@mac %string(mac address): MAC
+@mac %string(mac address): MAC | ( vIPADDR )
 mac 00:00:00:00:00:00

  • allow pxeserver.boot_mode_entry to be multivalued and generate config files for each boot mode.
  • How about extending the component to download and mount ISO images, then be able to use the paths in its config files? Or at least loopback mount from a local path - maybe a method to download the ISOs? No. Simpler to create a systemd config to either do or call a script to loopback mount the ISOs in a directory.
  • Add valid IP address to pxeclient.mac resource https://bugs.lcfg.org/show_bug.cgi?id=1105


In engineering we're using PXELINUX to network boot machines in order to build the OS. It turns out that the version of PXELINUX we're using (TODO replace this with the version from the syslinux rpm and see if it still works) supports booting from http targets. This reduces the loading time from about 60s to under 10s.

commit 45be362cf7b4749f644f62c583c4b9f4b0918190
Author: bduncan/eng.admin@EASE.ED.AC.UK <bduncan/eng.admin@EASE.ED.AC.UK@d7b6154b-7022-0410-a36f-deca04b7da91>
Date:   Wed May 30 12:26:48 2018 +0000

    Use http via PXELINUX for SL7.
    git-svn-id: https://lcfg.is.ed.ac.uk/svn/see_policies@6836 d7b6154b-7022-0410-a36f-deca04b7da91

diff --git a/options/pxeserver.h b/options/pxeserver.h
index 1e25293..c49eec6 100644
--- a/options/pxeserver.h
+++ b/options/pxeserver.h
@@ -71,8 +71,8 @@ pxeserver.initrd_sl6_64       lcfg64/initram.img
 pxeserver.options_sl6_64       nomodeset root=nfs:pxe.see.ed.ac.uk:/nfsroot/lcfg64
 pxeserver.descr_sl7    LCFG SL^7 64 bit install
-pxeserver.kernel_sl7   lcfg64_sl7/vmlinuz
-pxeserver.initrd_sl7   lcfg64_sl7/initram.img
+pxeserver.kernel_sl7   http://pxe.see.ed.ac.uk/lcfg64_sl7/vmlinuz
+pxeserver.initrd_sl7   http://pxe.see.ed.ac.uk/lcfg64_sl7/initram.img
 pxeserver.options_sl7  nomodeset root=nfs:pxe.see.ed.ac.uk:/nfsroot/lcfg64_sl7
 pxeserver.descr_memtest ^MemTest86+

It should also be possible to host the kernel and initrd on www.lcfg.org and boot directly. I didn't test this.

iPXE also supports booting from the web. You can give it a script (e.g. http://boot.ipxe.org/demo/boot.php) which offers kernels and initrds. It can also use menus and seems more flexible and easier to configure than syslinux.

It's worth noting what the syslinux page has to say about http support:

Older versions of PXELINUX supported HTTP by using a hybrid bootloader that also contained gPXE/iPXE, with such images named either gpxelinux.0 or ipxelinux.0.

Since version 5.10, a special PXELINUX binary, lpxelinux.0, natively supports HTTP and FTP transfers, greatly increasing load speed and allowing for standard HTTP scripts to present PXELINUX's configuration file. To use HTTP or FTP, use standard URL syntax as filename; use DHCP options to transmit a suitable URL prefix to the client, or use the "pxelinux-options" tool provided in the "utils" directory to program it directly into the lpxelinux.0 file.

While using HTTP/FTP (syntax), trying to use pxelinux.0 (i.e. without the letter "l" prefix) without iPXE/gPXE running underneath, will result in a "file not found" warning without any explanation as to the cause!

-- Bruce Duncanedacuk - 2018-05-31



Topic revision: r6 - 2019-03-14 - kenny
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback