# $Revision: 1.1 $ # Kickstart file for pughs RTI server install of RHEL5 using existing # partition table, preserving /usr2. # Copyright 2010 Teleflora # install cdrom text skipx key --skip keyboard us lang en_US.UTF-8 timezone America/Chicago authconfig --enableshadow --enablemd5 rootpw --iscrypted $1$w3ooVcS3$OPlxZqhLart8oXlH19Slg0 network --onboot=yes --bootproto=dhcp firewall --enabled --ssh selinux --permissive firstboot --reconfig # # Data gathered from RTI server which is supposed to be same as # the Flowers and Plants server # # $ df -H # # Filesystem 1024-blocks Used Available Capacity Mounted on # /dev/sda2 10078190 2747651 6818468 29% / # /dev/sda6 136516574 9129872 120450239 8% /usr2 # /dev/sda3 4031220 217638 3608754 6% /var # /dev/sda1 102711 22442 75050 24% /boot # tmpfs 1027004 0 1027004 0% /dev/shm # # $ sudo fdisk -l /dev/sda # # Disk /dev/sda: 158.9 GB, 158999773184 bytes # 255 heads, 63 sectors/track, 19330 cylinders # Units = cylinders of 16065 * 512 = 8225280 bytes # # Device Boot Start End Blocks Id System # /dev/sda1 * 1 13 104391 83 Linux # /dev/sda2 14 1288 10241437+ 83 Linux # /dev/sda3 1289 1798 4096575 83 Linux # /dev/sda4 1799 19330 140825790 5 Extended # /dev/sda5 1799 2053 2048256 82 Linux swap / Solaris # /dev/sda6 2054 19330 138777471 83 Linux ignoredisk --drives=sdb,sdc,sdd,hdb,hdc,hdd bootloader --location=mbr --driveorder=sda part /boot --onpart=sda1 --fstype=ext3 part / --onpart=sda2 --fstype=ext3 part /var --onpart=sda3 --fstype=ext3 part /swap --onpart=sda5 --fstype=swap part /usr2 --onpart=sda6 --fstype=ext3 --noformat %packages --resolvedeps @admin-tools @editors @system-tools @text-internet @core @base @smb-server @printing audit sysstat vlock cdrecord dvd+rw-tools curl dialog mtools firstboot e2fsprogs dialog minicom slang mc strace net-snmp # vmstat / iostat sysstat procps # Altiris compat-libstdc++-33 %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 %post cat << xxxEOFxxx > /tmp/ksdaisy.sh #!/bin/bash # Script to run, just after a kickstart, which will start things rolling. set -x wget -O - http://rtihardware.homelinux.com/ostools/install-ostools.pl | perl - --update cd /teleflora/ostools/bin /bin/ls /bin/pwd xxxEOFxxx cp /tmp/ksdaisy.sh /tmp/ksrti.sh chmod +x /tmp/*.sh /usr/bin/chage -d 0 root