Cannot mount cdrom in kickstart post-install
I am trying to mount the cdrom in the post section of a kickstart install (on Red Hat 5), but I get the error message :
Block device required
I am doing this from the --nochroot section of the ks like so, but it refuses to mount the device. However, if I later login as root(post reboot), I am able to complete these steps correctly. So its definitely something to do with being in the post section of the kicstart, and not related to me pointing to the incorrect /dev/.. location.
Oh and I have configured selinux to --permissive. (Does this affect the cdrom mounting? should I disable it?)
# mount the cdrom
# If no symlink for /dev/cdrom, find the cd-rom device and make one
(cddev="`dmesg | grep '^[sh]d.:' | grep -i cd | head -1 | cut -d: -f1`"
mkdir -p /mnt/cdrom
mount -t iso9660 -o ro /mnt/cdrom /dev/$cddev
# copy over the customized installer
echo "Copying $INSTALLER.gz from the CDROM."
cp /mnt/cdrom/$INSTALLER.gz /tmp
umount -f /mnt/cdrom
# run the installer
chmod 755 /tmp/$INSTALLER
echo "Running the $PRODUCTNAME installer."
/tmp/$INSTALLER -i silent
# unmount cdrom & remove the installer
rm -f /tmp/$INSTALLER) 2>&1 | tee /post-install.log | tee /dev/console