Sample Kickstart configuration file

The following is a sample Kickstart configuration file.

%post --nochroot
# Please add necessary scripts or commands here to your need
# This generated kickstart file is only for the automated installation of products
# in the DVD

PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
export PATH

#
# Notice:
# * Please modify the BUILDSRC below according to your real environment
# * The location specified with BUILDSRC should be NFS accessible
#   to the Kickstart Server
# * Please copy the whole directories of rpms and scripts from 
#   installation media to the BUILDSRC
# * Please put generated install<product> scripts into the BUILDSRC
#

BUILDSRC="<hostname_or_ip>:/path/to/rpms_and_scripts"

#
# Notice:
# * Scripts below are no need to change
#

# define path varibles
ROOT=/mnt/sysimage
BUILDDIR="${ROOT}/build"
RPMDIR="${BUILDDIR}/rpms"
SCRIPTDIR="${BUILDDIR}/scripts"
CPIDIR="${ROOT}/opt/VRTS/install"
CPIMODDIR="${ROOT}/opt/VRTSperl/lib/site_perl/UXRT51"

# define log path
KSLOG="${ROOT}/var/tmp/kickstart.log"

echo "==== Executing kickstart post section: ====" >> ${KSLOG}

mkdir -p ${BUILDDIR}
mount -t nfs -o vers=3 ${BUILDSRC} ${BUILDDIR} >> ${KSLOG} 2>&1

# install rpms one by one
for RPM in VRTSvlic VRTSperl VRTSspt VRTSob VRTSvxvm VRTSaslapm VRTSlvmconv 
  VRTSsfmh VRTSvxfs VRTSfssdk VRTSllt VRTSgab VRTSvxfen VRTSvcs VRTScps VRTSvcsag 
  VRTSvcsdr VRTScutil VRTSatClient VRTSatServer VRTSvcsea VRTSdbed VRTSodm
do
    echo "Installing package  -- $RPM" >> ${KSLOG}
    rpm -U -v --root ${ROOT} ${RPMDIR}/${RPM}-* >> ${KSLOG} 2>&1
done

# copy cpi perl modules
mkdir -p ${CPIMODDIR}
for MODULE in EDR CPIC CPIP
do
    if [ -d "${SCRIPTDIR}/${MODULE}" ]
    then
        cp -rp ${SCRIPTDIR}/${MODULE} ${CPIMODDIR}
        echo "Perl modules from ${SCRIPTDIR}/${MODULE} are copied to ${CPIMODDIR}" >> ${KSLOG}
    else
        echo "Required perl modules ${SCRIPTDIR}/${MODULE} not found" >> ${KSLOG}
    fi    
done

# copy cpi message catalogs
if [ -d "${SCRIPTDIR}/messages" ]
then
    cp -rp "${SCRIPTDIR}/messages" ${CPIMODDIR}
    echo "Messages from ${SCRIPTDIR}/messages are copied to ${CPIMODDIR}" >> ${KSLOG}
fi
if [ -d "${SCRIPTDIR}/bin" ]
then
    cp -rp "${SCRIPTDIR}/bin" ${CPIMODDIR}
    echo "Commands from ${SCRIPTDIR}/bin are copied to ${CPIMODDIR}" >> ${KSLOG}
fi

# copy cpi installer scripts
mkdir -p ${CPIDIR}
touch "${CPIDIR}/.cpi5"
for FILE in $(find ${BUILDDIR} -maxdepth 1 -name '*install*')
do
    cp -p ${FILE} ${CPIDIR}
    echo "Copy ${FILE} to ${CPIDIR}" >> ${KSLOG}
done

umount ${BUILDDIR}

echo "==== Completed kickstart file ====" >> ${KSLOG}

exit 0