Skip to content

Instantly share code, notes, and snippets.

@corburn
Last active August 27, 2024 05:46
Show Gist options
  • Save corburn/3d22637db7da14a4c586 to your computer and use it in GitHub Desktop.
Save corburn/3d22637db7da14a4c586 to your computer and use it in GitHub Desktop.
Red Hat PXE Server
#https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/chap-installation-server-setup.html
# 1. Install the tftp package. To do this, run the following command as root:
yum install tftp-server
# 2. In the /etc/xinetd.d/tftp configuration file, change the disabled parameter from yes to no.
# untested - inline find and replace
#sed -i.bak s/disable = yes/disable = no/g /etc/xinet.d/tftp
# 3. Allow incoming connections to the tftp service in the firewall:
#firewall-cmd --add-service=tftp
# The above command only enables access until the next server reboot. To allow access permanently, add the --permanent option.
# 4. Configure your DHCP server to use the boot images packaged with SYSLINUX.
cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.orig
cat <<< EOF > /etc/dhcp/dhcpd.conf
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;
option architecture-type code 93 = unsigned integer 16;
subnet 10.0.0.0 netmask 255.255.255.0 {
option routers 10.0.0.254;
range 10.0.0.2 10.0.0.253;
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
next-server 10.0.0.1;
if option architecture-type = 00:07 {
filename "uefi/shim.efi";
} else {
filename "pxelinux/pxelinux.0";
}
}
}
EOF
# 5. You now need the pxelinux.0 file from the SYSLINUX package in the ISO image file. To access it, run the following commands as root:
mount -t iso9660 /path_to_image/name_of_image.iso /mount_point -o loop,ro
cp -pr /mount_point/Packages/syslinux-version-architecture.rpm /publicly_available_directory
umount /mount_point
# Extract the package
rpm2cpio syslinux-version-architecture.rpm | cpio -dimv
# 6. Create a pxelinux/ directory within tftpboot/ and copy the pxelinux.0 file into it:
mkdir /var/lib/tftpboot/pxelinux
cp publicly_available_directory/usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/pxelinux
# 7. Add a configuration file named default to the pxelinux/ directory.
# Important:
# The inst.repo= Anaconda option, shown in the example above, must always be used to
# specify the installation program's image as well as the installation source. Without
# this option, the installation program will be unable to boot.
# A sample configuration file at /var/lib/tftpboot/pxelinux/default might look like:
cat << EOF > /var/lib/tftpboot/pxelinux/default
default vesamenu.c32
prompt 1
timeout 600
display boot.msg
label linux
menu label ^Install system
menu default
kernel vmlinuz
append initrd=initrd.img ip=dhcp inst.repo=http://10.32.5.1/mnt/archive/RHEL-7/7.x/Server/x86_64/os/
label vesa
menu label Install system with ^basic video driver
kernel vmlinuz
append initrd=initrd.img ip=dhcp inst.xdriver=vesa nomodeset inst.repo=http://10.32.5.1/mnt/archive/RHEL-7/7.x/Server/x86_64/os/
label rescue
menu label ^Rescue installed system
kernel vmlinuz
append initrd=initrd.img rescue
label local
menu label Boot from ^local drive
localboot 0xffff
EOF
# 8. Copy the boot images into your tftp/ root directory:
cp /path/to/x86_64/os/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/pxelinux/
# 9. Finally, start the tftp, xinetd and dhcp services if they were not running before, or reload their updated configurations if they have been running during this procedure.
systemctl start tftp.service xinetd.service dhcpd.service
systemctl enable tftp.service xinetd.service dhcpd.service
systemctl reload tftp.service xinetd.service dhcpd.service
# Disable all except CPU core 0
for x in /sys/devices/system/cpu/cpu*/online; do
echo 0 >"$x"
done
# Install and Update Server
# Manage DHCP, PXE, etc
https://cobbler.github.io/
Parallelization of the Trinity pipeline for de novo transcriptome assembly
http://www.hicomb.org/papers/HICOMB2014-02.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment