Kickstart %pre script behaving differently in RHEL8 versus RHEL7

Latest response

For RHEL7 installs, we use a %pre script to automatically determine the target installation drive by looking in /dev/disk/by-path to find the SCSI drive that we want. We had to do this because, starting in RHEL7, /dev/sda was no longer assured to be the hard drive we wanted (or even worse, not a hard drive at all).

When I try this same kickstart on RHEL8 it fails to find any SCSI drives in /dev/disk/by-path. This is verified by using alt-F2 to get a shell and checking this manually when the install fails. No SCSI drives are present. I tried multiple SCSI controllers in VirutalBox, with the same result. The only media I can find there are ATA devices like the installation DVD itself.

Has RHEL8 delayed loaded SCSI devices until after %pre ? How can I overcome this?

Here is the %pre script, for reference. It creates a kickstart section on the fly, which we %include later in the install.

%pre --interpreter=/bin/bash
//The disk entry for the RAID array will have scsi in the name
osdisk=$(ls -lh /dev/disk/by-path/ | grep 'scsi-' | awk '{print $9}')

// Create a temp file with the partition scheme to be included in the KS config
echo "# Partitioning scheme" > /tmp/partition_layout
echo "bootloader --location=mbr --driveorder=/dev/disk/by-path/$osdisk --append=\"crashkernel=auto rhgb quiet\"" >> /tmp/partition_layout

echo "zerombr" >> /tmp/partition_layout
echo "ignoredisk --only-use=disk/by-path/$osdisk" >> /tmp/partition_layout
echo "clearpart --all --drives=disk/by-path/$osdisk" >> /tmp/partition_layout
echo "part /boot --fstype ext4 --size=500" >> /tmp/partition_layout
echo "part swap --size=6144 --ondisk=disk/by-path/$osdisk" >> /tmp/partition_layout
echo "part pv.008002 --grow --size=1" >> /tmp/partition_layout

echo "volgroup vg00 --pesize=4096 pv.008002" >> /tmp/partition_layout
echo "logvol / --fstype=ext4 --name=lv_root --vgname=vg00 --size=40960" >> /tmp/partition_layout
echo "logvol /usr2 --fstype=ext4 --name=lv_usr2 --vgname=vg00 --size=1 --grow" >> /tmp/partition_layout

%end

Responses