Kickstart example

To generate a kickstart file you can use the following GUI frontend:
[root@host]# system-config-kickstart 

Or just copy the example config bellow and use it as a template to make modifications to your kickstart file. Save it on a remote NFS share along with the OS installation files.

# platform=x86, AMD64, or Intel EM64T
# System authorization information
auth --useshadow --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
# Partition clearing information
clearpart --all --initlabel
# Use text mode install
# Firewall configuration
firewall --enabled --ssh --trust=eth0,eth1
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Installation logging level
logging --level=info
# Use NFS installation media
nfs --server= --dir=/nfs/centos5.1x64
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
network --bootproto=dhcp --device=eth1 --onboot=on
# Reboot after installation
#Root password
rootpw --iscrypted $1$spCf5Vny$FQMlUKJlsQdaYDkeL/QXI/
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
# System timezone
timezone America/Chicago
# Install OS instead of upgrade
# Disk partitioning information
part swap --bytes-per-inode=4096 --fstype="swap" --size=8000
part / --bytes-per-inode=4096 --fstype="ext3" --size=20000
part /var --bytes-per-inode=4096 --fstype="ext3" --grow --size=1
# Run Pos-Configuration Scripts
echo "Starting portmap ..."
echo "Updating time ..."
ntpdate -su
echo "Mounting nfs share from ..."
mkdir /nfsmount
mount /nfsmount/
echo "Installing mysql ..."
rpm -i --nodeps /nfsmount/mySQL/MySQL-server-standard-4.1.22-0.rhel4.x86_64.rpm
rpm -i --nodeps /nfsmount/mySQL/MySQL-client-standard-4.1.22-0.rhel4.x86_64.rpm
cp /nfsmount/mySQL/my.cnf /etc
mysqladmin -uroot password "newpass"
/etc/init.d/mysql restart
echo "Copying config files ..."
route del default gw
route add default gw
cp /nfsmount/files/* /tmp
cd /tmp
echo "Installing apf ..."
cp /nfsmount/apf/apf.tar.gz /tmp
cd /tmp
tar zxfv apf.tar.gz
cd /tmp/apf-0.9.6-2
echo "Updating the system ..."
yum -y update

After booting from the installation media just type:

linux ks=nfs: 

and the system will continue the installation using the kickstart file and the OS installation location defined in it.

No comments:

Post a Comment