install text cdrom skipx mouse network --device eth0 --bootproto dhcp rootpw --iscrypted $1$iHhL195i$25OY88oyw2bxgU47MvuZf0 firewall --disabled selinux --disabled authconfig --enableshadow --enablemd5 bootloader --location=mbr zerombr yes %include /tmp/part-include %packages @ Base %post /sbin/syslogd & sleep 2 /sbin/e-smith/signal-event post-install %pre #!/bin/sh set -x hds="" raidlevel=2 memsize=`cat /proc/meminfo | grep 'MemTotal:' | sed 's/^.* \([0-9]\+\) kB$/\1/'` swapsize=$(($memsize/512)) if [ $swapsize -gt 2048 ] ; then swapsize=2048 fi # let's assume it's a SCSI system hds=`grep 'sd[a-z]$' /proc/partitions | sed 's/.* sd/ sd/'` set $hds numhd=`echo $#` if [ $numhd == "0" ] ; then # No SCSI Drives is must be IDE for file in /proc/ide/hd* do media=`cat $file/media` if [ $media == "disk" ] ; then hds="$hds `basename $file`" fi done set $hds numhd=`echo $#` fi echo "# Auto configure partitions" > /tmp/part-include if [ $numhd -gt "0" ] ; then hdlist=`echo $hds | sed 's/^ \+//;s/ \+$//;s/ \+/ /g;s/ /,/g'` echo "clearpart --all --initlabel --drives=$hdlist" >> /tmp/part-include num=1 while [ $num -le $numhd ]; do hd=`echo $hds | cut -d' ' -f$num` echo "part raid.0_$num --size=100 --ondisk=$hd --asprimary" >> /tmp/part-include echo "part raid.1_$num --size=1500 --grow --ondisk=$hd" >> /tmp/part-include md0="$md0 raid.0_$num" md1="$md1 raid.1_$num" let num=num+1 done if [ $numhd -le "2" ] ; then raidlevel=1 elif [ $numhd -ge "6" ]; then raidlevel=6 else raidlevel=5 fi echo "raid /boot --fstype ext3 --level=1 --device=md0 $md0" >> /tmp/part-include echo "raid pv.1 --fstype \"physical volume (LVM)\" --level=RAID$raidlevel --device=md1 $md1" >> /tmp/part-include echo "volgroup vg_primary --pesize=32768 pv.1" >> /tmp/part-include echo "logvol / --fstype ext3 --name=lv_root --vgname=vg_primary --size=1200 --grow" >> /tmp/part-include echo "logvol swap --fstype swap --name=lv_swap --vgname=vg_primary --size=256 --grow --maxsize=$swapsize" >> /tmp/part-include fi