Chapter 1. Introduction

What are Kickstart Installations?

Many system administrators would prefer to use an automated installation method to install Fedora or Red Hat Enterprise Linux on their machines. To answer this need, Red Hat created the kickstart installation method. Using kickstart, a system administrator can create a single file containing the answers to all the questions that would normally be asked during a typical installation.

Kickstart files can be kept on single server system and read by individual computers during the installation. This installation method can support the use of a single kickstart file to install Fedora or Red Hat Enterprise Linux on multiple machines, making it ideal for network and system administrators.

Kickstart provides a way for users to automate a Fedora or Red Hat Enterprise Linux installation.

How Do You Perform a Kickstart Installation?

Kickstart installations can be performed using a local CD-ROM, a local hard drive, or via NFS, FTP, or HTTP.

To use kickstart, you must:

  1. Create a kickstart file.
  2. Create a boot diskette with the kickstart file or make the kickstart file available on the network.
  3. Make the installation tree available.
  4. Start the kickstart installation.

This chapter explains these steps in detail.

Creating the Kickstart File

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 sample.ks file found in the RH-DOCS directory of the Fedora or Red Hat Enterprise Linux Documentation CD, using the Kickstart Configurator application, or writing it from scratch. The Fedora or Red Hat Enterprise Linux installation program also creates a sample kickstart file based on the options that you selected during installation. It is written to the file /root/anaconda-ks.cfg. You should be able to edit it with any text editor or word processor that can save files as ASCII text.

First, be aware of the following issues when you are creating your kickstart file:

If any other items are specified for an upgrade, those items will be ignored (note that this includes package selection).

Chapter 2. Kickstart Options

The following options can be placed in a kickstart file. If you prefer to use a graphical interface for creating your kickstart file, you can use the Kickstart Configurator application.

/!\ If the option is followed by an equals mark (=), a value must be specified after it. In the example commands, options in brackets ([]) are optional arguments for the command.

auth or authconfig (required)

Sets up the authentication options for the system. This is just a wrapper around the authconfig program, so all options recognized by that program are valid for this command. See the manual page for authconfig for a complete list.

By default, passwords are normally encrypted and are not shadowed.

autopart (optional)

autostep (optional)

bootloader (required)

clearpart (optional)

cmdline (optional)

device (optional)

dmraid (optional)

driverdisk (optional)

firewall (optional)

firstboot (optional)

graphical (optional)

install (optional)

ignoredisk (optional)

interactive (optional)

iscsi (optional)

iscsiname (optional)

key (optional)

keyboard (required)

    be-latin1, bg, br-abnt2, cf, cz-lat2, cz-us-qwertz, de, de-latin1,
    de-latin1-nodeadkeys, dk, dk-latin1, dvorak, es, et, fi, fi-latin1,
    fr, fr-latin0, fr-latin1, fr-pc, fr_CH, fr_CH-latin1, gr, hu,
    hu101, is-latin1, it, it-ibm, it2, jp106, la-latin1, mk-utf, no,
    no-latin1, pl, pt-latin1, ro_win, ru, ru-cp1251, ru-ms, ru1, ru2,
    ru_win, se-latin1, sg, sg-latin1, sk-qwerty, slovene, speakup,
    speakup-lt, sv-latin1, sg, sg-latin1, sk-querty, slovene, trq, ua,
    uk, us, us-acentos

lang (required)

logvol (optional)

    part pv.01 --size 3000
    volgroup myvg pv.01
    logvol / --vgname=myvg --size=2000 --name=rootvol

logging (optional)

mediacheck (optional)

monitor (optional)

multipath (optional)

network (optional)

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

part or partition (required for installs, ignored for upgrades)

raid (optional)

    part raid.01 --size=60 --ondisk=sda
    part raid.02 --size=60 --ondisk=sdb
    part raid.03 --size=60 --ondisk=sdc

    part swap --size=128 --ondisk=sda
    part swap --size=128 --ondisk=sdb
    part swap --size=128 --ondisk=sdc

    part raid.11 --size=1 --grow --ondisk=sda
    part raid.12 --size=1 --grow --ondisk=sdb
    part raid.13 --size=1 --grow --ondisk=sdc

    raid / --level=1 --device=md0 raid.01 raid.02 raid.03
    raid /usr --level=5 --device=md1 raid.11 raid.12 raid.13

reboot (optional)

repo (optional)

selinux (optional)

services (optional)

skipx (optional)

text (optional)

timezone (required)

updates (optional)

upgrade (optional)

user (optional)

vnc (optional)

volgroup (optional)

    part pv.01 --size 3000
    volgroup myvg pv.01
    logvol / --vgname=myvg --size=2000 --name=rootvol

xconfig (optional)

zerombr (optional)

zfcp (optional)

%include

%ksappend

Chapter 3. Package Selection

Use the %packages command to begin a kickstart file section that lists the packages you would like to install (this is for installations only, as package selection during upgrades is not supported).

Packages can be specified by group or by individual package name. The installation program defines several groups that contain related packages. Refer to the repodata/comps.xml file on the first CD-ROM for a list of groups. Each group has an id, user visibility value, name, description, and package list. In the package list, the packages marked as mandatory are always installed if the group is selected, the packages marked default are selected by default if the group is selected, and the packages marked optional must be specifically selected even if the group is selected to be installed.

In most cases, it is only necessary to list the desired groups and not individual packages. Note that the Core and Base groups are always selected by default, so it is not necessary to specify them in the %packages section.

The %packages section should be closed with %end, though this is not yet required. It will be required in the future, however. Also, multiple %packages sections may be given. This may be handy if the kickstart file is used as a template and pulls in various other files with the %include mechanism.

Here is an example %packages selection:

    %packages
    @X Window System
    @GNOME Desktop Environment
    @Graphical Internet
    @Sound and Video
    dhcp
    %end

As you can see, groups are specified, one to a line, starting with an @ symbol, a space, and then the full group name as given in the comps.xml file. Groups can also be specified using the id for the group, such as gnome-desktop. Specify individual packages with no additional characters (the dhcp line in the example above is an individual package).

Additionally, individual packages may be specified using globs. For instance:

    %packages
    vim*
    kde-i18n-*
    %end

This would install all packages whose names start with vim or kde-i18n.

You can also specify which packages not to install from the default package list:

    %packages
    -autofs
    %end

The following options are available for the %packages option:

--default

--excludedocs

--ignoremissing

--nobase

In addition, group lines in the %packages section can take options as well:

--nodefaults

--optional

Chapter 4. Pre-installation Script

You can add commands to run on the system immediately after the ks.cfg has been parsed. This section must be at the end of the kickstart file (after the commands) and must start with the %pre command. You can access the network in the %pre section; however, name service has not been configured at this point, so only IP addresses will work.

Preinstallation scripts should be closed with %end, though this is not yet required. It will be required in the future, however.

/!\ Note that the pre-install script is not run in the change root environment.

--interpreter /usr/bin/python

--erroronfail

--log=

Example

Here is an example %pre section:

%pre
#!/bin/sh
hds=""
mymedia=""

for file in /proc/ide/h*
do
  mymedia=`cat $file/media`
  if [ $mymedia == "disk" ] ; then
      hds="$hds `basename $file`"
  fi
done

set $hds
numhd=`echo $#`

drive1=`echo $hds | cut -d' ' -f1`
drive2=`echo $hds | cut -d' ' -f2`

#Write out partition scheme based on whether there are 1 or 2 hard drives

if [ $numhd == "2" ] ; then
  #2 drives
  echo "#partitioning scheme generated in %pre for 2 drives" > /tmp/part-include
  echo "clearpart --all" >> /tmp/part-include
  echo "part /boot --fstype ext3 --size 75 --ondisk hda" >> /tmp/part-include
  echo "part / --fstype ext3 --size 1 --grow --ondisk hda" >> /tmp/part-include
  echo "part swap --recommended --ondisk $drive1" >> /tmp/part-include
  echo "part /home --fstype ext3 --size 1 --grow --ondisk hdb" >> /tmp/part-include
else
  #1 drive
  echo "#part