Next Up Previous Contents Index
The Kickstart File

H.3 The Kickstart File

Now that you have some background information on kickstart installations, let's take a look at the kickstart file itself. The kickstart file is a simple text file, containing a list of items, each identified by a keyword. You can create it by editing a copy of the README.ks file found in the docs/ directory of a Red Hat Linux CD-ROM, or you can create it from scratch. You should be able to edit it with any text editor or word processor that can save files as ASCII text.

First, some ground rules to keep in mind while creating your kickstart file:

Let's take a look at each item in order.

H.3.1 lang -- Language Setting

The first item that must appear is the language setting. The language you specify will be used during the installation as well as to configure any language-specific aspect of the installed system. The language specification must be a two letter ISO language code, such as en for English, de for German, fr for French, and so on. For example, to set the language to English, the kickstart file should contain the following line:

lang en

H.3.2 network -- Networking Configuration

The next item is the network configuration information. This line is used to tell the system how it should configure networking for itself. It is optional, and if omitted, the system will be configured for stand-alone operation.

There are three different methods of network configuration:

The DHCP method uses a DHCP server system to obtain its networking configuration. As you might guess, the BOOTP method is similar, requiring a BOOTP server to supply the networking configuration.

The static method requires that you enter all the required networking information in the kickstart file. As the name implies, this information is static, and will be used during the installation, and after the installation as well.

To direct a system to use DHCP to obtain its networking configuration, use the following line:

network --bootproto dhcp

To direct a machine to use BOOTP to obtain its networking configuration, use the following line in the kickstart file:

network --bootproto bootp

The line for static networking is more complex, as you must include all network configuration information on one line. You'll need to specify:

Here's an example static line:

network --bootproto static ¬
--ip 10.0.2.15 ¬
--netmask 255.255.255.0 ¬
--gateway 10.0.2.254 ¬
--nameserver 10.0.2.1

Please Note: The entire network configuration must appear on one line! We've wrapped it here to make it easier to read.

Note that there are two restrictions you must keep in mind should you use the static method:

H.3.3 Installation Methods

The next required item is the installation method. This item directs the installation program to the rest of the files required to install Red Hat Linux. There are two choices: NFS or CD-ROM. Let's look at both, starting with NFS.

H.3.4 nfs -- The NFS Installation Method

For the NFS installation method, you must include the NFS server's name and the directory to be mounted. Here's an example:

nfs --server hostname.of.server --dir /path/to/RH/CD/image

H.3.5 cdrom -- The CD-ROM Installation Method

For a CD-ROM-based kickstart installation, simply use the following line:

cdrom

H.3.6 device -- Optional Hardware Information

The next set of items in the kickstart file are used to specify optional hardware information. For most PCI-based hardware you can omit this step, as this information can be obtained directly from the hardware. Note that IDE hard disks and common PCI cards fall into this category. Any other hardware may need to be specified here.

To specify a device, start with the device keyword, followed by the type of device:

If a kernel module is required to support the device, the module name follows the device type.

Finally, if there are any parameters that are required by a device, they can be specified by using the --opts option. Enclose the parameters in quotes after --opts. We'll show you some examples below.

Note that you can specify more than one type of device in a given kickstart file. For example, if you know the machines you'll be kickstart-installing have either an Adaptec 1542 or a Buslogic SCSI card, you can enter both in the kickstart file. But be aware that the installation program uses only the first card found, so order the device entries appropriately.

An example for an ISA 3com Ethernet card would be:

device ethernet 3c509 --opts "io=0x330, irq=7"

Here's an example line for an Adaptec 1542 SCSI card:

device scsi aha154x

An example of a SoundBlaster CD-ROM might look like this:

device cdrom --opts "io=0x240"

H.3.7 keyboard -- Keyboard Type

The next item you'll need to specify is the correct code for your keyboard type. For US keyboards, the type is us. For the others, please run the /usr/sbin/kbdconfig program on an already-installed Red Hat Linux system. An alternative approach would be to set the keyboard type to us and run kbdconfig on the installed system to set it properly after the installation completes).

An example of this would be:

keyboard us

H.3.8 Partitioning

The hard drive in the machine must be partitioned before Red Hat Linux can be installed. In this section, we will describe how to specify disk partitioning in the kickstart file.

H.3.9 zerombr -- Partition table initialization

First, if you are installing Red Hat Linux on a new machine, you should use the zerombr keyword to clear the current partition information. This is a good idea, because the partition table on new hard drives is usually bogus. Here's an example of zerombr on a new system:

zerombr yes

On the other hand, if you are installing machines that have a valid partition table, even if you want to change part (or all) of it, you should use zerombr this way:

zerombr no

H.3.10 clearpart -- Removing partitions based on partition type

The next command is optional, but can come in handy. If you'd like to remove all partitions, or just any Linux-related partitions, you can use clearpart. For example, to clear all partitions of type ``Linux native'' and ``Linux swap'', you could add this line:

clearpart --linux

To clear all partitions from a disk, this line would do the trick:

clearpart --all

The only options clearpart supports are --linux and --all.

H.3.11 part -- Partition definition

The next step is to specify the partitions you want to create. These will only be created using the system's unpartitioned free space. In other words, if the machine had Windows-related partitions, and you had done clearpart --linux those Windows partitions would remain untouched). You must enter one partition per line using the following format:

part <mntpt> --size <size in megs> [--grow] ¬
[--maxsize <size in megs>]

(This part line was broken to make it more readable.)

<mntpt> is the location you are going to mount that partition in your installed system (for example, the root partition would have a mount point of /, while you may decide that another partition should have a mount point of /home).

<size in megs> is the size of the partition in megabytes. You can optionally specify that the partition is growable by adding the --grow option. Note that making a partition growable does not mean that you can later increase its size. Instead, a growable partition will be automatically resized to use all available unpartitioned free space (after all fixed-size partitions have been created).

Since the amount of unpartitioned free space can vary, and you probably want to use it all, by tagging partitions as growable you can easily make sure no space is wasted. If you have multiple partitions tagged as growable, the free space is split evenly among them.

Note that you can also limit the size of growable partitions with the optional --maxsize argument.

Here's an example of kickstart partitioning in action. Let's say you know the smallest disk out of a set of machines you plan to kickstart-install is 1GB. You'd like to use the same kickstart file. You could use the following partitioning scheme:

zerombr no
clearpart --all
part / --size 250
part swap --size 50
part /usr --size 500 --grow --maxsize 800
part /tmp --size 100 --grow

When defined this way, the installation program will first clear all partitions. It will then set up a 250MB root filesystem, followed by a 50MB swap partition. Next the installation program will create a /usr partition of at least 500MB (remember, it's growable), but it cannot grow beyond 800MB. Finally, the last line will create a /tmp partition of at least 100MB (again, it's growable).

So for that 1GB system, you would end up with a 250MB root, a 50MB swap, a 550MB /usr, and a 150MB /tmp partition. If another system has a 2GB drive, you would get a 250MB root, a 50MB swap, a 800MB /usr, and a 900MB /tmp.

H.3.12 install and upgrade -- Install/Upgrade Selection

The next item to specify is whether you are doing a fresh install, or an upgrade of an already-installed system. For a fresh install, use:

install

For an upgrade of an existing system, use:

upgrade

Keep in mind that for upgrades, the only items that matter are:

H.3.13 mouse -- Mouse Configuration

To define the type of mouse your system has, you must use the mouse keyword. Run mouseconfig --help on an already-installed Red Hat Linux for a list of mouse types.

Depending on the type of mouse, you may also need to specify the device to which the mouse is attached. The default device is correctly set for bus mice. For serial mice, the default device is /dev/cua0, but can be overridden with the --device option followed by the device name, such as cua1.

For example, for a three-button PS/2 mouse, you would use:

mouse --kickstart generic3ps/2

For a two-button PS/2 mouse, use:

mouse --kickstart genericps/2

For a two-button Microsoft mouse on your second serial port, use:

mouse --kickstart microsoft --device cua1

H.3.14 timezone -- Timezone Definition

Red Hat Linux is timezone-aware, so you'll need to specify the timezone in which the machine will operate. This is done using the timezone keyword. There are many different timezones; the best way to find yours is to run /usr/sbin/timeconfig on an already-installed Red Hat Linux system.

If you would like to have your system's hardware clock set to use GMT/UTC, add the --utc option to your timezone line. Here's an example that defines the timezone as US Eastern with the system clock set to GMT:

timezone --utc US/Eastern

H.3.15 xconfig -- X Window Setup

The next item is the X Window setup line. The installation program will normally find common PCI video hardware and will know which X server to install. The keyword for X configuration is xconfig.

If your video card isn't probed properly, you can use the --card option to explicitly specify the card. You can use Xconfigurator --help on a running Red Hat Linux system to get a list of supported cards to choose from.

If your card isn't in the list but is supported by one of the existing servers, you can simply install the proper server by using the --server option. Again, use Xconfigurator --help to get the list of server names.

You also need to specify a monitor type. If you don't, the installation will assume a generic monitor capable of 640x480@60hz. Use the --monitor option to specify something other than the default. Again, Xconfigurator --help will list all valid monitor types.

If your monitor isn't listed, you can enter the actual monitor specifications by using the --hsync and --vsync options for horizontal and vertical sync rates, respectively. The rates may be single numbers (representing kilohertz and megahertz, as appropriate), groups of numbers separated by commas, or two numbers separated by a dash (signifying a range). For example:

xconfig --hsync "31.5,35.5,50-65" --vsync "50-70"

An example for a machine where the video card can be autoprobed properly would be:

xconfig --monitor "tatung cm14uhe"

An example for a machine where nothing is probed and the monitor isn't in the list might be:

xconfig --server "Mach64" --hsync "31.5,35.5,50-65" --vsync "50-70"

H.3.16 rootpw -- Setting the Root Password

You can put the root passwd in a kickstart file in the clear (in which case it would go over the network in the clear on an NFS install) or you can specify that an encrypted password is to be used. To specify an unencrypted password in the kickstart file, use the rootpw keyword, followed by the cleartext password:

rootpw mypasswd

If you would rather use an encrypted password, grab it out of /etc/passwd (or wherever you have the encrypted version stored), and add the --iscrypted option:

rootpw --iscrypted encryptedpasswdstring

H.3.17 lilo -- LILO Configuration

For machines that use LILO (Intel-based systems), you can specify the LILO configuration using the lilo keyword. The default line can be as simple as this:

lilo

This will install LILO in the hard drive's master boot record (MBR), and automatically configure boot entries for your Linux installation as well as a DOS or Windows installation (if one is present).

If you don't want LILO installed in the MBR, you can do so with by using the --location option. There are three possible places where LILO can be installed:

You can also use the --append option to add an append= line to the Linux boot entry. This is handy if you need to do things like set memory sizes, etc. For example, to install LILO on the MBR on a machine with 128MB of RAM, you would add the following lilo line:

lilo --append "mem=128M" --location mbr

(Due to the new kernel in Red Hat Linux 5.2, the mem boot-time option shouldn't be necessary, but we needed an example.)

H.3.18 %packages -- Package Selection

You can use the %packages keyword to start the beginning of a kickstart file section that lists the packages you'd like to install (Note that this is for installs only, as package selection during upgrades is not supported).

Packages can be specified by component or by individual package name. The installation program defines several components that group together related packages. See the RedHat/base/comps file on any Red Hat Linux CD-ROM for a list of components. The components are defined by the lines that begin with a number followed by a space, and then the component name. Each of the packages in that component are then listed, line-by-line, until the end keyword. Individual packages lack the leading number found in front of component lines.

In most cases, it's only necessary to list the desired components and not individual packages. Note that the Base component is always selected by default, so it's not necessary to specify it in the %packages section.

Here's an example %packages section:

@ Networked Workstation
@ C Development
@ Web Server
@ X Window System
bsd-games

As you can see, components are specified, one to a line, starting with an ``@'' symbol, a space, and then the full component name as given in the comps file. Specify individual packages with no additional characters (The bsd-games line in the example above is an individual package).

Please Note: You can also direct the kickstart install to use the workstation- and server-class intallation methods. To do this, simply add one of the following lines to the %packages section:

@ Workstation
@ Server

H.3.19 %post -- Post-Installation Configuration Section

You have the option of adding commands to be run on the installed system after the installation is complete. This section must be at the end of the kickstart file and must start with the %post keyword. Note that you can access the network in the %post section; however, nameservice has not yet been configured at this point, so only IP addresses will work. Here's an example %post section:


# add comment to /etc/motd
echo "Kickstart-installed Red Hat Linux `/bin/date`" > /etc/motd

# add another nameserver echo "nameserver 10.10.0.2" >> /etc/resolv.conf

This section creates a message-of-the-day file containing the date the kickstart installation took place, and gets around the network keyword's one-nameserver-only limitation by adding another nameserver to /etc/resolv.conf.


Next Up Previous Contents Index