Skip to content

Instantly share code, notes, and snippets.

@fabaff
Created April 13, 2013 08:33
Show Gist options
  • Save fabaff/5377605 to your computer and use it in GitHub Desktop.
Save fabaff/5377605 to your computer and use it in GitHub Desktop.
This simple script helps to setup a basic PXE Server in an existing environment on a Fedora-based system. It's a summary of this blog post [1]. Requirements: - root access - Fedora 18 (firewalld) - Access to the DHCP server configuration [1] http://fabian-affolter.ch/blog/index.php/installationsserver
# This simple script helps to setup a basic PXE Server in an existing
# environment on a Fedora-based system.
#
# Licensed under GPLv2
#
# Copyright (c) 2013 Fabian Affolter <fabian at affolter-engineering.ch>
TFTP_PATH=/var/lib/tftpboot
yum -y install tftp-server syslinux
mkdir -p {$TFTP_PATH/memtest,$TFTP_PATH/pxelinux.cfg}
curl http://ftp-stud.hs-esslingen.de/pub/fedora/linux/releases/18/Fedora/x86_64/os/isolinux/memtest -o $TFTP_PATH/memtest/memtest
cp /usr/share/syslinux/pxelinux.0 $TFTP_PATH/pxelinux.0
cp /usr/share/syslinux/menu.c32 $TFTP_PATH/menu.c32
cat << EOF>> $TFTP_PATH/pxelinux.cfg/default
# PXE boot options
prompt 0
default menu.c32
menu title Rebuild and diagnosis options
timeout 100
# Launch local installation
label local
menu label Start system from local storage
localboot 0
# Memtest
label memdisk
menu label Memtest
kernel memtest/memtest
EOF
# Enable the tftp service
sed -i 's|\sdisable\s\{3,\}= yes|\tdisable \t\t= no|g' /etc/xinetd.d/tftp
firewall-cmd --permanent --add-service=tftp
firewall-cmd --reload
systemctl start xinetd.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment