Installing UEFI Linux with Kickstart

Question: How to perform a UEFI Linux installation through kickstart for non DHCP/PXE?

The steps outlined below explians how to create an UEFI ISO image on a DVD and how to boot from that DVD.

Create a kickstart configuration file

1. First, check if system-config-kickstart is installed or not:

# rpm -qa | grep -i kickstart

2. If not installed then, install it using yum:

# yum install system-config-kickstart

3. Copy the kickstart configuration in /var/www/html:

# ls -l /var/www/html/ks.cfg
-rw-r--r--. 1 root root 860 Feb 27 00:23 /var/www/html/ks.cfg

Creating an apache server

1. check if httpd is installed or not:

# rpm -qa |grep -i httpd

2. If not installed then, install using yum:

# yum install httpd

3. Check if service httpd running and start it if it is not running:

# systemctl status httpd
# systemctl start httpd

4. check if firewall and SELINUX is disabled:

# service iptables status

Edit the file /etc/selinux/config and set SELINUX=disabled. Confirm with getenforce, if SELinux is disabled or not.

Created UEFI ISO image

1. Mount ISO image read-only in Linux file system:

# mkdir /mnt/uefiiso
# mount -o loop /tmp/OEL7U1.iso /mnt/uefiiso

2. Copy ISO contents to the new working directory:

# cp -aR /mnt/uefiiso /mnt/bootuefiiso
# ls -al /mnt/bootuefiiso
# chmod 777 /mnt/bootuefiiso

3. Add the ks= boot option to the line beginning with append. For example:

cat /mnt/bootuefiiso/isolinux/isolinux.cfg
ks=cdrom:/ks.cfg

4. Place kickstart file in the ISO working directory:

cat /mnt/bootuefiiso/ks.cfg

5. Modify GRUB config file for UEFI BOOT. Modify original main menu entry in /mnt/bootuefiiso/EFI/BOOT/grub.cfg file. For example:

menuentry 'Oracle Linux Linux 7.2' --class fedora --class gnu-linux --class gnu --class os {
linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=OL-7.2\x20Server.x86_64 quiet
initrdefi /images/pxeboot/initrd.img
}

modify to

menuentry 'Oracle Linux Linux 7.2 Custom Kickstart Installation' --class fedora --class gnu-linux --class gnu --class os {
linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=OL-7.2\x20Server.x86_64 quiet inst.ks=cdrom:/ks.cfg
initrdefi /images/pxeboot/initrd.img
}

6. Create custom Red Hat 7.2 UEFI ISO image:

# mkisofs -o /tmp/OEL7U1.iso -b isolinux/isolinux.bin -J -R -l -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -graft-points -V "RHEL-7.2 Server.x86_64" /mnt/bootuefiiso

7. Create custom Red Hat 7.2 UEFI ISO image:

isohybrid --uefi /tmp/OL_7.2_uefi_custom.iso

The new customized iso image exists in /tmp. For example:

rhel_7.2_uefi_custom.iso

Burn the created UEFI ISO image on DVD or mount it directly in server’s iLO and boot from it:

Plain Linux installation with kickstart

The other method is to download iso image from respective Linux flavours official site and enable UEFI option in BIOS Target Server. During the installation of the UEFI ISO, press tab and append the below lines in the grub. For example:

inst.ks=http://[IP ADDR]/ks.cfg ip=[IP ADDR] netmask=[NET MASK] gateway=[GATEWAY]