33.10. Pre-Installation Script
You can add commands to run on the system immediately after the kickstart file has been parsed and before the installation begins. If you have configured the network in the kickstart file, the network is enabled before this section is processed. To include a pre-installation script, type it in the text area.
The version of anaconda in previous releases of Red Hat Enterprise Linux included a version of busybox that provided shell commands in the pre-installation and post-installation environments. The version of anaconda in Red Hat Enterprise Linux 6 no longer includes busybox, and uses GNU bash commands instead.
To specify a scripting language to use to execute the script, select the Use an interpreter option and enter the interpreter in the text box beside it. For example, /usr/bin/python2.6
can be specified for a Python script. This option corresponds to using %pre --interpreter /usr/bin/python2.6
in your kickstart file.
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
, 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
, xargs
, zcat
.
Do not include the %pre
command. It is added for you.
The pre-installation script is run after the source media is mounted and stage 2 of the bootloader has been loaded. For this reason it is not possible to change the source media in the pre-installation script.