--- 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/07/02 11:34:04 1.4 @@ -1,42 +1,94 @@ # System authorization information 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 +#cdrom #what about usb stick + +# we do not want Selinux selinux --disabled -#firewall --disabled -#services --enabled=NetworkManager,sshd -#eula --agreed -#reboot +# services to activate +services --disabled=lm_sensors -# System timezone -timezone America/New_York --isUtc -# System bootloader configuration -bootloader --append=" crashkernel=auto quiet" --location=mbr --boot-drive=vda +# default root pass, willbe changed in post-install process anyway +rootpw --lock + +# Accept eula +eula --agreed -autopart --type=lvm -# Partition clearing information -clearpart --all --initlabel --drives=vda +# include the partitioning logic from the pre section. +%include /tmp/part-include + +# disable kdump +%addon com_redhat_kdump --disable +%end -bootloader --location=mbr +%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=5 + + +# Number of detected drives +NDEV=0 + +for DEV in $(lsblk -nl | grep disk | cut -d' ' -f1); do + if [ -d /sys/block/$DEV ]; then + REMOVABLE=`cat /sys/block/$DEV/removable` + if (( $REMOVABLE == 0 )); then + SIZE=`cat /sys/block/$DEV/size` + GB=$(($SIZE/2**21)) + if [ $GB -gt $MINSIZE ]; then + DRIVES[$NDEV]=$DEV + ((NDEV++)) + fi + fi + fi +done + +# For now keep things simple and just use the first one +# TODO: +# * Create software RAID depending on the number of detected drives +# * Allow non LVM install + +ROOTDRIVE=${DRIVES[0]} +if [ $ROOTDRIVE == "" ] ; then +echo "No drive suitable for installation found! Please proceed manually." +# first in case detection fails... +cat << EOF > /tmp/part-include +# Clear the Master Boot Record 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 +# System bootloader configuration +clearpart --all --initlabel +# Automatically create partitions, no LVM +autopart --lvm -services --disabled=lm_sensors +EOF + +else +cat <<_EOF > /tmp/part-include +zerombr +clearpart --all --drives=$ROOTDRIVE --initlabel +bootloader --boot-drive=$ROOTDRIVE +part /boot --fstype xfs --size=500 --ondisk=$ROOTDRIVE --label=BOOT +part pv.01 --size=4500 --grow --ondisk=$ROOTDRIVE +volgroup main pv.01 +logvol / --fstype xfs --name=root --vgname=main --grow --size=3000 --label=ROOT +logvol swap --fstype swap --name=swap --vgname=main --recommended --label=SWAP +_EOF + +fi + +%end + + + +# packages to install %packages @^minimal @base @@ -47,15 +99,23 @@ services --disabled=lm_sensors %end -# pre script could be inserted there to handle partitionning -%post --log=/root/ks-post.log --interpreter=/usr/bin/bash +%post --interpreter=/usr/bin/bash --log=/var/log/ks.post02.log # 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 + +%post --nochroot --log=/mnt/sysimage/var/log/ks.post01.log +#!/bin/bash +sysimage="/mnt/sysimage" + +cp -r /tmp/anaconda.log ${sysimage}/root/ +%end