Kickstart Post Problem

Mr. Paul M. Whitney paul.whitney at me.com
Wed Mar 16 12:01:07 UTC 2011


I am at my wits end here.  I am trying to create a custom RHEL 5.6 build.  At the end of the install in my ks.cfg file I have a section for the post installation.  I am trying to copy a file from the DVD to Root's home directory.  Here is the snippit I have:

%post --nochroot

ISO9660_DEV=`dmesg | grep -i iso9660 | head -1 | cut -d\  -f4`
DEV_NAME=${ISO9660_DEV%,}

mkdir -p /mnt/sysimage/root/Stuff
echo "Stuff directory created..."

mkdir /tmp/stuff-iso
mount /dev/$DEV_NAME /tmp/stuff-iso
echo "Media mounted successfully..."

echo "Copying Stuff Customization..."

cp -fa /tmp/stuff-iso/STUFF.tar  /mnt/sysimage/root

%end

//END SNIP

Now this method works on a VMware VM.  However, when I try this on a bare metal PC, the DVD/CDROM is not mounted.  And so the STUFF.tar file is not copied.  So the install does not complete with my post install.

Can someone please tell me a better way to identify the DVD/CDROM device on any machine?  The PC has a device /dev/sr0 and a symbolic /dev/CDROM.  On VMware the CDROM is linked to /dev/hdc.

I have looked at Red Hat web site, I have looked at the Fedora Wiki pages, and there is mention of the %post sections in Kickstart files, but none say this is how to mount the media to copy a file over.

Thanks,

Paul



More information about the redhat-list mailing list