#platform=x86, AMD64, or Intel EM64T key --skip # System authorization information auth --useshadow --enablemd5 # System bootloader configuration bootloader --location=mbr # Clear the Master Boot Record zerombr # Partition clearing information clearpart --linux --initlabel --drives=sda # Use text mode install text # Firewall configuration firewall --enabled --ssh --trust=eth0 # Run the Setup Agent on first boot firstboot --disable # System keyboard keyboard us # System language lang en_US # Installation logging level logging --level=info # Use network installation #cdrom url --url=http://rtihardware.homelinux.com/rhel6.1_64 # Network information network --bootproto=dhcp --device=eth0 --onboot=on # Reboot after installation #reboot #Root password rootpw --iscrypted $1$b2bDwXkz$ZpKi4Jx7tox779nrUdt8h1 # SELinux configuration selinux --permissive # Do not configure the X Window System skipx # System timezone timezone America/Chicago # Install OS instead of upgrade install # Disk partitioning information part / --asprimary --fstype="ext4" --ondisk=sda --size=30000 part /teleflora --asprimary --fstype="ext4" --grow --ondisk=sda --size=1 %include /tmp/swapsize %pre DEVICE="" find_passport () { passport_device="" dev_names=(sda sdb sdc sdd sde) for thisdev in ${dev_names[@]} do # WD (Western Digital) is the vendor found=0 vendor_file="/sys/block/$thisdev/device/vendor" if [ -f $vendor_file ] then exec < $vendor_file while read line do if [[ $line =~ "WD" ]] then found=1 break fi done fi if [ $found -eq 0 ] then continue fi # ... AND Model is correct. # Note it is important to look at the model. Some shops # could have internal Western digital HDDs. If we were # to only look for "WD" drive, and not look for this particular # model, then, we could inadvertently use the "real" device # as the "backup" device, which would be catastrophic. model_file="/sys/block/$thisdev/device/model" if [ -f $model_file ] then exec < $model_file while read line do if [[ $line =~ "My Passport" ]] then found=1 break fi done fi if [ $found -eq 0 ] then continue fi # found a match passport_device="/dev/$thisdev" break done DEVICE=$passport_device } if [ -d "/sys/block" ] then find_passport fi if [ $DEVICE = "/dev/sda" -o \ $DEVICE = "/dev/sdb" -o \ $DEVICE = "/dev/sdc" -o \ $DEVICE = "/dev/sdd" -o \ $DEVICE = "/dev/sde" ] then # use separate virtual console for output VCON=3 exec < /dev/tty$VCON > /dev/tty$VCON 2>/dev/tty$VCON chvt $VCON echo echo "**********************************************************" echo 'Starting Teleflora Kickstart $Revision: 1.18 $' echo "**********************************************************" echo echo echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "!!!!" echo "!!!! ERROR! Passport Drive is plugged in as device $DEVICE." echo "!!!! Since the assumption is that the passport drive contains" echo "!!!! backup data and that data could be destroyed by the" echo "!!!! installation, the installation will not proceed." echo "!!!!" echo "!!!! Please unplug the Western Digital Passport device and" echo "!!!! then re-try this kickstart." echo "!!!!" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo echo echo "Sleeping for 10 seconds... and then rebooting." echo sleep 10 reboot fi # Section to determine how big to make the swap device based on the amount of ram. RedHat recommends 4gig of swap up to 3gig of memory and (amount of ram) + 2 gig for anything 4gig of ram or over. memory=`cat /proc/meminfo | grep MemTotal | cut -d':' -f2 | cut -d'k' -f1` memory="${memory#"${memory%%[![:space:]]*}"}" # remove leading spaces memory="${memory%"${memory##*[![:space:]]}"}" # remove trailing spaces memoryG=$((memory/1024/1024)) #memory in gig memoryG2=$((memoryG+2)) #memory in gig + 2gig remainder=`expr $memoryG2 % 2` ram=$((memoryG+remainder)) #ram in gig if [ "$ram" -lt 4 ] ; then swap="4096" else swap=$((ram*1024+2048)) fi echo "part swap --ondisk=sda --asprimary --size=$swap">/tmp/swapsize %post cat << xxxEOFxxx > /tmp/ksrti.sh #!/bin/bash LOG="/tmp/ksrti.sh.log" /tmp/ksrti_install.sh \$1 \$2 \$3 2>&1 | tee -a \$LOG xxxEOFxxx cat << xxxEOFxxx > /tmp/ksrti_install.sh #!/bin/bash # Script to run, just after a kickstart, which will start things rolling. CDROM="/dev/sr0" if [ \$# -eq 0 ]; then echo "Below is the usage info. Please note only the hostname is required." echo "Usage ksrti.sh {hostname} {ipaddr} {dnsaddr} {gateway} {netmask}" exit 1 fi if [ "\$2" == "" ]; then new_ip="192.168.1.21" else new_ip="\$2" fi if [ "\$3" == "" ]; then new_dns="192.168.1.1" else new_dns="\$3" fi if [ "\$4" == "" ]; then new_gateway="192.168.1.1" else new_gateway="\$4" fi if [ "\$5" == "" ]; then new_netmask="255.255.255.0" else new_netmask="\$5" fi #mount \$CDROM /mnt #if [ \$? -eq 0 ]; then # umount \$CDROM # echo "CDROM mounting ok.....continuing" #else # echo "CDROM could not be mounted.....exiting" # exit 1 #fi echo "\`date\` -- Beginning RTI Install \${1}.teleflora.com" >/tmp/verify.txt wget -O - http://rtihardware.homelinux.com/ostools/install-ostools-1.13.pl | perl - --update /teleflora/ostools/bin/updateos.pl --ipaddr="\$new_ip" --gateway="\$new_gateway" --netmask="\$new_netmask" --hostname=\$1 service network restart /teleflora/ostools/bin/updateos.pl --nameserver="\$new_dns" ping -c 1 google.com if [ \$? -eq 0 ]; then echo "Internet connection working.....continuing" else echo "Internet connection down.....exiting" exit 1 fi /teleflora/ostools/bin/harden_linux.pl --iptables #mount \$CDROM /mnt #cp /mnt/14_new.tar.gz /tmp #umount /mnt cd /tmp wget http://rtihardware.homelinux.com/rhel5.6_64/14_new.tar.gz gunzip /tmp/14_new.tar.gz tar xvf /tmp/14_new.tar gunzip /tmp/RTI-14.3.2-Linux.iso.gz mount -o loop /tmp/RTI-14.3.2-Linux.iso /mnt /teleflora/ostools/bin/updateos.pl --baremetal /teleflora/ostools/bin/updateos.pl --ospatches /teleflora/ostools/bin/updateos.pl --rti14 cd /mnt service blm start sleep 3 ps -ef | grep basis echo ; echo ; echo echo "Make sure that you see the -T above and Press enter to continue" read X ./install_rti-14.3.2.pl --nobbxt --nocryptoback /usr2/bbx cd /tmp umount /mnt mkdir /home/tfsupport/.ssh chmod 700 /home/tfsupport/.ssh chown tfsupport:rti /home/tfsupport/.ssh wget http://rtihardware.homelinux.com/t1800/tfsupport-authorized_keys wget http://rtihardware.homelinux.com/t1800/twofactor-20090723.tar tar xvf /tmp/twofactor-20090723.tar chmod +x /tmp/*.pl cp /tmp/tfsupport-authorized_keys /home/tfsupport/.ssh/authorized_keys chmod 700 /home/tfsupport/.ssh/authorized_keys chown tfsupport:root /home/tfsupport/.ssh/authorized_keys /tmp/install_adminmenus.pl --run gunzip /tmp/delldset_v2.0.0.119_A00.bin.gz /tmp/dset.sh rm -f /etc/cron.d/nightly-backup rm -f /tmp/rtibackup.pl wget -O - http://rtihardware.homelinux.com/ostools/install-ostools-1.13.pl | perl - --update cd /tmp echo "\`date\` -- End RTI Install \${1}.teleflora.com" >>/tmp/verify.txt /tmp/verify.sh echo "Please reboot the system......" xxxEOFxxx cat << xxxEOFxxx > /tmp/dset.sh #!/usr/bin/expect spawn /tmp/delldset_v2.0.0.119_A00.bin expect "to proceed" send "q"; expect "of this license? (y/n):" send "y"; expect "to quit:" send "4" expect "new directory path:" send "\n"; expect "Create? (y/n):" send "y"; interact xxxEOFxxx cat << xxxEOFxxx >> /tmp/verify.sh echo "--------------------">>/tmp/verify.txt echo "ifconfig results....">>/tmp/verify.txt ifconfig >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "etc/hosts ....">>/tmp/verify.txt cat /etc/hosts >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "etc/resolve.conf .....">>/tmp/verify.txt cat /etc/resolv.conf >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "netstat results....">>/tmp/verify.txt netstat -rn >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "etc/samba/smb.conf .....">>/tmp/verify.txt cat /etc/samba/smb.conf >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "usr2/basis/basis.lic .....">>/tmp/verify.txt cat /usr2/basis/basis.lic >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "/etc/hosts.allow">>/tmp/verify.txt cat /etc/hosts.allow >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt mail -s \`hostname\` mgreen@teleflora.com,kpugh@teleflora.com,sjackson@teleflora.com /tmp/memoryinfo %packages samba @ Base cups compat-libtermcap.x86_64 minicom elinks mc glibc mutt samba-client slang compat-libstdc++-33 curl sendmail glibc.i686 strace dvd+rw-tools dialog firstboot mtools cdrecord fetchmail net-snmp vlock sysstat ntp procps e2fsprogs audit expect ksh nmap %end