Table of contents
/tftpboot
/tftpboot/logs
If DHCP is handled by Mikrotik routers and TFTP is on other server, set:
Next Server
Boot File Name
(in IP / DHCP Server / Networks
.)
/ip dhcp-server network print detail
... next-server=192.168.10.14 boot-file-name="pxelinux.0" ...
#README
See the files in the doc directory for documentation about SYSLINUX:
syslinux.txt - Usage instructions; manual.
distrib.txt - For creators of Linux distributions.
pxelinux.txt - Documentation specific to PXELINUX.
isolinux.txt - Documentation specific to ISOLINUX.
extlinux.txt - Documentation specific to EXTLINUX.
menu.txt - About the menu systems.
usbkey.txt - About using SYSLINUX on USB keys.
memdisk.txt - Documentation about MEMDISK.
Also see the files:
NEWS - List of changes from previous releases.
TODO - About features planned for future releases.
COPYING - For the license terms of this software.
# From Syslinux 6.0 onwards there is support for three different firmware backends: BIOS, 32-bit EFI and 64-bit EFI.
We use the BIOS backend from ../syslinux-x.xx/bios/...
# on the TFTP server:
# create the directory "/tftpboot/pxelinux.cfg"
# copy the following files to "/tftpboot":
# pxelinux.0 - from the Syslinux distribution
cp /tmp/syslinux-6.03/bios/core/pxelinux.0 /tftpboot
# any kernel or initrd images you want to boot
# (we will do this later)
# ...
# THE SIMPLE MENU SYSTEM is a single module located at
# com32/menu/vesamenu.c32 (graphical) and
# com32/menu/menu.c32 (text mode only).
# It uses the same configuration file as the regular Syslinux command line, and displays all the LABEL statements.
#
# Make sure menu.c32 and vesamenu.c32 is in the pxelinux.0 directory.
cp -r /tmp/syslinux-6.03/bios/com32/menu/* /tftpboot/pxelinux.0
# PXELINUX will search for different config files on the boot server in some way:
# Ultimately, it will try looking for a file named "default" (in lower case)
# in "/tftpboot/pxelinux.cfg" directory
# see /syslinux-x.xx/doc/pxelinux.txt
# create file "/tftpboot/pxelinux.cfg/deafault"
For Raspberry Pi: PXE Boot from Qnap NAS
sudo cat /sys/class/net/eth0/address
00:e0:4c:53:44:58
md /pxeroot/4c534458
/pxeroot
directory from SD card ...cp -r /path/from/raspi/SD card/boot/* /tftpboot
script pxe.sh
#!/bin/sh
#pxe.sh
PXECONF=pxeroot/conf
if ! [ -e $PXECONF/dhcpd.leases ] ; then touch $PXECONF/dhcpd.leases ; fi
if ! [ -L /bin/pxe.sh ] ; then ln -s $PXECONF/pxe.sh /bin/pxe.sh >null 2>&1 ; fi
start()
{
echo `date` Start APP "PXE" pxe.sh >> /var/log/pxe.log
#======================================================================
dhcpd -cf $PXECONF/dhcpd.conf -lf $PXECONF/dhcpd.leases
sleep 1
if [ -n "$(pidof dhcpd)" ]
then
echo -e " \033[32m OK - dhcpd läuft \033[0m "
else
echo -e "\033[31m ERROR - dhcpd läuft nicht \033[0m "
exit 1
fi
if [ -e $PXECONF/opentftpd.log ] ; then rm $PXECONF/opentftpd.log ; fi
opentftpd -i $PXECONF/opentftpd.ini -l $PXECONF/opentftpd.log
#================================================
}
stop()
{
echo `date` Stop pxe.sh >> /var/log/pxe.log
#====================================================================
echo "Shutting down opentftpd and dhcpd"
/bin/kill -9 `/bin/pidof opentftpd`
/bin/kill -9 `/bin/pidof dhcpd`
#================================================
}
# you do not need to edit this lines
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
# Restarting the Daemon
$0 stop
sleep 1
$0 start
;;
*)
## If no parameters are given, print which are avaiable.
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit
/pxeroot
├── 4c534458 -> raspi/#1/boot
├── bootcode.bin
├── ccfc0bd9 -> raspi/#2/boot
├── conf
│ ├── dhcpd.conf
│ ├── opentftpd.ini
│ └── pxe.sh
└── raspi
├── Pi#1
│ └── boot
│
└── Pi#2
└── boot
/tftpboot/pxelinux.cfg
#/pxeroot/pxelinux.cfg/default
UI ubuntu-installer/i386/boot-screens/vesamenu.c32
prompt 10
menu title Meine Installationsauswahl
timeout 6000
label lokal
menu label Booten von lokaler Festplatte
LOCALBOOT 0
LABEL ubuntu11
MENU LABEL Ubuntu 11.4 NetInstall
kernel ubuntu-installer/i386/boot-screens/vesamenu.c32
append ubuntu-installer/i386/boot-screens/menu.cfg
For Arch Linux:
/pxeroot/arch/boot/x86_64/vmlinuz
/pxeroot/arch/boot/intel_ucode.img
/pxeroot/arch/boot/amd_ucode.img
/pxeroot/arch/boot/x86_64/archiso.img
sudo md /tmp/logs
sudo mount.cifs //192.168.10.14/pxeroot/logs /tmp/logs ro,nounix,iocharset=utf8,file_mode=0777,cache=none
tail -F -n 30 /tmp/logs/opentftpd.log