Environment: CentOS 5.5 and 6.4
I have a request to analyze the hardware before installation to make sure our customers don't install our software on sub-standard server hardware. For example, examining memory, disk space, CPU, network card… So, the %pre section in my ks.cfg file seems like the perfect place to do this??? But, I can't get a command like free to work…. I would like to find out what commands are available in the %pre section and is this the right place to perform hardware analysis before the installation begins???.. If the %pre section of ks.cfg is NOT a good place to do this, then where?? Here is what I've tried so far and I get NO output:
ks.cfg:
%pre
(echo "Analyzing Hardware...") >/dev/tty1
free >/dev/tty1
free_txt=`free -o`
(echo "$free_txt") >/dev/tty1
%end
I see 'Analyzing Hardware…' on the screen during the first part of the install but nothing after that…..
Best Answer
The
%pre
section(s) of your kickstart run inside the installer environment.Here's a list of helpful commands that are available in the installer environment in RHEL6.5:
arch awk basename bash cat chattr chgrp chmod chown chroot clear clock consoletype cp cut date df dmesg du echo egrep env expr false fgrep find getopt grep head hwclock id kill killall killall5 less ln ls lsattr mkdir mknod mktemp mv pidof ps pwd readlink rm rmdir sed sh shred sleep sort split sync tac tail tee top touch true tty uname uniq wc which xargs
less more vi
md5sum sha1sum sha256sum
gzip bzip2 cpio dd tar rpm
fsck
/mkfs
/etc. forext2 ext3 ext4 xfs btrfs msdos vfat
mkswap swapon swapoff dmraid dmsetup mdadm mdmon dump restore mt lvm lvs vgs pvs ...
arp arping curl dhclient dhclient-script ftp ifconfig hostname ip ipcalc mtr nc ping rcp rdate rlogin telnet nslookup ntpdate route rsh rsync ssh ssh-keygen sshd scp sftp wget
biosdevname blkdeactivate blkid blockdev dmidecode lshal lspci lsscsi sginfo smartctl
eject dump restore hdparm smartctl losetup kpartx parted fdisk sfdisk
chvt consolehelper openvt whiptail zenity
logger rsyslogd syslogd
python
If you run a manual install, you can switch to the terminal on VT2 (CtrlAltF2) and poke around to find out everything that's available inside the installer environment.
compgen -c | sort -u
is an easy way to list every command available, and there's lots of system information to be found in/sys
and/proc
.(And yes, the kickstart is re-parsed after the
%pre
scripts run, so your%pre
can edit the kickstart and/or generate new kickstart snippets to use with%include
.)