1 |
# System authorization information |
2 |
auth --enableshadow --passalgo=sha512 |
3 |
|
4 |
# Use CDROM installation media |
5 |
#cdrom #what about usb stick |
6 |
|
7 |
# we do not want Selinux |
8 |
selinux --disabled |
9 |
|
10 |
# services to activate |
11 |
services --disabled=lm_sensors |
12 |
|
13 |
# default root pass, willbe changed in post-install process anyway |
14 |
rootpw --lock |
15 |
|
16 |
# Accept eula |
17 |
eula --agreed |
18 |
|
19 |
# include the partitioning logic from the pre section. |
20 |
%include /tmp/part-include |
21 |
|
22 |
# disable kdump |
23 |
%addon com_redhat_kdump --disable |
24 |
%end |
25 |
|
26 |
|
27 |
%pre |
28 |
# pre section |
29 |
#----- partitioning logic below-------------- |
30 |
# pick the first drive that is not removable and is over MINSIZE |
31 |
DIR="/sys/block" |
32 |
|
33 |
# minimum size of hard drive needed specified in GIGABYTES |
34 |
MINSIZE=5 |
35 |
|
36 |
|
37 |
# Number of detected drives |
38 |
NDEV=0 |
39 |
|
40 |
for DEV in $(lsblk -nl | grep disk | cut -d' ' -f1); do |
41 |
if [ -d /sys/block/$DEV ]; then |
42 |
REMOVABLE=`cat /sys/block/$DEV/removable` |
43 |
if (( $REMOVABLE == 0 )); then |
44 |
SIZE=`cat /sys/block/$DEV/size` |
45 |
GB=$(($SIZE/2**21)) |
46 |
if [ $GB -gt $MINSIZE ]; then |
47 |
DRIVES[$NDEV]=$DEV |
48 |
((NDEV++)) |
49 |
fi |
50 |
fi |
51 |
fi |
52 |
done |
53 |
|
54 |
# For now keep things simple and just use the first one |
55 |
# TODO: |
56 |
# * Create software RAID depending on the number of detected drives |
57 |
# * Allow non LVM install |
58 |
|
59 |
ROOTDRIVE=${DRIVES[0]} |
60 |
if [ $ROOTDRIVE == "" ] ; then |
61 |
echo "No drive suitable for installation found! Please proceed manually." |
62 |
# first in case detection fails... |
63 |
cat << EOF > /tmp/part-include |
64 |
# Clear the Master Boot Record |
65 |
zerombr |
66 |
# System bootloader configuration |
67 |
clearpart --all --initlabel |
68 |
# Automatically create partitions, no LVM |
69 |
autopart --lvm |
70 |
|
71 |
EOF |
72 |
|
73 |
else |
74 |
cat <<_EOF > /tmp/part-include |
75 |
zerombr |
76 |
clearpart --all --drives=$ROOTDRIVE --initlabel |
77 |
bootloader --boot-drive=$ROOTDRIVE |
78 |
part /boot --fstype xfs --size=500 --ondisk=$ROOTDRIVE --label=BOOT |
79 |
part pv.01 --size=4500 --grow --ondisk=$ROOTDRIVE |
80 |
volgroup main pv.01 |
81 |
logvol / --fstype xfs --name=root --vgname=main --grow --size=3000 --label=ROOT |
82 |
logvol swap --fstype swap --name=swap --vgname=main --recommended --label=SWAP |
83 |
_EOF |
84 |
|
85 |
fi |
86 |
|
87 |
%end |
88 |
|
89 |
|
90 |
|
91 |
# packages to install |
92 |
%packages |
93 |
@^minimal |
94 |
@base |
95 |
@core |
96 |
-chrony |
97 |
-kexec-tools |
98 |
|
99 |
%end |
100 |
|
101 |
|
102 |
|
103 |
%post --interpreter=/usr/bin/bash --log=/var/log/ks.post02.log |
104 |
# before reboot performing post-install |
105 |
# this is for first alpha iso. we should put this in anaconda |
106 |
# and / or handle possible upgrade later |
107 |
/sbin/rsyslogd; |
108 |
sleep 2; |
109 |
/sbin/e-smith/signal-event post-install; |
110 |
sleep 2; |
111 |
/sbin/e-smith/db configuration set UnsavedChanges no; |
112 |
touch /forcequotacheck |
113 |
|
114 |
%end |
115 |
|
116 |
%post --nochroot --log=/mnt/sysimage/var/log/ks.post01.log |
117 |
#!/bin/bash |
118 |
sysimage="/mnt/sysimage" |
119 |
|
120 |
cp -r /tmp/anaconda.log ${sysimage}/root/ |
121 |
%end |