# System authorization information auth --enableshadow --passalgo=sha512 # Use CDROM installation media cdrom # we do not want Selinux selinux --disabled # services to activate services --disabled=lm_sensors # default root pass, willbe changed in post-install process anyway rootpw --lock # include the partitioning logic from the pre section. %include /tmp/part-include %pre # pre section #----- partitioning logic below-------------- # pick the first drive that is not removable and is over MINSIZE DIR="/sys/block" # minimum size of hard drive needed specified in GIGABYTES MINSIZE=20 ROOTDRIVE="" # /sys/block/*/size is in 512 byte chunks for DEV in sda sdb sdc sdd hda hdb vda vdb xvda xvdb; do if [ -d $DIR/$DEV ]; then REMOVABLE=`cat $DIR/$DEV/removable` if (( $REMOVABLE == 0 )); then echo $DEV SIZE=`cat $DIR/$DEV/size` GB=$(($SIZE/2**21)) if [ $GB -gt $MINSIZE ]; then echo "$(($SIZE/2**21))" if [ -z $ROOTDRIVE ]; then ROOTDRIVE=$DEV fi fi fi fi done echo "ROOTDRIVE=$ROOTDRIVE" # drives smaller than 40GB use smaller boot and swap partitions # drives larger than 40GB use percentage-based partition sizes if [ $GB -lt 40 ]; then # drives smaller than 40GB cat << EOF > /tmp/part-include zerombr clearpart --all --drives=$ROOTDRIVE --initlabel bootloader --location=mbr --driveorder=$ROOTDRIVE # for boot partition part /boot --fstype ext4 --size=300 --ondisk=$ROOTDRIVE # for LVM partition part pv.8 --size=4600 --grow --ondisk=$ROOTDRIVE # LVM volgroup main --pesize=65536 pv.8 logvol / --fstype ext4 --name=root --vgname=main --grow --size=3000 logvol swap --fstype swap --name=swap --vgname=main --size=1500 EOF else # drives 40GB and larger cat << EOF > /tmp/part-include zerombr clearpart --all --drives=$ROOTDRIVE --initlabel bootloader --location=mbr --driveorder=$ROOTDRIVE # for boot partition part /boot --fstype ext4 --size=500 --ondisk=$ROOTDRIVE # for LVM partition part pv.8 --size=4600 --grow --ondisk=$ROOTDRIVE # LVM volgroup main --pesize=65536 pv.8 logvol / --fstype ext4 --name=root --vgname=main --grow --size=3000 logvol swap --fstype swap --name=swap --vgname=main --size=4000 EOF fi %end # packages to install %packages @^minimal @base @core -chrony -kexec-tools %end # pre script could be inserted there to handle partitionning %post --interpreter=/usr/bin/bash # before reboot performing post-install # this is for first alpha iso. we should put this in anaconda # and / or handle possible upgrade later /sbin/rsyslogd; sleep 2; /sbin/e-smith/signal-event post-install; sleep 2; /sbin/e-smith/db configuration set UnsavedChanges no; touch /forcequotacheck %end