Title: Add an Installation Option
Course: CIS 208: Linux/UNIX III: Intermediate System Administration, Networking, and Security ~ For IGNITE Review > Section: Learning Modules

In this example we will create an installation option for the 64 bit version of Centos.  For other distros, check their websites for PXE configuration.

mkdir -p /tftboot/centos/6/x86_64
cd /tftpboot/centos/6/x86_64
wget http://mirror.centos.org/centos/6/os/x86_64/isolinux/vmlinux
wget http://mirror.centos.org/centos/6/os/x86_64/isolinux/initrd.img

Add the following lines to /tftpboot/pxelinux.cfg/default.

label 2
kernel centos/6/x86_64/vmlinux
append initrd=centos/6/x86_64/initrd.img

Add this line to /tftpboot/f1.txt.

[2] install Centos version 6

Test by booting another computer and selecting the network boot option.  A menu should appear with the "install Centos version 6" option.  Select the option to ensure that the computer boots properly and starts the installation process.  Be sure to reboot or turn off the computer prior to the warning about writing to the hard drive, unless you actually intend to complete the installation.

Here is a second example adding a System Rescue CD image.  Download the iso image from http://www.sysresccd.org. Run the following commands to prepare the files required for the boot process.

cd /tftpboot
mkdir -p /mnt/sysresccd sysresccd
mount -o loop ~/Downloads/systemrescuecd*iso /mnt/systesccd
cp /mnt/sysresccd/{sysrcd.{dat,md5},isolinux/{rescue32,initram.igz}} sysresccd
umount /mnt/sysresccd; rm -rf /mnt/sysresccd
cp -r /tftpboot/sysresccd /var/www/html

Next update the IP address, then add the following lines to to /tftpboot/pxelinux.cfg/default.

label 3
kernal /sysresccd/rescue32
append setkmap=us netboot=http://<ipaddr>/sysresccd/sysrcd.dat
initrd /sysresccd/initram.igz

Add this line to /tftpboot/f1.txt.

[3] boot from System Rescue CD

Test by performing a network boot on another computer to ensure that it loads properly.