--- cdrom.image/sme10/Packages/base/sme-kickstart.cfg 2016/05/27 15:05:34 1.1 +++ cdrom.image/sme10/Packages/base/sme-kickstart.cfg 2016/05/31 12:37:44 1.3 @@ -2,41 +2,109 @@ auth --enableshadow --passalgo=sha512 # Use CDROM installation media cdrom -# Use graphical install -#graphical -#%include /usr/share/anaconda/interactive-defaults.ks -#install -ignoredisk --only-use=vda -# Keyboard layouts -keyboard --xlayouts='us' -# System language -lang en_US.UTF-8 +# we do not want Selinux selinux --disabled -#firewall --disabled -#services --enabled=NetworkManager,sshd -#eula --agreed -#reboot +# 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 -# System timezone -timezone America/New_York --isUtc -# System bootloader configuration -bootloader --append=" crashkernel=auto quiet" --location=mbr --boot-drive=vda +%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" -autopart --type=lvm -# Partition clearing information -clearpart --all --initlabel --drives=vda +# drives smaller than 40GB use smaller boot and swap partitions +# drives larger than 40GB use percentage-based partition sizes +if [ $GB -lt 40 ]; then -bootloader --location=mbr +# drives smaller than 40GB +cat << EOF > /tmp/part-include zerombr -#part swap --asprimary --fstype="swap" --size=1024 -#part /boot --fstype xfs --size=200 -#part pv.01 --size=1 --grow -#volgroup rootvg01 pv.01 -#logvol / --fstype xfs --name=lv01 --vgname=rootvg01 --size=1 --grow +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 -services --disabled=lm_sensors +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 @@ -49,13 +117,15 @@ services --disabled=lm_sensors # pre script could be inserted there to handle partitionning -%post --log=/root/ks-post.log --interpreter=/usr/bin/bash +%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