Skip to content

Linux at NC State

wiki support   search:

Chapter 7. Customizing Your Kickstart Config

This section examines the kickstart configuration file in some detail and explains both the standard entries and the NCSU customization entries.

Standard Kickstart Configuration Paramaters

We'll be going through a kickstart config file generated by the NCSU kickstart generator located at https://secure.linux.ncsu.edu/kickstart-9.

For the sake of thoroughness, we'll put the entire kickstart config file here so you can see it as a whole.

#Kickstart Configuration
#Generated by the Kickstart Config Generator for the NCSU Realm Linux for Red Hat Linux 9
#Please post any questions to realmlinux-dev@lists.ncsu.edu
#More information on kickstarts can be found at:
#   http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/custom-guide/s1-kickstart2-options.html

#setup language support
lang en_US
langsupport --default en_US en_US

#network settings
network --bootproto=dhcp

#where to install from
url --url ftp://kickstart.linux.ncsu.edu/pub/realmkit/realmkit-WS3/i386

#setup keyboard
keyboard us

#partitioning
zerombr yes
clearpart --all
part / --size 3072
part /boot --size 128
part /tmp --size 256
part /var --size 374
part /var/cache --size 512
part swap --recommended

#tell anaconda to install rather than upgrade
#Note: we do not support/recomend realmkit upgrades
install

#setup mouse
mouse generic3ps/2

#set timezone
timezone --utc US/Eastern

#configure X
xconfig --startxonboot --resolution 1280x1024 --defaultdesktop=GNOME --depth 16

#set root password
rootpw --iscrypted $1$Rig3dbXb$OWcv00J/V2WsBGcgx0bmp1

#setup authentication for campus
auth --useshadow --enablemd5 --enablehesiod --hesiodlhs .NS --hesiodrhs .EOS.NCSU.EDU --enablekrb5 --krb5realm=EOS.NCSU.EDU --krb5kdc=kerberos-1.eos.ncsu.edu:88,kerberos-2.eos.ncsu.edu:88,kerberos-3.eos.ncsu.edu:88,kerberos-4.unity.ncsu.edu:88 --krb5adminserver=kerberos.eos.ncsu.edu:749

# only let dhcp and ssh through the firewall
firewall --medium --ssh --dhcp

#setup boot loader
bootloader --location mbr

#reboot after we're done
reboot

%packages
@NCSU Realm Linux Base
@ NCSU Realm Linux Workstation

%post
#we need to tell anaconda what dns server to use for the rest of the install
#if you have a nameserver behind a firewall and you entend to use it during the
#post you will need to add it here
cat << EOF > /etc/resolv.conf
nameserver 152.1.1.22
nameserver 152.1.1.206
nameserver 152.1.1.161
EOF

# this gets kind of hairy, so be careful if you change anything!

#log the date and packages that were initialy installed
echo "Kickstarted `/bin/date +%D`" > /.version
rpm -qa | sort >> /.version

#configre clustering
realmconfig --kickstart clusters --local-disable
realmconfig --kickstart clusters --remote-disable

# make startup non-interactive
mv /etc/sysconfig/init /etc/sysconfig/init~
sed 's/^PROMPT=yes$/PROMPT=no/' < /etc/sysconfig/init~ > /etc/sysconfig/init
rm /etc/sysconfig/init~

#add users to /etc/users.local
cat << EOF > /etc/users.local
jjneely
EOF

#add root instances
cat << EOF > /root/.klogin
jjneely.root@EOS.NCSU.EDU
EOF
chmod 400 /root/.klogin

#setting up sudo
mv /etc/sudoers /etc/sudoers~
cat << EOF > /etc/sudoers
EOF
chmod 400 /etc/sudoers

realmconfig --kickstart sendmail --disable-daemon --masquerade unity.ncsu.edu

#setup department
realmconfig --kickstart dept --set pams

#setup printer
realmconfig --kickstart printing --default lp

#setup updates
realmconfig --kickstart updates --enable-updates

#setup tmpclean
realmconfig --kickstart tmpclean --enable-tmpclean

#setup support
#This makes your machine eligible for support by your systems
#administrator.  It is required for support but in no way does
#it guarantee support.
#Note: this means that you WILL NOT have root access to your machine
realmconfig --kickstart support --enable-support

# Have man -k work immediately post-install
/usr/sbin/makewhatis

The following is a very quick outline of how this kickstart works. If anyone would like to contribute a more complete description I will gladly include it here. Folks wanting to tweak the nitty-gritty aspects of Red Hat kickstarts should read the kickstart documentation in Red Hat's Customization guide. Especiall the Kickstart Options.

As usual, comment lines are delineated by a '#' character in the first column.

The first line in the file is “lang en_US”, which simply tells the installer to use the English language, customized for the United States.

The next line is “network --bootproto dhcp”. This line tells the installer to use DHCP to obtain and IP address and activate networking. If you want to give the system a customized IP address after generating the kickstart config and don't want to regenerate, change this line to something like “network --bootproto static --ip 152.1.95.61 --netmask 255.255.255.192 --gateway 152.1.95.1 --nameserver 152.1.1.161”. Of course, you will need to modify those values appropriately, since those are the values for a machine already on the network, and attempting to pirate an active IP address isn't very nice and a violation of campus computing policy.

The third line tells the system how to retrieve the packages that we're going to install. In this case, we want to use FTP from tp://kickstart.linux.ncsu.edu/pub/realmkit/realmkit-9/i386 . NFS installs from kickstart.linux.ncsu.edu and HTTP installs from install.linux.ncsu.edu are also supported.

keyboard us” tells the system to assume a standard 101-key United States qwerty-type keyboard layout.

The next line is where thing actually start happening. The “zerombr yes” tells the system to begin by completely zeroing out the MBR of the boot drive. This causes the bootstrap information, meaning the disk we're installing to will be unable to boot until the installation process has completed. This line is very closely linked to the next line, which we'll examine now.

The “clearpart --all” line tells the installer to delete all partitions which currently exist on the disk. This will cause all data on the disk to become effectively unreadable; if you have a preexisting OS installation which you want to preserve, you should set this option to “clearpart --linux” and set the previous option to “zerombr no”.

The next six lines of the file tell the installer how to partition the hard drive. Each line begins with the directive “part”, followed bt a partition mount point, followed by a “--size” directive and parameter. The number of partitions you create is optional; you can have any number of mount points you wish. The only required partitions are / and swap. The partition scheme given here is the one used by ITECS to create new Linux boxes for the labs. The /boot is recommended to make kernel management easier, although it probably won't gain you much if you don't plan on doing any major kernel modifications.

The next line tells the installer what type of install to perform - an “install” install or an “upgrade” install. Since we're starting fresh, we obviously have nothing to upgrade, so we've chosen “install”. If you choose the “upgrade” install option, you should be sure to specify “zerombr no” and not have any “clearpart” directives in the config file.

Finally, following all the key words that define how the install is to work and the package selection we have the %post section. This is where all the magic and extra setup that Realm Linux needs is done. Its just a normal Bash script.