Show Table of Contents
32.6. Pre-installation Script
You can add commands to run on the system immediately after the
ks.cfg has been parsed. This section must be placed towards the end of the kickstart file, after the kickstart commands described in Section 32.4, “Kickstart Options”, and must start with the %pre command and end with the %end command. If your kickstart file also includes a %post section, the order of the %pre and %post sections does not matter. See Section 32.8, “Kickstart Examples” for example configuration files.
Note
The pre-installation script section of kickstart cannot manage multiple install trees or source media. This information must be included for each created ks.cfg file, as the pre-installation script occurs during the second stage of the installation process.
You can access the network in the
%pre section; however, name service has not been configured at this point, so only IP addresses work.
Only the most commonly used commands are available in the pre-installation environment:
arping, awk, basename, bash, bunzip2, bzcat, cat, chattr, chgrp, chmod, chown, chroot, chvt, clear, cp, cpio, cut, date, dd, df, dirname, dmesg, du, e2fsck, e2label, echo, egrep, eject, env, expr, false, fdisk, fgrep, find, fsck, fsck.ext2, fsck.ext3, ftp, grep, gunzip, gzip, hdparm, head, hostname, hwclock, ifconfig, insmod, ip, ipcalc, kill, killall, less, ln, load_policy, login, losetup, ls, lsattr, lsmod, lvm, md5sum, mkdir, mke2fs, mkfs.ext2, mkfs.ext3, mknod, mkswap, mktemp, modprobe, more, mount, mt, mv, nslookup, openvt, pidof, ping, ps, pwd, readlink, rm, rmdir, rmmod, route, rpm, sed, sh, sha1sum, sleep, sort, swapoff, swapon, sync, tail, tar, tee, telnet, top, touch, true, tune2fs, umount, uniq, vconfig, vi, wc, wget, wipefs, xargs, zcat.
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.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.