Installation guide

Chapter 1. Kickstart Installations 37
@ GNOME
@ KDE
@ Server
@ Everything
1.4.30. %pre — Pre-Installation Configuration Section
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. Note that 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. Here is an
example %pre section:
%pre
# 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. It also gets around the network command’s limitation of only one name server
by adding another nameserver to /etc/resolv.conf.
Note
Note that the pre-install script is not run in the change root environment.
1.4.31. %post — Post-Installation Configuration Section
You have the option of adding commands to run on the system once the installation is com-
plete. 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 has not been completed when the installation executes the %post section.
You can access the network, but you can not resolve IP addresses. Thus, if you are using DHCP, you
must specify IP addresses in the %post section.
Here is an example %post section that creates a message of the day file containing the date
that the kickstart installation took place, and gets around the network command’s limitation
of one nameserver only by adding another nameserver to /etc/resolv.conf.
%post