Skip to content

Instantly share code, notes, and snippets.

@josecolella
Last active November 12, 2015 10:53
Show Gist options
  • Save josecolella/a59ad26a84fa818a878a to your computer and use it in GitHub Desktop.
Save josecolella/a59ad26a84fa818a878a to your computer and use it in GitHub Desktop.
amdrhel6.cfg
#########################################################################
# $Revision: 1.1 $
# $Author: build $
#########################################################################
#Kickstart for instalation Compuware AMD probe on RHEL6.x
#ATTENTION!: you MUST use "UNIX STYLE" LINE ENDS in this file
# for installation from network:
# - comment all properties from "installation from cds/dvd" kickstart part
# - uncomment and edit properties from "installation from network" kickstart part
# more details can be found here:
# http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Installation_Guide/s1-kickstart2-options.html
# only "installation" is supported
install
########### INSTALLATION FROM CDS/DVD ######################
# source of installation data - installation from local CD/DVD drive
cdrom
# default network configuration for AMD machine
network --device eth0 --bootproto dhcp --hostname amdprobe
########### INSTALLATION FROM NETWORK ######################
# source of installation data - installation from network repository
# URL to access network installation repository:
# url --url http://<server>/<dir>
# network configuration - we need access to network repository above - uncomment static or dhcp-based configuration below:
# network --device eth0 --bootproto static --ip <right-IP-address> --netmask <right-netmask> --gateway <right-gateway> --nodns --hostname amdprobe
# network --device eth0 --bootproto dhcp
########### COMMON PROPERTIES: #############################
# Uncomment "reboot" to allow reboot without confirmation when installation is complete.
# reboot
# Default localization
lang en_US
keyboard us
# Default timezone
timezone --utc America/New_York
# No X server is required.
skipx
# Run anaconda in text mode.
text
# Default root password
rootpw --iscrypted $1$At2zY0$dukYXZ5Q0HhNr5HYhy98e1
authconfig --enableshadow --enablemd5
# Do not configure any iptables rules.
firewall --disabled
bootloader --location=mbr --append="vga=0x317 rhash_entries=8192"
# Disables SELinux completely on the system.
selinux --disabled
# Comment out "zerombr", "clearpart" and "part" to allow interactive partitioning.
zerombr
clearpart --all --initlabel
part / --fstype ext4 --size=1 --grow
part swap --recommended
# Include dynamic generated kickstart file - see %pre...
%include /tmp/ks_include.cfg
%packages --nobase
#@core
#@base
-Yelp
-Xulrunner
-ql2100-firmware
-ql2200-firmware
-ql23xx-firmware
-ql2400-firmware
-ql2500-firmware
-iwl100-firmware
-iwl1000-firmware
-iwl3945-firmware
-iwl4965-firmware
-iwl5000-firmware
-iwl5150-firmware
-iwl6000-firmware
-iwl6000g2a-firmware
-iwl6050-firmware
-aic94xx-firmware
-atmel-firmware
-bfa-firmware
-ipw2100-firmware
-ipw2200-firmware
-ivtv-firmware
-libertas-usb8388-firmware
-rt61pci-firmware
-rt73usb-firmware
-xorg-x11-drv-ati-firmware
-zd1211-firmware
-gnome-doc-utils-stylesheets
-gnome-python2-canvas
-gnome-user-docs
-emacs
-emacs-common
-gnome-python2
-libgnomecanvas
-redhat-support-lib-python
-python-slip
-libselinux-python
-python-lxml
-pygtk2-libglade
-pygtk2
-libglade2
-librsvg2
-usermode-gtk
-b43-openfwwf
-b43-fwcutter
-cloog-ppl
-docbook-dtds
-giflib
-kernel-devel
-libcroco
-liberation-sans-fonts
-liberation-fonts-common
-fontpackages-filesystem
-m17n-db-datafiles
-m17n-lib
-m17n-db
-mozilla-filesystem
-mpfr
-ppl
-pycairo
-xml-common
-libXaw
-libXmu
-libXpm
-libXt
-libreport-plugin-reportuploader
-libreport-plugin-rhtsupport
-libreport-python
-libreport
-libreport-plugin-kerneloops
-libreport-plugin-logger
-libreport-plugin-mailx
-libreport-cli
-libreport-compat
-libtecla
-trousers
-dracut-kernel
-libgsf
-abrt
-abrt-libs
-libfprint
-fprintd
-vim-enhanced
-vim-common
-words
-redhat-indexhtml
-hunspell-en
-hunspell
-audit
-abrt-addon-python
-rng-tools
-alsa-utils
-libproxy
-libproxy-bin
-libproxy-python
-rarian-compat
-gnome-vfs2
-avahi-glib
-GConf2
-ORBit2
-libIDL
-sgml-common
-libgsf
-startup-notification
-xmlrpc-c-client
-xmlrpc-c
-MAKEDEV
-google-perftools-devel
vconfig
strace
rsync
rfkill
numactl
elfutils
acpid
abrt-addon-ccpp
abrt-addon-kerneloops
abrt-cli
fprintd-pam
dosfstools
pcmciautils
rpm
sudo
policycoreutils
bridge-utils
dhclient
eject
kernel
usbutils
yum-rhn-plugin
rhnsd
subscription-manager
yum-plugin-security
yum-utils
yum
sos
attr
finger
acl
system-config-firewall-tui
authconfig
cryptsetup-luks
cpuspeed
apr
apr-util
libaio
lvm2
man-pages
man-pages-overrides
mc
mdadm
microcode_ctl
mlocate
mtr
ntsysv
parted
pinfo
prelink
psacct
quota
rdate
ntpdate
readahead
rootfiles
screen
setserial
setuptool
sysstat
tcpdump
tmpwatch
traceroute
wget
lsof
glibc
system-config-network-tui
systemtap-runtime
kexec-tools
smartmontools
hal
pm-utils
biosdevname
blktrace
grub
ntp
openssh-clients
openssh-server
openssl098e
tcsh
unzip
virt-what
dbus
nss
shadow-utils
util-linux-ng
coreutils
bind-utils
desktop-file-utils
yum-utils
net-snmp-utils
usbutils
binutils
iputils
bzip2
file
initscripts
procps
cpio
which
iproute
dmraid
net-snmp
tcp_wrappers
patch
logrotate
krb5-libs
man
rsyslog
cronie
kernel-firmware
basesystem
pax
nano
efibootmgr
gcc
cpp
opencryptoki
opencryptoki-libs
selinux-policy-targeted
libotf
tomcat6
compat-expat1
stunnel
boost
compat-expat1.i686
libstdc++.i686
net-snmp-perl
java-1.7.0-openjdk
#usefull utils
#mc
#cvs
#numactl
#emacs
#vim-enhanced
#system-config-date
#modules we need to build and run AM software
libxslt
perl-XML-Parser
#apr-util
#boost
#kernel-headers
#libicu
#libstdc++
#openssl
#openssl098e
#gcc
#libgcc
#net-snmp
#net-snmp-perl
#net-snmp-utils
#opencryptoki
#ntp
#tomcat6
#screen
#stunnel
#libstdc++.i686
#compat-expat1.i686
#finger
########################################################
%pre --interpreter /bin/sh
#log to postinstall file
log(){
echo "$1" | tee -a /tmp/preinstall.log
}
#write arg to file included into kickstart
inc(){
echo "$1" | tee -a /tmp/ks_include.cfg
log "include: $1"
}
########################################################
log "---preinstall script log start:"
kernel=`uname -r`
inc "#This is dynamic generated part of kickstart file"
inc "%packages"
if echo $kernel | grep -q xen ; then
# we are jailed inside XEN virtual machine...
log "Xen kernel found - this is installation inside XEN virtual machine"
inc "kernel-xen"
inc "kernel-xen-devel"
else
#check architecture of the machine
machine=`uname -m`
log "Architecture discovered: $machine"
#check memory
for i in `/usr/sbin/dmidecode -t 17 | grep -e "Size: [0-9]\+ MB" | sed -e 's/[ :a-zA-Z\\\t]//g'`; do mem_size=$[$mem_size+$i]; done ;
log "Total RAM installed discovered: $mem_size MB"
if [ $machine != "x86_64" ] ; then
#this is not x86_64 os
inc "kernel-PAE"
inc "kernel-PAE-devel"
else
#this is 64-bit os
inc "kernel"
inc "kernel-devel"
fi
fi
log "---preinstall script log end"
########################################################
%post --nochroot --interpreter /bin/sh
#log to postinstall file
log(){
echo "$1" | tee -a /mnt/sysimage/root/postinstall.log
}
#trying to find service script for some level
find_service(){
if [ `find /mnt/sysimage/etc/rc$2.d/ -name "*$1"` ] ; then
log " ...service $1 script found in /etc/rc$2.d"
return 0;
else
log " ...service $1 script not found in /etc/rc$2.d"
return 1;
fi
}
#disable some service for some level
disable_service(){
if find_service $1 $2 ; then
#this service is present in system
path=/mnt/sysimage/etc/rc$2.d
f=`ls $path/*$1`
nf=`echo $f | sed "s/rc$2\.d\/S/rc$2\.d\/K/"`
if [ $f != $nf ] ; then
mv $f $nf
log " ...disabled"
else
log " ...inactive"
fi
fi
}
########################################################
log "---postinstall script log start:"
# copy preinstall script log results
cp /tmp/preinstall.log /mnt/sysimage/root/preinstall.log
# turning off unnecessary services:
log "trying to disable unneeded services ..."
for service in \
auditd gpm netfs rawdevices saslauthd mdmonitor \
mdmpd apmd isdn pcmcia irqbalance smartd netdump \
rhnsd sendmail cups xinetd iptables ip6tables \
bluetooth hidd xfs firstboot exim avahi-daemon kdump NetworkManager
do
log "-$service:"
for level in `seq 2 5`; do disable_service $service $level ; done
done
#disable ipv6 for sniffing interfaces in /etc/modprobe.conf
sed -i /mnt/sysimage/etc/modprobe.conf -e 's/^alias.*net-pf-10 ipv6.*$/# & /'
echo "alias net-pf-10 off" >> /mnt/sysimage/etc/modprobe.conf
log "IPv6 disabled for sniffing interfaces"
log "---postinstall script log end"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment