Cover V09, I01
Article
Sidebar 1
Table 1

jan2000.tar


Kickstart

James O'Kane

Your company just bought 30 new machines, and it's your job to install Linux on them. If you're using Red Hat Linux, the kickstart install process can save you a lot of time.

Kickstart automates the install process, so that it becomes as simple as putting the floppy in, turning the machine on, and coming back 15 minutes later. Kickstart is especially useful if you have a number of machines with similar configurations. In the simplest case, all you need is an up-to-date boot floppy, a kickstart config file, and an installation CD-ROM. For trickier installs, you might also need a DHCP or bootp server, an NFS server, and a DNS server.

A kickstart installation requires that you predefine all necessary installation data in a kickstart config file. The kickstart config file can be split into three parts -- the preinstall, the packages, and the post-install.

The preinstall section of the config file is used to answer the questions that are usually asked before the install starts. The options, which will be described below, are: lang, network, {nfs|cdrom|url|harddrive}, {device|noprobe}, keyboard, zerombr, clearpart, part, {install|upgrade}, mouse, timezone, {xconfig|skipx}, rootpw, auth, lilo. See “Configuration Options” for a description of the preinstall section options.

Next, comes the packages section. In this section, you tell the install what rpms you want installed. There are two ways of doing this. The first way is to use one of the predefined groups similar to those listed during the manual install. These groups are prefixed with an “@”, such as @ Base, @ Printer Support, @ C Development, etc. (See RedHat/base/comps on an install image for a complete list.) The second way is to list packages by name, but with the endings dropped (e.g., bash2-2.03-4.i386.rpm becomes just bash2). This information is useful if the version numbers of the package change.

After the packages section is the post-install phase. During this phase, you can do almost anything you want with your newly installed system, such as, copying customized config files into place and installing custom RPMs that are not distributed with the default install. With the config file (saved as ks.cfg) on a standard Red Hat boot floppy, you can start the kickstart install by typing “linux ks=floppy” at the Lilo boot prompt.

Now that I've illustrated the general idea behind a config file, I'll build one as an example. I'll use the following scenario as the install environment: a networked workstation to be installed from an NFS volume. This workstation has a vanilla SVGA video card and will also have a Hitachi SuperScan Elite 802Plus monitor attached to it.

First, I choose the language as “en” and keyboard as “us”. Next, I decide on the network setup -- in this case, I'm going to use one of the private IP numbers, 10.0.0.45, with a gateway of 10.0.0.1, netmask of 255.0.0.0, and the nameserver of 10.0.0.33. Since I am installing from NFS, I need to know that the server happens to be called nfs and that the Red Hat install files can be found in /mnt/cdrom. I also know that the only device that will not be detected correctly is the Ethernet card, so I add a device line for that. Thus far, I have:

lang en
network --bootproto static --ip 10.0.0.45 --netmask 255.0.0.0 --gateway
10.0.0.1 nameserver 10.0.0.33
nfs --server nfs --dir /mnt/cdrom
device ethernet 3c509 --opts "io=0x330, irq=7"
keyboard us

Next, I'll set up Linux partitions and swap space. Because I plan to use the whole drive for Linux, I use zerombr, and clearpart --all. For the partitions I want a 10 M /boot, 1 g /, 128 in swap, and the rest given to /home. This option allows me to have any size drive as long as it's bigger than 1138 megs or so. This section of the config looks like this:

zerombr
clearpart  --all
part /boot --size 10
part swap  --size 127
part /     --size 1000
part /home --size 500   --grow

I want to install a new system, so I will put install on the next section of the config. The mouse on this machine is a PS/2-style mouse, so this line will set that up correctly. I happen to live in the Eastern timezone of the United States, so US/Eastern works for me.

install
mouse --kickstart genericps/2 --device psaux
timezone US/Eastern

One of the hard parts of this process is getting the X configuration correct. By looking at the manual for my monitor, I found it has horizontal and vertical sync ranges of 31-100 and 50-160, respectively. Because I'm using a generic SVGA card, I'll use the SVGA server:

xconfig --server "SVGA" --hsync "31-100" --vsync "50-160"

Next, I must deal with the root password. I recommend putting it in encrypted form, which you can grab from /etc/passwd. Red Hat 6.0 supports NIS setups, shadow, and MD5 passwords, so I also need to set up those. I want no NIS and shadow passwords. Finally, I set up lilo.

rootpw --iscrypted 5Xy6YBuFGTfKc
auth --kickstart --nostart --useshadow
lilo --location mbr

Now that we have the basic machine config setup, we move onto the packages setup. We just want the ‘Workstation' setup plus all the development packages and bsd-games. (See Table 1 for a full listing of my config.)

%packages
@ Workstation
@ C Development
bsd-games

The final part of the config will be %post. With this setup, there isn't much that I want to do except turn off Apache by default. In this section, I can run any command that has been installed on my new system, including any network commands (however, DNS will not work at this point).

%post
chkconfig httpd off

If you want a quick and dirty way to make this config file, you can try a script written by Alan Cox called “mkkickstart” that is usually installed in /usr/sbin. If you get stuck, there are a few places you can look for help. One place is the README.ks file found in /doc from the install CD. Other resources are the Kickstart-HOWTO found at:

http://metalab.unc.edu/LDP/HOWTO/KickStart-HOWTO.html

or your favorite LDP mirror. Both files have been helpful to me in setting up kickstart files and in writing this article.

About the Author

During the day, James spends his time as the Linux admin at Just Research (http://www.justresearch.com) and at night, he pulls his hair out working on getting Midnight Linux off the ground (http://www.midnightlinux.com). He can be reached at: jo2y@midnightlinux.com.