Installation guide
38 Chapter 1. Kickstart Installations
# 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
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 envi-
ronment.
The following example copies the file /etc/resolv.conf to the filesystem that was just
installed.
%post --nochroot
cp /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
--interpreter /usr/bin/perl
Allows you to specify a different scripting language, such as Perl. Replace
/usr/bin/perl with the scripting language of your choice.
The following example uses a Perl script to replace /etc/HOSTNAME.
%post --interpreter /usr/bin/perl
# replace /etc/HOSTNAME
open(HN, ">HOSTNAME");
print HN "1.2.3.4 an.ip.address\n";
More examples of post-installation scripts can be found in Section 2.11.
1.4.32. %include — Include Contents of Another File Section
1
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.
1. This option is new to Red Hat Linux 7.3