I got it all working exactly how I want it and wanted to provide the steps for anyone else attempting this.
Mount DVD iso
Copy it's contents to a local folder
Code: Select all
mkdir /ISO
cp -r /mnt/. /ISO/kickstart.iso
Unmount the CD
Create kickstart script in /ISO/kickstart.iso/isolinux
Code: Select all
cp kickstart.cfg /ISO/kickstart.iso/isolinux/ks.cfg
Add kickstart to BIOS boot options
Code: Select all
sed -i '/append\ initrd/s/$/ inst.ks=cdrom:\/isolinux\/ks.cfg/' /ISO/kickstart.iso/isolinux/isolinux.cfg
Add kickstart to EFI boot options
Code: Select all
sed -i '/linuxefi/s/$/ inst.ks=cdrom:\/isolinux\/ks.cfg/' /ISO/kickstart.iso/EFI/BOOT/grub.cfg
Edit grub.cfg inside the efiboot.img
Code: Select all
mount -o loop /ISO/kickstart.iso/images/efiboot.img /mnt
sed -i '/linuxefi/s/$/ inst.ks=cdrom:\/isolinux\/ks.cfg/' /mnt/EFI/BOOT/grub.cfg
umount /mnt
Create the ISO **Output went to /ISOs/test.iso - Change as needed**
Code: Select all
xorriso -as mkisofs -o /ISOs/test.iso -V "CentOS 7 x86_64" \
-c isolinux/boot.cat -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 \
-boot-info-table -eltorito-alt-boot \
-e images/efiboot.img -no-emul-boot -R -J /ISO/kickstart.iso/
To have your kickstart file change the partitioning for EFI vs BIOS, add the following:
Code: Select all
%include /tmp/uefi
%include /tmp/legacy
%pre --logfile /tmp/kickstart.install.pre.log
clearpart --all --initlabel
if [ -d /sys/firmware/efi ] ; then
cat >> /tmp/uefi <<END
part /boot --fstype="ext4" --size=512
part /boot/efi --fstype="vfat" --size=1024
part swap --size=100 --fstype=swap
part pv.13 --size=1 --grow
volgroup VolGroup00 pv.13
logvol / --fstype xfs --name=rootsys --vgname=VolGroup00 --size=3000
END
else
cat >> /tmp/legacy <<END
part /boot --fstype=ext4 --size=300
part pv.6 --size=1000 --grow --ondisk=$d1
part swap --size=100 --fstype=swap
part pv.13 --size=1 --grow
volgroup VolGroup00 pv.13
logvol / --fstype xfs --name=rootsys --vgname=VolGroup00 --size=3000
END
fi
if [ -d /sys/firmware/efi ] ; then
touch /tmp/legacy
else
touch /tmp/uefi
fi
chvt 1
%end
Sources used -
https://access.redhat.com/solutions/3081331
https://www.redhat.com/en/blog/building ... hypervisor
Hope this helps!!