System info, e.g. disk partitioning and network config
RedHat packages to install
Post-installation shell commands to run
There are some other possibilities which we won't talk about here, but
might work. For more information check out the sample
KickStart config in misc/src/install/ks.samp and
doc/README.ks under the top level i386 RedHat
distribution directory on your CD-ROM or local RedHat mirror site.
The available directives which I've been using are:
lang
Language configuration, e.g. for English
lang en
network
Network configuration, e.g. to use BOOTP/DHCP
network --bootp
nfs
NFS server and directory to install from, e.g.
nfs --server chicken.swedish-chef.org /mnt/cdrom
to use the NFS server chicken.swedish-chef.org and try to
mount the RedHat distribution from the directory /mnt/cdrom.
keyboard
Select keyboard type, e.g. for UK keyboards
keyboard uk
zerombr
Clear the Master Boot Record - removes any existing
operating system boot loader from your disk
clearpart
Clear existing partitions - e.g. to remove all existing
disk partitions prior to installation
clearpart --all
part
Partition the disk, e.g. to make a root filesystem of
500MB
part / --size 500
install
Make a fresh installation of RedHat Linux.
mouse
Set the mouse being used, e.g. for a PS/2 or compatible
"bus mouse"
mouse ps/2
timezone
Set the timezone, e.g. for local time in the UK
timezone --utc Europe/London
rootpw
Set the initial root password, based on a previously
derived encrypted password
rootpw --iscrypted XaacoeGPmf/A.
lilo
Install the LILO boot loader, e.g. in the Master Boot Record
lilo --location mbr
%packages
Packages to install - see below.
%post
Post-installation shell commands - see below.
Note that the directory where KickStart is looking for the RedHat
distribution should have a subdirectory RedHat, which
contains the RedHat distribution tree for the platform in question.
In the above example, we should see something like the following files
and directories:
If you have the RedHat distribution for multiple architectures (e.g.
on an NFS server - they're too big to fit more than one architecture's
version onto a single CD-ROM), you'll notice that each distribution
has the same files and directories under a subdirectory, e.g.
I've not delved too deeply into this last one, because I'm not ever
planning to run X on the console of any of my KickStarted machines.
I'm told that running xconfig within KickStart itself is a
bit flaky, but the same functionality is also available from the
command line via Xconfigurator - so you might be best off
leaving this to the post-installation script.
Here's how this first part of a KickStart config file looks when we
put all the bits together:
lang en
network --static --ip 198.168.254.253 --netmask 255.255.255.0
--gateway 198.168.254.1 --nameserver 198.168.254.2
nfs --server chicken.swedish-chef.org /mnt/cdrom
keyboard uk
zerombr yes
clearpart --all
part / --size 500
part swap --size 120
install
mouse ps/2
timezone --utc Europe/London
rootpw --iscrypted XaacoeGPmf/A.
lilo --location mbr
Note that some of the RedHat documentation refers to an invocation
of the network directive which doesn't actually work in
practice: network --option. The correct invocation is to
put network followed by --static, --bootp
or --dhcp. Be aware that the BOOTP and DHCP options are
different - to the extent that they even use different code.
You can add the --grow parameter to a part
directive to indicate that it's OK to grow the partition beyond
the size you specify. It probably only makes sense to have one
partition tagged with --grow.
The start of the packages section of the KickStart config file is
indicated by the presence of a %packages directive on a line
of its own. This is followed by one or both of two types of package
specifier - individual packages may be installed by giving the name of
their RPM (excluding the version and platform information), and groups
of packages may be installed by giving their group name.
Here's a sample packages section for a KickStart config file:
%packages
@ Base
netkit-base
bind-utils
ncftp
rdate
tcp_wrappers
traceroute
cmu-snmp
So, what are these groups ? Well, there are a number of groups
defined by default in a file called base/comps under the
RedHat distribution's top level directory. Here are the ones which
were current at the time of writing:
Base
Printer Support
X Window System
Mail/WWW/News Tools
DOS/Windows Connectivity
File Managers
Graphics Manipulation
X Games
Console Games
X multimedia support
Console Multimedia
Print Server
Networked Workstation
Dialup Workstation
News Server
NFS Server
SMB (Samba) Connectivity
IPX/Netware(tm) Connectivity
Anonymous FTP/Gopher Server
Web Server
DNS Name Server
Postgres (SQL) Server
Network Management Workstation
TeX Document Formatting
Emacs
Emacs with X windows
C Development
Development Libraries
C++ Development
X Development
Extra Documentation
You'll notice that they correspond to the various configurations which
you're prompted for during a manual installation. Note that some of
the packages in a given package group are duplicated in other groups,
and that you can install multiple groups of packages without this
causing problems. Each group's entry in the comps listing
looks similar to this:
0 Extra Documentation
sag
lpg
howto
faq
man-pages
end
It seems that groups with a 1 next to their name (the first
line above) are selected for installation by default. You can customise
the Linux installation process even further by creating your own groups
or redefine existing ones by editing this file.
This is probably the best feature of all, and something which there is
no direct equivalent to in the manual installation process. What we
can do here is specify a sequence of shell level commands which should
be executed after the main installation (disk partitioning, package
installation, and so on) is complete.
The beginning of this section is signified by the %post
directive in the KickStart config file. In what follows you can take
advantage of all of the utilities which have been installed on your
newly built Linux system, e.g.
Note that you can achieve the same effect by making your own RPMs
containing the commands you want executed - see below for more
information. Give them a carefully chosen name and you can force them
to be installed first (e.g. name starts with 'aaa') or last (e.g.
name starts with 'zzz').
Be aware that a less painful way of doing root crontab entries is to
create them as files in one or more of the directories
/etc/cron.hourly, /etc/cron.daily,
/etc/cron.weekly and /etc/cron.monthly.
More information about making your own RPMs is available in Appendix B.