--- cdrom.image/sme10/Packages/base/sme-kickstart.cfg 2016/05/31 12:37:44 1.3 +++ cdrom.image/sme10/Packages/base/sme-kickstart.cfg 2016/07/02 11:34:04 1.4 @@ -1,17 +1,29 @@ # System authorization information auth --enableshadow --passalgo=sha512 + # Use CDROM installation media -cdrom +#cdrom #what about usb stick + # 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 +# Accept eula +eula --agreed + # include the partitioning logic from the pre section. %include /tmp/part-include +# disable kdump +%addon com_redhat_kdump --disable +%end + + %pre # pre section #----- partitioning logic below-------------- @@ -19,70 +31,56 @@ rootpw --lock DIR="/sys/block" # minimum size of hard drive needed specified in GIGABYTES -MINSIZE=20 +MINSIZE=5 -ROOTDRIVE="" -# /sys/block/*/size is in 512 byte chunks +# Number of detected drives +NDEV=0 -for DEV in sda sdb sdc sdd hda hdb vda vdb xvda xvdb; do - if [ -d $DIR/$DEV ]; then - REMOVABLE=`cat $DIR/$DEV/removable` +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 - echo $DEV - SIZE=`cat $DIR/$DEV/size` + SIZE=`cat /sys/block/$DEV/size` GB=$(($SIZE/2**21)) if [ $GB -gt $MINSIZE ]; then - echo "$(($SIZE/2**21))" - if [ -z $ROOTDRIVE ]; then - ROOTDRIVE=$DEV - fi + DRIVES[$NDEV]=$DEV + ((NDEV++)) 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 +# 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 -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 +# System bootloader configuration +clearpart --all --initlabel +# Automatically create partitions, no LVM +autopart --lvm EOF - else -# drives 40GB and larger - -cat << EOF > /tmp/part-include +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 +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 @@ -90,20 +88,6 @@ fi - - - - - - - - - - - - - - # packages to install %packages @^minimal @@ -115,9 +99,8 @@ fi %end -# pre script could be inserted there to handle partitionning -%post --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 @@ -129,3 +112,10 @@ sleep 2; 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