Labels

Android (1) Apache (1) bash (2) boost (2) C (34) C++ (2) cheatsheet (2) CLion (6) css (3) Debian (33) DL (17) Docker (2) Dreamweaver (2) Eclipse (3) fail2ban (5) git (5) GitHub (4) Hacking (3) html (8) http (1) iOS (1) iPad (1) IRC (1) Java (33) javascript (3) Linux (174) Mac (20) Machine Learning (1) mySQL (51) Netbeans (5) Networking (1) Nexus (1) OpenVMS (6) Oracle (2) Pandas (3) php (17) Postgresql (8) Python (9) raid (1) RedHat (14) Samba (2) Slackware (50) SQL (14) svn (1) tar (1) ThinkPad (1) Virtualbox (3) Visual Basic (1) Visual Studio (1) Windows (2)

Sunday, 8 February 2026

Slackware minimum PXE boot example

For this example, we will be using dnsmasq on Slackware 14.2 with the Slackware 15 mirror.


1). Create a Slackware mirror locally.

Get the mirror from: http://slackware.uk/slackware/slackware64-15.0/ or an alt.

Create a location for your mirror, mine is /var/STORAGE/slackware_mirror

then cd into the dir and using rsync, get the mirror: 

rsync -av --exclude=source/ rsync://slackware.uk/slackware/slackware64-15.0/ .

Create a link in /srv with ln -s /var/STORAGE/slackware_mirror slackware

The contents of my /srv look like:

lrwxrwxrwx  1 root root   8 Nov 23  2018 httpd -> /var/www
lrwxrwxrwx  1 root root  29 Feb  6 21:19 slackware -> /var/STORAGE/slackware_mirror
lrwxrwxrwx  1 root root   8 Nov 23  2018 www -> /var/www

So we have /var/STORAGE/slackware_mirror/Slackware64_15.0 which looks like:

drwxr-xr-x 12  500  500    1064 Feb  6 23:52 .
drwxr-xr-x  3  500  500      80 Feb  7 17:34 ..
-rw-r--r--  1  500  500    5767 Feb  2  2022 ANNOUNCE.15.0
-rw-r--r--  1  500  500   16609 Mar 30  2022 CHANGES_AND_HINTS.TXT
-rw-r--r--  1  500  500 1442343 Feb  6 23:52 CHECKSUMS.md5
-rw-r--r--  1  500  500     232 Feb  6 23:52 CHECKSUMS.md5.asc
-rw-r--r--  1  500  500   17976 Jun 10  1994 COPYING
-rw-r--r--  1  500  500   35147 Jun 30  2007 COPYING3
-rw-r--r--  1  500  500   19573 Jun 23  2016 COPYRIGHT.TXT
-rw-r--r--  1  500  500     616 Oct  2  2006 CRYPTO_NOTICE.TXT
-rw-r--r--  1  500  500 2294794 Feb  6 23:48 ChangeLog.txt
drwxr-xr-x  3  500  500      72 Mar 20  2013 EFI
-rw-r--r--  1  500  500 1884083 Feb  6 23:52 FILELIST.TXT
-rw-r--r--  1  500  500    1572 Aug 29  2012 GPG-KEY
-rw-r--r--  1  500  500  864745 Feb  2  2022 PACKAGES.TXT
-rw-r--r--  1  500  500    8034 Feb  2  2022 README.TXT
-rw-r--r--  1  500  500    3635 Feb  2  2022 README.initrd
-rw-r--r--  1  500  500   34162 Jan 30  2022 README_CRYPT.TXT
-rw-r--r--  1  500  500    8754 Mar 30  2022 README_LVM.TXT
-rw-r--r--  1  500  500   19658 Jun 18  2013 README_RAID.TXT
-rw-r--r--  1  500  500    7928 Jul 19  2018 README_UEFI.TXT
-rw-r--r--  1  500  500    7613 Feb  3  2022 RELEASE_NOTES
-rw-r--r--  1  500  500   13855 Dec  8  2008 SPEAKUP_DOCS.TXT
-rw-r--r--  1  500  500   17294 Dec  8  2008 SPEAK_INSTALL.TXT
-rw-r--r--  1  500  500   57187 Feb  1  2022 Slackware-HOWTO
-rw-r--r--  1  500  500    8700 Jan 26  2022 UPGRADE.TXT
drwxr-xr-x 19  500  500    2064 Dec 27 22:04 extra
drwxr-xr-x  3  500  500     368 Feb  2  2022 isolinux
drwxr-xr-x  5  500  500     160 Feb  2  2022 kernels
drwxr-xr-x  2  500  500     640 Aug  4  2023 pasture
drwxr-xr-x  3  500  500     240 Feb  6 23:52 patches
drwxr-xr-x 17  500  500     576 Feb  2  2022 slackware64
drwxr-xr-x 11 4015 4015    1032 Feb  6 23:52 slackware64-15.0
drwxr-xr-x  3  500  500     240 Jan 24 01:24 testing
drwxr-xr-x  2  500  500     216 Feb  2  2022 usb-and-pxe-installers


2). Configure tftproot structure.

Create a tftproot directory, such as /var/STORAGE/tftproot 

then we need to copy files from our mirror to the tftproot directory;

mkdir /var/STORAGE/tftproot/pxelinux.cfg

cp  /var/STORAGE/slackware_mirror/Slackware64_15.0/usb-and-pxe-installers/pxelinux.cfg_default /var/STORAGE/tftproot/pxelinux.cfg/default

cp /usr/share/syslinux/pxelinux.0 /var/STORAGE/tftproot/

cp /var/STORAGE/slackware_mirror/Slackware64_15.0/isolinux/message.txt /var/STORAGE/tftproot/

cp  /var/STORAGE/slackware_mirror/Slackware64_15.0/isolinux/f2.txt /var/STORAGE/tftproot/

cp  /var/STORAGE/slackware_mirror/Slackware64_15.0/isolinux/initrd.img /var/STORAGE/tftproot/

cp  -a /var/STORAGE/slackware_mirror/Slackware64_15.0/kernels /var/STORAGE/tftproot/


The structure of /var/STORAGE/tftproot/ should then look like:

drwxr-xr-x 4  500  500      280 Feb  8 11:15 .
drwxr-xr-x 9 root root      248 Feb  8 11:00 ..
-rw-r--r-- 1  500  500 13898240 Feb  7 17:26 bzImage
-rw-r--r-- 1  500  500      574 Feb  8 10:33 f2.txt
-rw-r--r-- 1  500  500 50455140 Feb  8 10:34 initrd.img
-rw-r--r-- 1  500  500    24576 Feb  7 17:28 isolinux.bin
drwxr-xr-x 5  500  500      160 Feb  2  2022 kernels
-rw-r--r-- 1  500  500      683 Feb  8 10:33 message.txt
-rw-r--r-- 1  500  500    26941 Feb  7 17:57 pxelinux.0
drwxr-xr-x 2  500  500       72 Feb  8 11:15 pxelinux.cfg

with kernels containing:

-rw-r--r-- 1 500 500  37 Feb  2  2022 VERSIONS.TXT
drwxr-xr-x 2 500 500 128 Feb  2  2022 huge.s
drwxr-xr-x 2 500 500  96 Mar 25  2011 memtest
drwxr-xr-x 2 500 500  80 Mar  2  2011 speakup.s

and pxelinux.cfg containing only default

Lastly, default should look like or similar to:

default huge.s
prompt 1
timeout 1200
display message.txt
F1 message.txt
F2 f2.txt
label huge.s
  kernel kernels/huge.s/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 nomodeset SLACK_KERNEL=huge.s
label kms.s
  kernel kernels/huge.s/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 SLACK_KERNEL=huge.s
label speakup.s
  kernel kernels/huge.s/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 nomodeset SLACK_KERNEL=huge.s
label memtest
  kernel kernels/memtest/memtest

3). Configure dnsmasq

In my case, I was allowing my router to take care of DHCP but it didnt allow me to add an entry for the boot file (option 67), it only allowed me to add the server ip (option 66) so some additional configuration of /etc/dnsmasq.conf was required as well as the basic config;

port=0 # this disables DNS
dhcp-range=192.168.254.0,proxy
pxe-service=x86PC,"Slackware Installer",pxelinux
enable-tftp
tftp-root=/var/STORAGE/tfptroot
dhcp-boot=pxelinux.0


Finally, make /etc/rc.d/rc.dnsmasq executable by chmod +x /etc/rc.d/rc.dnsmasq and then do /etc/rc.d/rc.dnsmasq start to start the service.

4). Testing

I tested in a basic vm guest, with one network adapter, set as bridged and deny promiscuous mode.
It should get its ip from the DHCP server which provides via option 66 the ip of the exe server.

The client (ini my case the vm guest) should then bring us to the familiar Slackware boot prompt.

On the server, we can run: tcpdump -vv -s0 -ni eth0 port 67 or port 68 or port 69 or port 4011

which will show us the activity similar to:

tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
11:17:27.157167 IP (tos 0x0, ttl 64, id 256, offset 0, flags [none], proto UDP (17), length 404)
    0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 08:00:27:7c:f8:76, length 376, xid 0xc1e3396b, secs 4, Flags [none] (0x0000)
 Client-Ethernet-Address 08:00:27:7c:f8:76
 Vendor-rfc1048 Extensions
   Magic Cookie 0x63825363
   DHCP-Message Option 53, length 1: Discover
   MSZ Option 57, length 2: 1472
   ARCH Option 93, length 2: 0
   NDI Option 94, length 3: 1.2.1
   Vendor-Class Option 60, length 32: "PXEClient:Arch:00000:UNDI:002001"
   User-Class Option 77, length 4: 
     instance#1: ERROR: invalid option
   Parameter-Request Option 55, length 23: 
     Subnet-Mask, Default-Gateway, Domain-Name-Server, LOG
     Hostname, Domain-Name, RP, MTU
     Vendor-Option, Vendor-Class, TFTP, BF
     Option 119, Option 128, Option 129, Option 130
     Option 131, Option 132, Option 133, Option 134
     Option 135, Option 175, Option 203
   T175 Option 175, length 24: 2969895296,2249199137,16846849,48956161,5889,18153729
   Client-ID Option 61, length 7: ether 08:00:27:7c:f8:76
   GUID Option 97, length 17: 0.111.172.41.67.159.174.69.33.165.23.148.149.98.17.150.202
11:17:27.157344 IP (tos 0xc0, ttl 64, id 9776, offset 0, flags [none], proto UDP (17), length 347)
    192.168.254.198.67 > 255.255.255.255.68: [udp sum ok] BOOTP/DHCP, Reply, length 319, xid 0xc1e3396b, secs 4, Flags [Broadcast] (0x8000)
 Client-Ethernet-Address 08:00:27:7c:f8:76
 file "pxelinux.0"
 Vendor-rfc1048 Extensions
   Magic Cookie 0x63825363
   DHCP-Message Option 53, length 1: Offer
   Server-ID Option 54, length 4: 192.168.254.198
   Vendor-Class Option 60, length 9: "PXEClient"
   GUID Option 97, length 17: 0.111.172.41.67.159.174.69.33.165.23.148.149.98.17.150.202
   Vendor-Option Option 43, length 37: 6.1.3.10.4.0.80.88.69.8.7.128.0.1.192.168.254.198.9.16.128.0.13.83.108.97.99.107.119.97.114.101.32.80.88.69.255
11:17:27.157915 IP (tos 0x0, ttl 64, id 514, offset 0, flags [none], proto UDP (17), length 416)
    0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 08:00:27:7c:f8:76, length 388, xid 0xc1e3396b, secs 11, Flags [none] (0x0000)
 Client-Ethernet-Address 08:00:27:7c:f8:76
 Vendor-rfc1048 Extensions
   Magic Cookie 0x63825363
   DHCP-Message Option 53, length 1: Request
   MSZ Option 57, length 2: 1472
   ARCH Option 93, length 2: 0
   NDI Option 94, length 3: 1.2.1
   Vendor-Class Option 60, length 32: "PXEClient:Arch:00000:UNDI:002001"
   User-Class Option 77, length 4: 
     instance#1: ERROR: invalid option
   Parameter-Request Option 55, length 23: 
     Subnet-Mask, Default-Gateway, Domain-Name-Server, LOG
     Hostname, Domain-Name, RP, MTU
     Vendor-Option, Vendor-Class, TFTP, BF
     Option 119, Option 128, Option 129, Option 130
     Option 131, Option 132, Option 133, Option 134
     Option 135, Option 175, Option 203
   T175 Option 175, length 24: 2969895296,2249199137,16846849,48956161,5889,18153729
   Client-ID Option 61, length 7: ether 08:00:27:7c:f8:76
   GUID Option 97, length 17: 0.111.172.41.67.159.174.69.33.165.23.148.149.98.17.150.202
   Server-ID Option 54, length 4: 192.168.254.254
   Requested-IP Option 50, length 4: 192.168.254.111
11:17:27.226679 IP (tos 0x0, ttl 64, id 771, offset 0, flags [none], proto UDP (17), length 390)
    192.168.254.111.68 > 192.168.254.198.4011: [udp sum ok] BOOTP/DHCP, Request from 08:00:27:7c:f8:76, length 362, secs 4, Flags [Broadcast] (0x8000)
 Client-IP 192.168.254.111
 Client-Ethernet-Address 08:00:27:7c:f8:76
 Vendor-rfc1048 Extensions
   Magic Cookie 0x63825363
   DHCP-Message Option 53, length 1: Request
   MSZ Option 57, length 2: 1472
   ARCH Option 93, length 2: 0
   NDI Option 94, length 3: 1.2.1
   Vendor-Class Option 60, length 9: "PXEClient"
   User-Class Option 77, length 4: 
     instance#1: ERROR: invalid option
   Parameter-Request Option 55, length 23: 
     Subnet-Mask, Default-Gateway, Domain-Name-Server, LOG
     Hostname, Domain-Name, RP, MTU
     Vendor-Option, Vendor-Class, TFTP, BF
     Option 119, Option 128, Option 129, Option 130
     Option 131, Option 132, Option 133, Option 134
     Option 135, Option 175, Option 203
   T175 Option 175, length 24: 2969895296,2249199137,16846849,48956161,5889,18153729
   Client-ID Option 61, length 7: ether 08:00:27:7c:f8:76
   GUID Option 97, length 17: 0.111.172.41.67.159.174.69.33.165.23.148.149.98.17.150.202
   Vendor-Option Option 43, length 7: 71.4.128.0.0.0.255
11:17:27.226852 IP (tos 0xc0, ttl 64, id 19482, offset 0, flags [none], proto UDP (17), length 328)
    192.168.254.198.4011 > 192.168.254.111.68: [udp sum ok] BOOTP/DHCP, Reply, length 300, secs 4, Flags [Broadcast] (0x8000)
 Your-IP 192.168.254.111
 Server-IP 192.168.254.198
 Client-Ethernet-Address 08:00:27:7c:f8:76
 file "pxelinux.0"
 Vendor-rfc1048 Extensions
   Magic Cookie 0x63825363
   DHCP-Message Option 53, length 1: ACK
   Server-ID Option 54, length 4: 192.168.254.198
   Vendor-Class Option 60, length 9: "PXEClient"
   GUID Option 97, length 17: 0.111.172.41.67.159.174.69.33.165.23.148.149.98.17.150.202
   Vendor-Option Option 43, length 7: 71.4.128.0.0.0.255
11:17:27.239185 IP (tos 0x0, ttl 64, id 1029, offset 0, flags [none], proto UDP (17), length 68)
    192.168.254.111.31273 > 192.168.254.198.69: [udp sum ok]  40 RRQ "pxelinux.0" octet blksize 1432 tsize 0
11:17:27.339542 IP (tos 0x0, ttl 64, id 6409, offset 0, flags [none], proto UDP (17), length 107)
    192.168.254.111.49152 > 192.168.254.198.69: [udp sum ok]  79 RRQ "pxelinux.cfg/6fac2943-9fae-4521-a517-9495621196ca" octet tsize 0 blksize 1408
11:17:27.348576 IP (tos 0x0, ttl 64, id 6666, offset 0, flags [none], proto UDP (17), length 91)
    192.168.254.111.49153 > 192.168.254.198.69: [udp sum ok]  63 RRQ "pxelinux.cfg/01-08-00-27-7c-f8-76" octet tsize 0 blksize 1408
11:17:27.356674 IP (tos 0x0, ttl 64, id 6923, offset 0, flags [none], proto UDP (17), length 79)
    192.168.254.111.49154 > 192.168.254.198.69: [udp sum ok]  51 RRQ "pxelinux.cfg/C0A8FE6F" octet tsize 0 blksize 1408
11:17:27.365493 IP (tos 0x0, ttl 64, id 7180, offset 0, flags [none], proto UDP (17), length 78)
    192.168.254.111.49155 > 192.168.254.198.69: [udp sum ok]  50 RRQ "pxelinux.cfg/C0A8FE6" octet tsize 0 blksize 1408
11:17:27.373956 IP (tos 0x0, ttl 64, id 7437, offset 0, flags [none], proto UDP (17), length 77)
    192.168.254.111.49156 > 192.168.254.198.69: [udp sum ok]  49 RRQ "pxelinux.cfg/C0A8FE" octet tsize 0 blksize 1408
11:17:27.382224 IP (tos 0x0, ttl 64, id 7694, offset 0, flags [none], proto UDP (17), length 76)
    192.168.254.111.49157 > 192.168.254.198.69: [udp sum ok]  48 RRQ "pxelinux.cfg/C0A8F" octet tsize 0 blksize 1408
11:17:27.391387 IP (tos 0x0, ttl 64, id 7951, offset 0, flags [none], proto UDP (17), length 75)
    192.168.254.111.49158 > 192.168.254.198.69: [udp sum ok]  47 RRQ "pxelinux.cfg/C0A8" octet tsize 0 blksize 1408
11:17:27.399979 IP (tos 0x0, ttl 64, id 8192, offset 0, flags [none], proto UDP (17), length 74)
    192.168.254.111.49159 > 192.168.254.198.69: [udp sum ok]  46 RRQ "pxelinux.cfg/C0A" octet tsize 0 blksize 1408
11:17:27.409224 IP (tos 0x0, ttl 64, id 8449, offset 0, flags [none], proto UDP (17), length 73)
    192.168.254.111.49160 > 192.168.254.198.69: [udp sum ok]  45 RRQ "pxelinux.cfg/C0" octet tsize 0 blksize 1408
11:17:27.418193 IP (tos 0x0, ttl 64, id 8706, offset 0, flags [none], proto UDP (17), length 72)
    192.168.254.111.49161 > 192.168.254.198.69: [udp sum ok]  44 RRQ "pxelinux.cfg/C" octet tsize 0 blksize 1408
11:17:27.427380 IP (tos 0x0, ttl 64, id 8963, offset 0, flags [none], proto UDP (17), length 78)
    192.168.254.111.49162 > 192.168.254.198.69: [udp sum ok]  50 RRQ "pxelinux.cfg/default" octet tsize 0 blksize 1408
11:17:27.431595 IP (tos 0x0, ttl 64, id 9733, offset 0, flags [none], proto UDP (17), length 69)
    192.168.254.111.49163 > 192.168.254.198.69: [udp sum ok]  41 RRQ "message.txt" octet tsize 0 blksize 1408
11:19:23.697108 IP (tos 0x0, ttl 64, id 10503, offset 0, flags [none], proto UDP (17), length 80)
    192.168.254.111.49164 > 192.168.254.198.69: [udp sum ok]  52 RRQ "kernels/huge.s/bzImage" octet tsize 0 blksize 1408
11:19:28.648355 IP (tos 0x0, ttl 64, id 17164, offset 0, flags [none], proto UDP (17), length 68)
    192.168.254.111.49165 > 192.168.254.198.69: [udp sum ok]  40 RRQ "initrd.img" octet tsize 0 blksize 1408
11:20:02.064455 IP (tos 0x0, ttl 64, id 21416, offset 0, flags [none], proto UDP (17), length 332)
    0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 08:00:27:7c:f8:76, length 304, xid 0xbc8f63de, Flags [none] (0x0000)
 Client-Ethernet-Address 08:00:27:7c:f8:76
 Vendor-rfc1048 Extensions
   Magic Cookie 0x63825363
   DHCP-Message Option 53, length 1: Discover
   Parameter-Request Option 55, length 15: 
     Subnet-Mask, Classless-Static-Route, Default-Gateway, Domain-Name-Server
     Hostname, Domain-Name, MTU, BR
     Static-Route, NTP, Lease-Time, Server-ID
     RN, RB, Option 119
   MSZ Option 57, length 2: 1472
   Client-ID Option 61, length 23: hardware-type 255, 27:7c:f8:76:00:04:43:29:ac:6f:ae:9f:21:45:a5:17:94:95:62:11:96:ca
   Hostname Option 12, length 9: "slackware"
   T145 Option 145, length 1: 1


REFERENCES:

usb-and-pxe-installers/README_PXE.TXT


No comments:

Post a Comment

Note: only a member of this blog may post a comment.