PDA

View Full Version : custom Kickstart FC4



irivera
3rd April 2006, 08:11 PM
I'm trying to detect the type and number of of HD on a system by using a script in the %pre section. The script creates a file in /tmp with kickstart partitioning commands. I include this newly created file in the partitioning section of the kickstart file. The install fails with a file not found error. I verified it and the file is not in the /tmp directory.

Can this be done? and if So, What am I doing wrong?

Note: This question may have been answered before, sorry, I was not able to find any ref.

tashirosgt
5th April 2006, 07:52 AM
I suggest you post the relevant part of the script. If there are any kickstart experts that might grab their attention. (I myself am not such an expert.)

irivera
5th April 2006, 12:55 PM
Here is the %pre script I'm trying to get to work.


%pre
#!/bin/sh
## generic script to pick hd? or sda
mkdir -p /tmp
hdlist=""
hd="/dev/hda"
short="hda"
mymedia=""
for f in /proc/ide/h* ; do
mymedia=`cat $f/media`
if [ $mymedia == "disk" ] ; then
hd=`basename $f`
short=$hd
hdlist="$hdlist $hd";
fi
done
if [ d /proc/scsi ] ; then
hd="/dev/sda"
short="sda"
for f in sda sdb sdc sdd sde sdf ; do
if [ d /dev/$f ] ; then
hdlist="$hdlist $f";
fi
done
fi
first= ${gdlist:1:3}
echo # > /tmp/part.txt
echo #partitioning the drives >> /tmp/part.txt
echo # >> /tmp/part.txt
echo clearpart --all --initlabel >> /tmp/part.txt
for drive in $hdlist ; do
if [ $first == $drive ] ; then
echo part /boot --ondrive=${drive} --fstype=ext3 --size=100 >> /tmp/part.txt
echo part swap --ondrive=${drive} --recommended >> /tmp/part.txt
fi
echo part pv.${drive} --ondrive=${drive} --fstype=reiserfs --size=1024 --grow >> /tmp/part.txt ;
done
pvpartlist=""
for drive in $hdlist ; do
volgroup ="${pvpartlist} pv.${drive}" ;
done
echo # >> /tmp/part.txt
echo # Logical volume group >> /tmp/part.txt
echo # >> /tmp/part.txt
echo volgroup nvrlvg ${volgroup} >> /tmp/part.txt
echo # >> /tmp/part.txt
echo # Logical volumes >> /tmp/part.txt
echo # >> /tmp/part.txt
echo logvol / --vgname=nvrlvg --size=2048 --name=rootvol >> /tmp/part.txt
echo logvol /usr --vgname=nvrlvg --size=2048 --name=usrvol >> /tmp/part.txt
echo logvol /var/lib/pgsql/data --fstype=reiserfs --vgname=nvrlvg --size=8192 --name=dbvol >> /tmp/part.txt
echo logvol /usr/local/eyeroverportal/data/htdocs/my.eyerover.com/recordings --fstype=reiserfs --vgname=nvrlvg --size=8192 --name=recvol --grow >> /tmp/part.txt
echo #end of file >> /tmp/part.txt




This script does not generate any errors that I can see. But the %include /tmp/part.txt that I place in the command section of the kickstart file generates a file not found error at installation time. Then the install halts.

sm97
12th April 2006, 09:19 AM
Switch to 3d console (Alt-F3). There's a chance that you'll see an error on it after "Running kickstart %pre script(s)".