# $Revision: 1.7 $ # Kickstart file to take an existing Teleflora FC5 server and upgrade to RHEL 5.5. # Copyright 2010 Teleflora # http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.4/html/Installation_Guide/s1-kickstart2-options.html # # The disk partitioning on an FC3 Daisy server: # # /dev/sda1 : start= 63, size= 208782, Id=83, bootable # /dev/sda2 : start= 208845, size= 40965750, Id=83 # /dev/sda3 : start= 41174595, size= 40965750, Id=83 # /dev/sda4 : start= 82140345, size= 74107845, Id= 5 # /dev/sda5 : start= 82140408, size= 40965687, Id=83 # /dev/sda6 : start=123106158, size= 10233342, Id=83 # /dev/sda7 : start=133339563, size= 6136767, Id=83 # /dev/sda8 : start=139476393, size= 4192902, Id=82 # # The file systems on those paritions are: # # sda1 - /boot 100MB # sda2 - / 20GB # sda3 - /d 20GB # sda5 - /save 20GB # sda6 - /var 5GB # sda7 - /samba 3GB # sda8 - swap 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 # Disk configuration 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 /d --onpart=sda3 --fstype=ext3 --noformat part /save --onpart=sda5 --fstype=ext3 --noformat part /var --onpart=sda6 --fstype=ext3 part /samba --onpart=sda7 --fstype=ext3 part /swap --onpart=sda8 --fstype=swap %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.7 $' 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 xxxEOFxxx cp /tmp/ksdaisy.sh /tmp/ksrti.sh chmod +x /tmp/*.sh cat << xxxEOFxxx > /tmp/ks_get_updateos.sh #!/bin/bash # Script to run, just after a kickstart, which will get only updateos.pl. set -x curl -o updateos.pl http://rtihardware.homelinux.com/ostools/updateos.pl xxxEOFxxx chmod +x /tmp/ks_get_updateos.sh /usr/bin/chage -d 0 root