Kickstart ========= Due to the need for automated installation, Red Hat has created the "kickstart" installation method. With this method a system administrator can create a single file that defines the answers to the questions that one would normally be asked in a regular Red Hat install. This procedure is powerful enough that often times one kickstart configuration file can actually be used for multiple machines. The general procedure to use kickstart is to create the kickstart file and then place that file somewhere the install can find it. That is on the boot media (floppy) or on the network. The network is the most common use since kickstart is usually used on networks of machines anyway. Kickstart is only available for the CD-ROM and NFS install methods. You can not do FTP, local hard disk, or SMB installs with kickstart. For a detailed kickstart config file, see doc/sample.ks on the Red Hat CD-ROM or on the FTP site. Where to put your kickstart file -------------------------------- From Floppy To begin a kickstart install, you must include the "ks" option at the boot prompt. If you want to get your kickstart file from the floppy, the boot prompt command would be "boot: linux ks=floppy". If you want to get your kickstart file from the network, you would simply do "boot: linux ks". In the case of the floppy, the kickstart file must be named "ks.cfg" and must reside in the top level directory of the boot floppy. The Red Hat boot floppy images are in MS-DOS format, so you should be able to easily copy the file there under Linux using the mtools 'mcopy' command. The floppy method is most commonly used for CD-ROM kickstart installs. From the Network Network installs using kickstart are common because administrators can easily automate the install of large amounts of machines in a network environment quickly and painlessly. The general topology would be for the administrator to have a BOOTP/DHCP server as well as an NFS server on the local network. The BOOTP/DHCP server would be used to give the client it's networking information and the NFS server would be used to hold the installation media. These servers can be the same physical machine, but they don't need to be. To do an NFS kickstart install, you must have a BOOTP/DHCP server on your network and it must have configuration information setup in it for the machine you are attempting to install. The BOOTP/DHCP server will be used to give the client it's networking information and can also be used to specify the location of the kickstart configuration file. If a file is specified by the BOOTP/DHCP server, the client will attempt an NFS mount of the file path and will copy the specified file to the client and use it as the kickstart configuration file. The strings you need to set vary based on the BOOTP/DHCP server you use, but in the DHCP server shipped with Red Hat you want to use "filename" for the filename and "next-server" to set the NFS server name. If the filename returned by the BOOTP/DHCP server ends in a "/" then it is interpreted as a path only. That path is mounted and a file by the default filename is copied from there. That default filename is -kickstart, where is the client's IP address in dotted decimal notation (for example, a filename for a machine with IP 10.10.0.1 would be "10.10.0.1-kickstart"). If you don't specify a server name, then the install will default to the server that answered the BOOTP/DHCP request. If you don't specify a path or filename then it will default to trying to mount "/kickstart" from the BOOTP/DHCP server and then it will try to grab the file using the default filename (described above as .kickstart). The kickstart file ------------------ First, items must be specified *in order*. It is not a good idea to try to change the order of the required items. Items that aren't required can be omitted. Of the items that go in the kickstart file (specified later in this document), the only ones that matter to *upgrades* are language, installation method, device specification, keyboard setup, the "upgrade" keyword, and the LILO configuration. Specifying anything additional in an *upgrade* will be ignored (including package selection). Omitting any required step, however, will simply result in the kickstart process stopping to ask for an answer to that question as if the install were running normally. Once the answer is given, the kickstart install will continue normally (unless it hits another unanswered question). The kickstart file is a simple text file. You can create it by editing the sample.ks file found in the doc/ directory of a Red Hat CD image, or you can create it from scratch. You should be able to edit it with any text editor or word processor that can save as ASCII text. Language The first item that must appear is the language setting. You must specify a language for the install to run in and setup your system for. This must be a two letter ISO language code, such as "en" for English, "de" for German, "fr" for French, etc. The variable you must set is "lang". An example for setting this to English would be: lang en Networking The next item you need to set in the kickstart file is the networking information. You must tell the system how it is going to setup networking for itself. This item is optional and if omitted the machine will be configured for stand alone operation. You may specify networking one of three major ways, static, DHCP, or BOOTP. Static means that you are going to tell the machine all the networking information it needs and it will keep that. DHCP and BOOTP specify that you are going to have the machine use each of those protocols, respectively, at each boot to get it's networking information. To setup a machine to use DHCP to get it's networking, you would put the following in the kickstart configuration file: network --bootproto dhcp To setup a machine to use BOOTP to get it's networking, you would put the following in the kickstart configuration file: network --bootproto bootp For static networking, you have to give the machine several items. Those are the IP address, netmask, gateway IP, and nameserver IP. An example of how to do this would be: network --bootproto static --ip 10.0.2.15 --netmask 255.255.255.0 --gateway 10.0.2.254 --nameserver 10.0.2.1 Note that there are some restrictions on this. You must do this all on *one* line; you cannot wrap lines using a backslash, for example. Also, you can only specify one nameserver here. You could use the %post section (described later) to add more nameservers if you need to. Installation Method The next item you need to setup is the installation method. This is a required field. You have two choices, NFS or CD-ROM. For NFS you must also pass the server name and directory to mount as arguments. To do an NFS install, you would do something like: nfs --server hostname.of.server --dir /path/to/RH/CD/image If you are doing this via CD-ROM, you would simply give it the line "cdrom" like so: cdrom Optional Hardware The next item in the kickstart configuration is optional hardware information. For most PCI hardware you can omit this step as it will be autoprobed (IDE hard disks and common PCI cards all fit this criteria). For other items, you may need to specify it here. To specify a device, start with the "device" keyword, followed by the type of device: ethernet -- for ethernet cards. scsi -- for scsi cards. cdrom -- for non-scsi, non-ide cdrom cards (eg., sound cards with proprietary CDROM interfaces). Optional parameters that are required by a device can also be specified by using the --opts option. Enclose the paratmeters in quotes after --opts. Note that you can specify multiple types of devices. For example, if you know the machines you'll be kickstart-installing have either an Adaptec 1542 or a Buslogic card, you can enter both in the kickstart file. But be aware that the install 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" An example of a Adaptec 1542 would be: device scsi aha154x An example of a SoundBlaster CD-ROM would be: device cdrom --opts "io=0x240" Keyboard The next item you need to specify is the correct code for your keyboard type. For US keyboards, the type is "us". For the others, please see the output of the kbdconfig program (or just set it to "us" and run kbdconfig on the installed system and set it properly after the install). An example of this would be: keyboard us Partitioning The hard disk in the machine must be partitioned before an install can take place. In this phase we will describe how to specify how to partition a disk using kickstart. First, if you are installing to new machines, you will want to use the "zerombr" command to clear the current partition information because it is usually bogus. So, you would add: zerombr yes in that case. If you are installing to machines that have partition information that you want to leave -or- that you want to change (even if you want to completely change it) you would do: zerombr no The next command is completely optional but handy. If you want to remove all partitions or simply remove all Linux related partitions, you can use "clearpart". For example, to clear all "Linux native" and "Linux swap" partitions, you could do: clearpart --linux To clear *all* partitions from a disk, you would do: clearpart --all The only options clearpart supports currently are --linux and --all. The next step is to specify the partitions you want to create. These will only be created using the free space (ie if the machine had FAT or FAT32 partitions and you had done "clearpart --linux" your FAT partitions would remain untouched). You need to enter one partition per line using the following format: part --size [--grow] [--maxsize ] is the location you are going to mount that partition in your installed system (for example, you must at least have a "/" partition). is the size of the partition in megabytes. You can optionally specify that the partition be "growable" using --grow. Making a partition "growable" does *not* mean that you can later increase it's size (that isn't supported by the ext2 filesystem at this time). What it means is that when you specify partitions you are doing so using the "free space". Since that can vary and you probably want to use it all, you can tag partitions as "growable" and the install code will automatically increase the size of the partitions tagged as growable to use that space. If you have multiple partitions tagged as "growable" then the extra space is split evenly among them. You can limit the size of some partitions with the optional --maxsize argument, too. For example, let's say you know your smallest disk is 1G out of a set of machines you plan to install using the same kickstart config file. You could use a partitioning scheme like the following: zerombr no clearpart --all part / --size 250 part swap --size 50 part /usr --size 500 --grow --maxsize 800 part /tmp --size 100 --grow This will clear all partitions. It then sets up a 250M root filesystem. The next item creates a 50M swap partition. The next item will setup a 500M *minimum* /usr that could grow to a maximum of 800M. The next item will setup a 100M *minumum* /tmp. So, for 1G of total disk space, you would end up with a 250 root, 550M /usr, and 150M /tmp. If your machine had 2G of total space, you would get a 250M root, 800M /usr, and 900M /tmp. Install/Upgrade Selection The next item to specify is whether you are doing an install or an upgrade of an existing install. For a fresh install, use: install For an upgrade of an existing system, use: upgrade Note again that for upgrades, the only items that matter are installation media (CD-ROM or NFS), device specification (if necessary), keyboard setup, install/updgrade specification (of course!), and LILO configuration. Mouse You need to set the "mouse" variable to the type of mouse you have. To find out a list of usable options, run 'mouseconfig --help'. The default device is correctly set for bus mice. /dev/cua0 is the default for serial mice, but that can be overridden with the "--device" option. Follow simply with the device name, like "cua1". If three button emulation is required, specify "--emulthree". 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 Timezone You need to specify the timezone that your machine will live in. You do this with the "timezone" command. You can run /usr/sbin/timeconfig on a RH machine to see what all the valid options are. If you use GMT/UTC on your system clock, add the --utc option. An example of the US Eastern with GMT for the system clock would be: timezone --utc US/Eastern X Window Setup The next item is the X Window setup area. The installation program will normally find common PCI video hardware and will know which X server to install. The command for X configuration is "xconfig". If your card isn't probed properly, you can use --card to specify the card. You can use "Xconfigurator --help" on a running Red Hat system to get a list of supported cards to choose from. You must use one of those settings. 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 to "xconfig". Again, use "Xconfigurator --help" to find a list of server names. You also need to specify a monitor type. If you don't, the installation will assume 640x480@60hz. Use the --monitor option to specify something else. Again, "Xconfigurator --help" will list all valid monitor types. If your monitor isn't listed, you can also list the actual monitor data 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: --hsync "31.5,35.5,50-65" --vsync "50-70" An example for a machine where the video card is probed 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" Root Password You can put the root passwd in the 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 an encrypted password to be used. To specify an actual password in the kickstart file, you would do something like: rootpw mypasswd If you wanted to use an encrypted password, grab it out of /etc/passwd (or somewhere else, if necessary) and use: rootpw --iscrypted encryptedpasswdstring LILO Configuration For machines that use LILO (Intels), you can specify the LILO configuration using the "lilo" keyword. By default you can just use: lilo and have LILO installed on the MBR and automatically configured to boot your Linux install as well as a DOS or Windows install if you have one. If you want to change the default location, you can do so with the --location switch. It will take three options: mbr - put LILO on the master boot record (default) partition - put LILO on the beginning of the root partition none - don't install LILO at all (you need your own method of booting) You can also use the --append switch to add an "append=" line to the Linux section if you need to do things like set memory sizes, etc. For example, to set LILO up on the MBR on a machine with memory size 128M, you could do: lilo --append "mem=128M" --location mbr Also note that the mem option *shouldn't* be necessary as of Red Hat 5.2. Package Selection You can use the "%packages" keyword to start the beginning of the section that lists the packages you want to install (this is for *install* only because the upgrade only upgrades the packages that exist). Packages can be specified by entire components or by individual package names. See the RedHat/base/comps file on any Red Hat CD image for a list of those. The components are the lines with a number and space in front of them and each of their packages follows. The individual packages have nothing in front of them. Most folks will only need to list the components that they wish to have installed. Also, the "base" component is always selected by default, so you don't need to specify it. An example would be: %packages @ Networked Workstation @ C Development @ Web Server @ X Window System bsd-games New for 5.2 and later releases is the option to specify "Server" or "Workstation". This installs the same package set as the normal mode install for those two options. ### ED: Reference your package description tags here. An example would be: %packages @ Workstation As you can see, specify components with an "@" symbol followed by a space and then the full name as given in the "comps" file. Specify individual packages with no additional characters (just like "bsd-games" above). Post Installation Configuration You have the option of adding commands to be run on the installed system after the install is complete. This section must be last in the kickstart file and starts with "%post". You can access the network in a %post if it was previously configured, but you don't have access to nameservice. So use IP addresses only. An example of a post install script would be: %post # 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