In building a custom USB installer for Centos6.6 (not easy) I found that if the %post section of the kickstart file has backticks
- Anaconda completes, but exits immediately to a blank screen (no video output), Normally it exits with a message saying Anaconda terminated, etc. and
- Both anaconda-ks.log and the %post log file exist but have zero length.
This works
%pre --log=/root/postLog.log
echo "This is the post"
ls
%end
This doesn't work
%pre --log=/root/postLog.log
echo "This is the post"
echo `ls`
%end
This also doesn't work
%pre --log=/root/postLog.log
echo "This is the post"
echo $(ls)
%end
Why? I have a lot of things I need to do in the %post and not having command substituion/back tick support is going to make that more difficult.
Any workaround?
Edit: And why I need backticks?
The installer is for an appliance product so needs to install the base OS, custom OS rpms, and product rpms.
So in the %post section, something like this pattern is very common:
cd $ApplicationPackageDir
RPMLIST=`ls *.rpm`
RPMCOUNT=`ls *.rpm | /usr/bin/wc -l`
for theRpm in $RPMLIST
do
echo /bin/rpm --quiet --upgrade --nodeps --force $theRpm
done
Similar pattern for generically doing something with whatever files exist in a particular directory.
The entire concept doesn't work if anaconda barfs on having a backtick in the file.
Besides, backtick is a valid bash operator – which kickstart seems to have trouble on.
Are bash backticks supposed to work in kickstart?
Edit II: Added $(ls) to example