Build a CentOS7 server for: pxe boot, kickstart, reposync, repotrack, nfs, https (STEP 12)

STEP 12 – Put the required PXE client boot files in place.

We’re going to make a folder structure that supports two Distro/Release/Arch versions to start with, and can easily be updated with additional versions down the road.
mkdir /var/lib/tftpboot/CentOS7x64/
mkdir /var/lib/tftpboot/CentOS7x32/
Now, to copy the minimum boot files over to the tftpserver… we need to mount an installation media ISO… such as “CentOS-7-x86_64-NetInstall-1810.iso” for CentOS 7 64-bit, and cp the boot files to the tftboot directories.
The exact details of mounting media (ISOs) can vary…
I’m doing this on VMware Fusion, and the vm has open-vm-tools installed and active, so, my method is to use vmware to choose and connect the disc image to the VM, then, within the vm:
mount /dev/cdrom/ /mnt/cdrom/
cd /mnt/cdrom/isolinux/   # purely optional, just to see what’s there.
ls -l /mnt/cdrom/isolinux/    # purely optional, just to see what’s there.
#
cp /mnt/cdrom/isolinux/{vmlinuz,initrd.img,splash.png} /var/lib/tftpboot/CentOS7x64/
If you’re running a GUI Desktop (GNOME) on your VM, it might auto-mount the cd-rom, and this might be your command line option for copying the files:
# cp /run/media/{username}/CentOS\ 7\ x86_64/isolinux/{vmlinuz,initrd.img,splash.png} /var/lib/tftpboot/CentOS7x64/
# cp /run/media/elmer/CentOS\ 7\ x86_64/isolinux/{vmlinuz,initrd.img,splash.png} /var/lib/tftpboot/CentOS7x64/
#
cd /var/lib/tftpboot/CentOS7x64/ # verify cp results.
Now, we also need to copy “LiveOS” from that bootable iso:
mkdir /var/www/html/repos/c7x64/base/LiveOS
mkdir /var/www/html/repos/c7x32/base/LiveOS
NOTE: in the section “Create a PXE BOOT MENU”, the menu provides different versions of vmlinuz + initrd.img,
  • this is how/where those are provided to the PXE/Kickstart clients.
  • Each targeted Distro/Release/Arch requires a matching “LiveOS” be provided.
  • When the client node boots into this image, this is what runs the Anaconda installer (and processes the kickstart script).
  • cp /mnt/cdrom/LiveOS/* /var/www/html/repos/c7x64/base/LiveOS/
  • # OR: cp /run/media/{username}/CentOS\ 7\ x86_64/LiveOS/* /var/www/html/repos/c7x64/base/LiveOS/
  • # cp /run/media/elmer/CentOS\ 7\ x86_64/LiveOS/* /var/www/html/repos/c7x64/base/LiveOS/

Now, switch to the the 32 bit ISO and cp those files as well:

  • umount /dev/cdrom
For VMware Fusion: choose/connect a CentOS 7 32-bit ISO (like CentOS-7-i386-NetInstall-1810.iso)
  • mount /dev/cdrom/ /mnt/cdrom/
  • cp /mnt/cdrom/isolinux/{vmlinuz,initrd.img,splash.png} /var/lib/tftpboot/CentOS7x32/
  • cp /mnt/cdrom/LiveOS/* /var/www/html/repos/c7x32/base/LiveOS/

One thought on “Build a CentOS7 server for: pxe boot, kickstart, reposync, repotrack, nfs, https (STEP 12)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s