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 Red Hat Linux Documentation CD, using Kickstart Configurator, or writing it from scratch. The Red Hat 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:

  • Sections must be specified in order. Items within the sections do not have to be in a specific order unless otherwise specified. The section order is:

    • The Command section: Refer to the “Kickstart Options” section of this chapter for a list of kickstart options. You must include the required options.

    • The %packages section: Refer to the “Package Selection” section of this chapter for details.

    • The %pre and %post sections: These two sections can be in any order and are not required. Refer to the “Pre-Installation Script” and “Post-Installation Script” sections of this chapter for details.

  • Items that are not required can be omitted.

  • Omitting any required item will result in the installation program’s prompting the user for an answer to the related item, just as the user would be prompted during a typical installation. Once the answer is given, the installation will continue unattended (unless it finds another missing item).

  • Lines starting with a pound sign (#) are treated as comments and ignored.

For kickstart upgrades, the following items are required:

  • Language

  • Language support

  • Installation method

  • Device specification (if device is needed to perform installation)

  • Keyboard setup

  • The upgrade keyword

  • Boot loader configuration

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

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 Kickstart Configurator. Refer to the “Kickstart Configurator” section of this chapter for details.

Note

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.

autostep (optional)

Similar to interactive except it goes to the next screen for you. It is used mostly for debugging.

auth or authconfig (required)

Sets up the authentication options for the system. It’s similar to the authconfig command, which can be run after the install. By default, passwords are normally encrypted and are not shadowed.

--enablemd5

Use md5 encryption for user passwords.

--enablenis

Turns on NIS support. By default, --enablenis uses whatever domain it finds on the network. A domain should almost always be set by hand with the --nisdomain= option.

--nisdomain=

NIS domain name to use for NIS services.

--nisserver=

Server to use for NIS services (broadcasts by default).

--useshadow or --enableshadow

Use shadow passwords.

--enableldap

Turns on LDAP support in /etc/nsswitch.conf, allowing your system to retrieve information about users (UIDs, home directories, shells, etc.) from an LDAP directory. To use this option, you must install the nss_ldap package. You must also specify a server and a base DN with --ldapserver= and --ldapbasedn=.

--enableldapauth

Use LDAP as an authentication method. This enables the pam_ldap module for authentication and changing passwords, using an LDAP directory. To use this option, you must have the nss_ldap package installed. You must also specify a server and a base DN with --ldapserver= and --ldapbasedn=.

--ldapserver=

If you specified either --enableldap or --enableldapauth, this variable will contain the name of the LDAP server to use. This option is set in the /etc/ldap.conf file.

--ldapbasedn=

If you specified either --enableldap or --enableldapauth, this variable will contain the DN (distinguished name) in your LDAP directory tree under which user information is stored. This option is set in the /etc/ldap.conf file.

--enableldaptls

Use TLS (Transport Layer Security) lookups. This option allows LDAP to send encrypted usernames and passwords to an LDAP server before authentication.

--enablekrb5

Use Kerberos 5 for authenticating users. Kerberos itself does not know about home directories, UIDs, or shells. So if you enable Kerberos you will need to make users’ accounts known to this workstation by enabling LDAP, NIS, or Hesiod or by using the /usr/sbin/useradd command to make their accounts known to this workstation. If you use this option, you must have the pam_krb5 package installed.

--krb5realm=

The Kerberos 5 realm to which your workstation belongs.

--krb5kdc=

The KDC (or KDCs) that serves requests for the realm. If you have multiple KDCs in your realm, separate their names with commas (,).

--krb5adminserver=

The KDC in your realm that is also running kadmind. This server handles password changing and other administrative requests. This server must be run on the master KDC if you have more than one KDC.

--enablehesiod

Enable Hesiod support for looking up user home directories, UIDs, and shells. More information on setting up and using Hesiod on your network is in /usr/share/doc/glibc-2.x.x/README.hesiod, which is included in the glibc package. Hesiod is an extension of DNS that uses DNS records to store information about users, groups, and various other items.

--hesiodlhs

The Hesiod LHS (“left-hand side”) option, set in /etc/hesiod.conf. This option is used by the Hesiod library to determine the name to search DNS for when looking up information, similar to LDAP’s use of a base DN.

--hesiodrhs

The Hesiod RHS (“right-hand side”) option, set in /etc/hesiod.conf. This option is used by the Hesiod library to determine the name to search DNS for when looking up information, similar to LDAP’s use of a base DN.

Tip

To look up user information for “jim,” the Hesiod library looks up jim.passwd <LHS> <RHS>, which should resolve to a TXT record that looks like what his passwd entry would look like (jim:*:501:501:Jungle Jim:/home/jim:/bin/bash). For groups, the situation is identical, except jim.group <LHS> <RHS> would be used. Looking up users and groups by number is handled by making 501.uid a CNAME for jim.passwd, and 501.gid a CNAME for jim.group. that the <LHS> and <RHS> do not have periods [.] in front of them when the library determines the name for which to search, so the <LHS> and <RHS> usually begin with periods.

--enablesmbauth

Enables authentication of users against an SMB server (typically a Samba or Windows server). SMB authentication support does not know about home directories, UIDs, or shells. So if you enable it you will need to make users’ accounts known to the workstation by enabling LDAP, NIS, or Hesiod or by using the /usr/sbin/useradd command to make their accounts known to the workstation. To use this option, you must have the pam_smb package installed.

--smbservers=

The name of the server(s) to use for SMB authentication. To specify more than one server, separate the names with commas (,).

--smbworkgroup=

The name of the workgroup for the SMB servers.

--enablecache

Enables the nscd service. The nscd service caches information about users, groups, and various other types of information. Caching is especially helpful if you choose to distribute information about users and groups over your network using NIS, LDAP, or Hesiod.

bootloader (required)

Specifies how the boot loader should be installed and whether the boot loader should be LILO or GRUB. This option is required for both installations and upgrades. For upgrades, if --useLilo is not specified and LILO is the current bootloader, the bootloader will be changed to GRUB. To preserve LILO on upgrades, use the --upgrade option.

--append=

Specifies kernel parameters.

--location=

Specifies where the boot record is written. Valid values are the following: mbr (the default), partition (installs the boot loader on the first sector of the partition containing the kernel), or none (does not install the boot loader).

--password=

If you are using GRUB, this option sets the GRUB boot loader password to the one specified here. This should be used to restrict access to the GRUB shell, where arbitrary kernel options can be passed.

--md5pass=

If using GRUB, similar to --password=, except the password should already be encrypted.

--useLilo

Use LILO instead of GRUB as the boot loader.

--linear

If using LILO, use the linear LILO option; this is only for backwards compatibility (and linear is now used by default).

--nolinear

If using LILO, use the nolinear LILO option; linear is the default.

--lba32

If using LILO, force use of lba32 mode instead of autodetecting.

--upgrade

Upgrade the existing boot loader configuration, preserving the old entries. This option is available only for upgrades.

clearpart (optional)

Removes partitions from the system, prior to creation of new partitions. By default, no partitions are removed.

Note

If the clearpart command is used, then the --onpart command cannot be used on a logical partition.

--linux

Erases all Linux partitions.

--all

Erases all partitions from the system.

--drives

Specifies which drives to clear partitions from.

--initlabel

Initializes the disk label to the default for your architecture (msdos for x86 and gpt for Itanium). It is useful so that the installation program does not ask if it should initialize the disk label if installing to a brand new hard drive.

device (optional)

On most PCI systems, the installation program will autoprobe for Ethernet and SCSI cards properly. On older systems and some PCI systems, however, kickstart needs a hint to find the proper devices. The device command, which tells the installation program to install extra modules, is in this format:

device   <type>    <moduleName>   --opts=<options>

<type>

Replace with either scsi or eth.

<moduleName>

Replace with the name of the kernel module that should be installed.

--opts=

Options to pass to the kernel module. Note that multiple options may be passed if they are put in quotes. For example:

--opts="aic152x=0x340 io=11"

deviceprobe (optional)

Forces a probe of the PCI bus and loads modules for all the devices found if a module is available.

driverdisk (optional)

Driver disks can be used during kickstart installations. You will need to copy the driver disk’s contents to the root directory of a partition on the system’s hard drive. Then you will need to use the driverdisk command to tell the installation program where to look for the driver disk.

driverdisk  <partition> [--type= <fstype> ]

<partition>

Partition containing the driver disk.

--type=

File system type (for example, vfat, ext2, or ext3).

firewall (optional)

This option corresponds to the Firewall Configuration screen in the installation program:

firewall  <securitylevel>  [--trust=]  <incoming>  [--port=]

<securitylevel>

Replace with one of the following levels of security:

  • high

  • medium

  • disabled

--trust=

Listing a device here, such as eth0, allows all traffic coming from that device to go through the firewall. To list more than one device, use --trust eth0 --trust eth1. Do not use a comma-separated format such as --trust eth0, eth1.

<incoming>

If desired, replace with one or more of the following to allow the specified services through the firewall.

  • dhcp

  • ssh

  • telnet

  • smtp

  • http

  • ftp

--port=

You can specify that ports be allowed through the firewall using the port:protocol format. For example, if you want to allow IMAP access through your firewall, you can specify imap:tcp. You can also specify numeric ports explicitly; for example, to allow UDP packets on port 1234 through, specify 1234:udp. To specify multiple ports, separate them by commas.

install (optional)

Tells the system to install a fresh system rather than upgrade an existing system. This is the default mode. For installation, you must specify the type of installation from one of cdrom, harddrive, nfs, or url (for ftp or http installations).

cdrom

Install from the first CD-ROM drive on the system.

harddrive

Install from a Red Hat installation tree on a local drive, which must be either vfat or ext2.

--partition=

Partition to install from (such as sdb2).

--dir=

Directory containing the Red Hat directory of the installation tree. For example:

harddrive --partition=hdb2 --dir=/tmp/install-tree

nfs

Install from the NFS server specified.

--server=

Server from which to install (hostname or IP).

--dir=

Directory containing the Red Hat directory of the installation tree. For example:

nfs --server=nfsserver.example.com --dir=/tmp/install-tree

url

Install from an installation tree on a remote server via FTP or HTTP. For example:

url --url http:// <server> / <dir>

or

url --url ftp:// <username> : <password> @ <server> / <dir>

interactive (optional)

Uses the information provided in the kickstart file during the installation but allows for inspection and modification of the values given. You will be presented with each screen of the installation program with the values from the kickstart file. Either accept the values by clicking Next or change the values and click Next to continue. See also autostep.

keyboard (required)

Sets system keyboard type. Here is the list of available keyboards on i386, Itanium, and Alpha machines:

  • be-latin1

  • be-latin2

  • bg

  • br-abnt2

  • cf

  • cz-lat2

  • cz-us-qwertz

  • de

  • de-latin1

  • de-latin1-nodeadkeys

  • dk

  • dk-latin1

  • dvorak

  • es

  • et

  • fi

  • fr

  • fr_CH

  • fr_CH-latin1

  • fr-latin0

  • fr-latin1

  • fr-pc

  • gr

  • hu

  • hu101

  • i-latin1

  • is-latin1

  • it

  • it2

  • it-ibm

  • jp106

  • no

  • no-latin1

  • pl

  • pt-latin1

  • ro

  • ru

  • ru_win

  • ru1

  • ru2

  • ru-cp1251

  • ru-ms

  • se-latin1

  • sg

  • sg-latin1

  • sk-qwerty

  • slovene

  • speakup

  • speakup-lt

  • trq

  • ua

  • uk

  • us

lang (required)

Sets the language to use during installation. For example, to set the language to English, the kickstart file should contain the following line:

lang en_US

Valid language codes are the following (please note that these are subject to change at any time):

  • cs_CZ

  • da_DK

  • en_US

  • fr_FR

  • de_DE

  • is_IS

  • it_IT

  • ja_JP.eucJP

  • ko_KR.eucKR

  • no_NO

  • pt_PT

  • ru_RU.koi8r

  • sl_SI

  • es_ES

  • sv_SE

  • uk_UA

  • zh_CN.GB18030

  • zh_TW.Big5

langsupport (required)

Sets the language(s) to install on the system. The same language codes used with lang can be used with langsupport. If you want to install just one language, specify it. For example, to install and use the French language, fr_FR:

langsupport fr_FR

--default=

If you want to install language support for more than one language, you must specify a default. For example, to install English and French and use English as the default language:

langsupport --default=en_US fr_FR

If you use --default with only one language, all languages will be installed with the specified language set to the default.

lilo (replaced by bootloader)

Specifies how the boot loader should be installed on the system. By default, LILO installs on the MBR of the first disk, and installs a dual-boot system if a DOS partition is found (the DOS/Windows system will boot if the user types dos at the LILO: prompt).

Caution

This option has been replaced by bootloader and is available only for backwards compatibility. Refer to bootloader.

--append <params>

Specifies kernel parameters.

--linear

Use the linear LILO option; this is only for backwards compatibility (and linear is now used by default).

--nolinear

Use the nolinear LILO option; linear is now used by default.

--location=

Specifies where the LILO boot record is written. Valid values are the following: mbr (the default) or partition (installs the boot loader on the first sector of the partition containing the kernel). If no location is specified, LILO is not installed.

--lba32

Forces the use of lba32 mode instead of autodetecting.

lilocheck (optional)

If lilocheck is present, the installation program checks for LILO on the MBR of the first hard drive, and reboots the system if it is found — in this case, no installation is performed. This can prevent kickstart from reinstalling an already installed system.

logvol (optional)

Create a logical volume for Logical Volume Management (LVM) with the syntax:

logvol mountpoint --vgname=name --size=size --name=name

Create the partition first, create the logical volume group, and then create the logical volume. For example:

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

This option is new to Red Hat Linux 8.0.

mouse (required)

Configures the mouse for the system, both in GUI and text modes. Options are:

--device=

Device the mouse is on (such as --device=ttyS0).

--emulthree

If present, simultaneous clicks on the left and right mouse buttons will be recognized as the middle mouse button by the X Window System. This option should be used if you have a two-button mouse.

After options, the mouse type may be specified as one of the following:

  • alpsps/2

  • ascii

  • asciips/2

  • atibm

  • generic

  • generic3

  • generic3ps/2

  • generic3usb

  • genericps/2

  • genericusb

  • geniusnm

  • geniusnmps/2

  • geniusprops/2

  • geniusscrollps/2

  • geniusscrollps/2+

  • logibm

  • logimman

  • logimman+

  • logimman+ps/2

  • logimmanps/2

  • logimmusb

  • logitech

  • logitechcc

  • microsoft

  • mmhittab

  • mmseries

  • mousesystems

  • msbm

  • msintelli

  • msintellips/2

  • msintelliusb

  • msnew

  • none

  • sun

  • thinking

  • thinkingps/2

If the mouse command is given without any arguments, or it is omitted, the installation program will attempt to autodetect the mouse. This procedure works for most modern mice.

network (optional)

Configures network information for the system. If the kickstart installation does not require networking (in other words, it is not installed over NFS, HTTP, or FTP), networking is not configured for the system. If the installation does require networking and network information is not provided in the kickstart file, the Red Hat Linux installation program assumes that the installation should be done over eth0 via a dynamic IP address (BOOTP/DHCP), and configures the final, installed system to determine its IP address dynamically. The network option configures networking information for kickstart installations via a network as well as for the installed system.

--bootproto=

One of dhcp, bootp, or static. It defaults to dhcp. bootp and dhcp are treated the same. 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. To direct a system to use DHCP:

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 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 and after the installation. The entry for static networking is more complex, as you must include all network configuration information on one line. You must specify the IP address, netmask, gateway, and nameserver. For example (the \ indicates that it is all one line):

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

If you use the static method, be aware of the following two restrictions:

  • All static networking configuration information must be specified on one line; you cannot wrap lines using a backslash, for example.

  • You can specify only one nameserver here. However, you can use the kickstart file’s %post section to add more nameservers, if needed.

--device=

Used to select a specific Ethernet device for installation. Note that using --device= will not be effective unless the kickstart file is a local file (such as ks=floppy), since the installation program will configure the network to find the kickstart file. For example:

network --bootproto=dhcp --device=eth0

--ip=

IP address for the machine to be installed.

--gateway=

Default gateway as an IP address.

--nameserver=

Primary nameserver, as an IP address.

--nodns

Do not configure any DNS server.

--netmask=

Netmask for the installed system.

--hostname=

Hostname for the installed system.

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

Creates a partition on the system. If more than one Red Hat Linux installation exists on the system on different partitions, the installation program prompts the user and asks which installation to upgrade.

Caution

All partitions created will be formatted as part of the installation process unless --noformat and --onpart are used.

<mntpoint>

mntpoint is where the partition will be mounted and must be of one of the following forms:

/path

For example, /, /usr, /home.

swap

The partition will be used as swap space. To determine the size of the swap partition automatically, use the --recommended option:

swap --recommended

The minimum size of the automatically generated swap partition will be no smaller than the amount of RAM in the system and no bigger than twice the amount of RAM in the system.

raid <id>

The partition will be used for software RAID (refer to raid).

pv <id>

The partition will be used for LVM (refer to logvol).

--size=

The minimum partition size in megabytes. Specify an integer value here, such as 500. Do not append MB to the number.

--grow

Tells the partition to grow to fill available space (if any), or up to the maximum size setting.

--maxsize=

The maximum partition size in megabytes when the partition is set to grow. Specify an integer value here, and do not append MB to it.

--noformat

Tells the installation program not to format the partition, for use with the --onpart command.

--onpart= or --usepart=

Put the partition on the already existing device. For example,

partition /home --onpart hda1

will put /home on /dev/hda1, which must already exist.

--ondisk= or --ondrive=

Forces the partition to be created on a particular disk. For example,

--ondisk=sdb

will put the partition on the second SCSI disk on the system.

--asprimary

Forces automatic allocation of the partition as a primary partition or the partitioning will fail.

--bytes-per-inode=

Number specified represents the number of bytes per inode on the file system when it is created. It must be given in decimal format. This option is useful for applications where you want to increase the number of inodes on the file system.

--type= (replaced by fstype)

This option is no longer available. Use fstype.

--fstype=

Sets the file system type for the partition. Valid values are ext2, ext3, swap, and vfat.

--start=

Specifies the starting cylinder for the partition. It requires that a drive be specified with --ondisk= or ondrive=. It also requires that the ending cylinder be specified with --end= or the partition size be specified with --size=.

--end=

Specifies the ending cylinder for the partition. It requires that the starting cylinder be specified with --start=.

--badblocks

Specifies that the partition should be checked for bad sectors.

Note

If partitioning fails for any reason, diagnostic messages will appear on virtual console 3.

raid (optional)

Assembles a software RAID device. This command is of the form:

raid  <mntpoint> --level= <level> --device= <mddevice>   <partitions*>

<mntpoint>

Location where the RAID file system is mounted. If it is /, the RAID level must be 1 unless a boot partition (/boot) is present. If a boot partition is present, the /boot partition must be level 1 and the root (/) partition can be any of the available types.

partitions*

Lists the RAID identifiers to add to the RAID array. (The * denotes that multiple partitions can be listed.)

--level=

RAID level to use (0, 1, or 5).

--device=

Name of the RAID device to use (such as md0 or md1). RAID devices range from md0 to md7, and each may be used only once.

--spares=

Specifies the number of spare drives allocated for the RAID array. Spare drives are used to rebuild the array in case of drive failure.

--fstype=

Sets the file system type for the RAID array. Valid values are ext2, ext3, swap, and vfat.

--noformat

Do not format the RAID array.

Sample Configuration

The following example shows how to create a RAID level 1 partition for /, and a RAID level 5 partition for /usr, assuming there are three SCSI disks on the system. It also creates three swap partitions, one on each drive.

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)

Reboot after the installation is complete (no arguments). Normally, kickstart displays a message and waits for the user to press a key before rebooting.

rootpw (required)

Sets the system’s root password to the password argument.

rootpw [--iscrypted] <password>

--iscrypted

If this is present, the password argument is assumed to already be encrypted.

skipx (optional)

If present, X is not configured on the installed system.

text (optional)

Perform the kickstart installation in text mode. Kickstart installations are performed in graphical mode by default.

timezone (required)

Sets the system time zone to timezone, which may be any of the time zones listed by timeconfig.

timezone [--utc]  <timezone>

--utc

If present, the system assumes the hardware clock is set to UTC (Greenwich Mean) time.

upgrade (optional)

Tells the system to upgrade an existing system rather than install a fresh system. You must specify one of cdrom, harddrive, nfs, or url (for ftp and http) as the location of the installation tree. Refer to install for details.

xconfig (optional)

Configures the X Window System. If this option is not given, the user will need to configure X manually during the installation, if X was installed; this option should not be used if X is not installed on the final system.

--noprobe

Do not probe the monitor.

--card=

Use specified card; this card name should be from the list of cards in /usr/share/hwdata/Cards from the hwdata package. If this argument is not provided, the installation program will probe the PCI bus for the card. Since AGP is part of the PCI bus, AGP cards will be detected if supported. The probe order is determined by the PCI scan order of the motherboard.

--videoram=

Specify the amount of video RAM the video card has.

--monitor=

Use specified monitor; monitor name should be from the list of monitors in /usr/share/hwdata/MonitorsDB from the hwdata package. This is ignored if --hsync or --vsync is provided. If no monitor information is provided, the installation program tries to probe for it automatically.

--hsync=

Specifies the horizontal sync frequency of the monitor.

--vsync=

Specifies the vertical sync frequency of the monitor.

--defaultdesktop=

Specify either GNOME or KDE to set the default desktop (assumes that GNOME Desktop Environment and/or KDE Desktop Environment has been installed through %packages).

--startxonboot

Use a graphical login on the installed system.

--resolution=

Specify the default resolution for the X Window System on the installed system. Valid values are 640 480, 800 600, 1024 768, 1152 864, 1280 1024, 1400 1050, 1600 1200. Be sure to specify a resolution that is compatible with the video card and monitor.

--depth=

Specify the default color depth for the X Window System on the installed system. Valid values are 8, 16, 24, and 32. Be sure to specify a color depth that is compatible with the video card and monitor.

volgroup (optional)

Use to create a Logical Volume Management (LVM) group with the syntax:

volgroup name partition

Create the partition first, create the logical volume group, and then create the logical volume. For example:

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

zerombr (optional)

If zerombr is specified, and yes is its sole argument, any invalid partition tables found on disks are initialized. This will destroy all of the contents of disks with invalid partition tables. This command should be in the following format:

zerombr yes

No other format is effective.

%include

Use the %include /path/to/file command to include the contents of another file in the kickstart file as though the contents were at the location of the %include command in the kickstart file.

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).

--resolvedeps

Install the listed packages and automatically resolve package dependencies.

--ignoredeps

Ignore the unresolved dependencies and install the listed packages without the dependencies.

Packages can be specified by group or by individual package name. The installation program defines several groups that contain related packages. See the RedHat/base/comps.xml file on any Red Hat Linux 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.

NEW FEATURE

This option is new to Red Hat Linux 8.0.

In most cases, it is necessary to list only 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 those groups in the %packages section.

Here is an example %packages selection:

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

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 file. Specify individual packages with no additional characters (the galeon line in the example above is an individual package).

To specify an “everything” installation (to install all packages), add this line to the %packages section:

@ Everything

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

@ Games and Entertainment -kdegames

Pre-installation Script

You can add commands to run on the system immediately after the ks.cfg file 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.

Note

The pre-install script is not run in the change root environment.

--interpreter /usr/bin/python

Allows you to specify a different scripting language, such as Python. Replace /usr/bin/python with the scripting language of your choice.

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 had" \           /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 "#partitioning scheme generated in %pre for 1 \           drive" /tmp/part-include      echo "clearpart --all"     /tmp/part-include      echo "part /boot --fstype ext3 --size 75"  /tmp/part-include      echo "part swap --recommended"     /tmp/part-include      echo "part / --fstype ext3 --size 2048"     /tmp/part-include      echo "part /home --fstype ext3 --size 2048 --grow"  /tmp/part- \           include fi

This script determines the number of hard drives in the system and writes a text file with a different partitioning scheme depending on whether the machine has one or two drives. Instead of having a set of partitioning commands in the kickstart file, include the line

%include /tmp/part-include

The partitioning commands selected in the script will be used.

Post-installation Script

You have the option of adding commands to run on the system once the installation is complete. This section must be at the end of the kickstart file and must start with the %post command. This section is useful for functions such as installing additional software and configuring an additional nameserver.

Note

If you configured the network with static IP information, including a nameserver, you can access the network and resolve IP addresses in the %post section. If you configured the network for DHCP, the /etc/resolv.conf file will not have been completed when the installation executes the %post section. You can access the network, but you cannot resolve IP addresses. Thus, if you are using DHCP, you must specify IP addresses in the %post section.

Note

The post-install script is run in a chroot environment; therefore, performing tasks such as copying scripts or RPMs from the installation media will not work.

--nochroot

Allows you to specify commands that you would like to run outside of the chroot environment. The following example copies the file /etc/resolv.conf to the file system that was just installed:

%post –nochroot cp /etc/resolv.conf /mnt/sysimage/etc/resolv.conf

--interpreter /usr/bin/python

Allows you to specify a different scripting language, such as Python. Replace /usr/bin/python with the scripting language of your choice.

Post-installation Script Examples

Turn services on and off:

/sbin/chkconfig --level 345 telnet off /sbin/chkconfig --level 345 finger off /sbin/chkconfig --level 345 lpd off /sbin/chkconfig --level 345 httpd on

Run a script named runme from an NFS share:

mkdir /mnt/temp mount 10.10.0.2:/usr/new-machines /mnt/temp open -s -w -- /mnt/temp/runme umount /mnt/temp

Add a user to the system:

/usr/sbin/useradd bob /usr/bin/chfn -f "Bob Smith" bob /usr/sbin/usermod -p 'kjdf$04930FTH/ ' bob




Official Red Hat Linux Administrator's Guide
Official Red Hat Linux Administrators Guide
ISBN: 0764516957
EAN: 2147483647
Year: 2002
Pages: 278
Authors: Red Hat Inc

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net