#bootloader for auto install install #cdrom lang en_US.UTF-8 keyboard us network --device eth0 --bootproto dhcp --hostname pbx.local rootpw --iscrypted $1$D9D4yFr4$6S20j1cmSMBtFeELyvmYM. firewall --enabled --port=22:tcp --port=22:tcp authconfig --enableshadow --enablemd5 selinux --disabled timezone --utc Europe/London #bootloader --location=mbr zerombr clearpart --all --initlabel part /boot --fstype ext3 --size=100 part / --fstype ext3 --size=1024 --grow part swap --size=256 --grow --maxsize=768 firstboot --disable skipx reboot # Insert the drive information obtained by the pre script %include /tmp/drives-info %packages @admin-tools @base @base-x @core @development-libs @development-tools @dns-server @ftp-server @mail-server @mysql @network-server @server-cfg @smb-server @sound-and-video @system-tools @web-server @x-software-development kernel-devel php-mysql MySQL-shared-compat php php-gd php-mbstring php-pear php-mysql php-pear-db perl perl-libwww-perl perl-DateManip perl-DBD-mysql perl-DBI perl-Net-DNS perl-suidperl perl-XML-Parser audiofile-devel dhcp gd lm_sensors libusb-devel mc mysql-devel gcc-c++ flite flite-devel automake vim-enhanced piafdl piafxtras xinetd tftp-server joe gtk2 gtk2-devel arts arts-devel esound-devel jack-audio-connection-kit lcms libart_lgpl-devel libogg-devel libvorbis-devel nas pulseaudio-libs SDL alsa-lib-devel libmng libtool-ltdl libtool-ltdl-devel qt dialog coreutils %post /usr/sbin/ntpdate -su pool.ntp.org mkdir -p /etc/pbx date --iso-8601=minutes > /etc/pbx/install-date echo "ISO=1.7.5.6.2" > /etc/pbx/ISO-Version echo "method=pbx=1.7.5.6.2 ksauto" > /etc/pbx/install-method echo "/usr/local/sbin/piafdl" >> /etc/rc.d/rc3.d/S99local cp -f /usr/src/piafxtras/preinstallmenu/piafxtras-menu /usr/local/sbin/piafxtras-menu chmod +x /usr/local/sbin/piafxtras-menu cat /usr/src/piafxtras/preinstallmenu/motd.tmp >/etc/motd eject ########################################################### %pre #!/bin/bash # This script will process and find the drive devices #It will then write the drive dependent lines to /tmp/drive-info file # Anaconda will insert/include /tmp/drive-info and continue with rest of ks.cfg After this script ends # At install time Anaconda copies ks*.cfg to /tmp/ks*.cfg # Initialize Variables # Block devices directory hdDEVdir="/sys/block/" lastSDdrive="" lastWTdrive="" dflash="" tmp="" # Delimited directory listing of sd* (sata, scsi, usb) block devices only; get last; get basename only lastSDdrive=$(basename $(ls -xd /sys/block/sd* | awk '{print $NF}')) # dmesg; find last drive set by kernel to write through cache; get character 4 - 6 on line lastWTdrive=$(dmesg | grep "cache: write through" | tail -1 | cut -c4-6) # Check if device sda type found and if exists as block device; fall through to each method if [ -e "$hdDEVdir$lastSDdrive" ]; then dflash=$lastSDdrive elif [ -e "$hdDEVdir$lastWTdrive" ]; then dflash=$lastWTdrive elif [ -e $hdDEVdir"hda" ]; then # prior method failed, since ide exist; assume usb drive = sda dflash="sda" else # Prior methods failed, no iede found; assume usb drive = sdb dflash="sdb" fi # Now that we know drives. Create parameters using Flash drive device name #Append "1" to device name for flash drive partition 1. # Tell bootloader which drive is first so it does not install boot loader to usb drive if [ -e $hdDEVdir"hda" ]; then # If IDE drive present, assume it is 1st drive echo "bootloader --location=mbr --driveorder=hda" >/tmp/drives-info elif [ -e $hdDEVdir"sda" ]; then # No ide drives so assume sata or scsi is 1st drive echo "bootloader --location=mbr --driveorder=sda" >/tmp/drives-info else # fall through to default echo "bootloader --location=mbr" >/tmp/drives-info fi # Tell bootloader to ignore usb drive from partitioning echo "ignoredisk --drives=$dflash" >>/tmp/drives-info # Let Centos and anaconda know the drive partition and folder where the install files are located. echo "harddrive --dir=CentOS --partition=$dflash"1"" >>/tmp/drives-info # Make directory /tmp/isomedia. # Anaconda creates and mounts iso there but error text on screen since directory not yet created # Flash partiition mounted at /tmp/isodir mkdir /tmp/isomedia # Tell Anaconda to peek in piaf iso for any missing rpm echo "repo --name=piaf --baseurl=file:///tmp/isomedia" >>/tmp/drives-info ############################################################