1 |
unnilennium |
1.1 |
# System authorization information |
2 |
|
|
auth --enableshadow --passalgo=sha512 |
3 |
unnilennium |
1.4 |
|
4 |
unnilennium |
1.1 |
# Use CDROM installation media |
5 |
unnilennium |
1.4 |
#cdrom #what about usb stick |
6 |
|
|
|
7 |
unnilennium |
1.3 |
# we do not want Selinux |
8 |
unnilennium |
1.1 |
selinux --disabled |
9 |
unnilennium |
1.4 |
|
10 |
unnilennium |
1.3 |
# services to activate |
11 |
|
|
services --disabled=lm_sensors |
12 |
unnilennium |
1.4 |
|
13 |
unnilennium |
1.3 |
# default root pass, willbe changed in post-install process anyway |
14 |
|
|
rootpw --lock |
15 |
unnilennium |
1.1 |
|
16 |
unnilennium |
1.4 |
# Accept eula |
17 |
|
|
eula --agreed |
18 |
|
|
|
19 |
unnilennium |
1.3 |
# include the partitioning logic from the pre section. |
20 |
|
|
%include /tmp/part-include |
21 |
unnilennium |
1.1 |
|
22 |
unnilennium |
1.4 |
# disable kdump |
23 |
|
|
%addon com_redhat_kdump --disable |
24 |
|
|
%end |
25 |
|
|
|
26 |
|
|
|
27 |
unnilennium |
1.3 |
%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 |
unnilennium |
1.4 |
MINSIZE=5 |
35 |
unnilennium |
1.3 |
|
36 |
|
|
|
37 |
unnilennium |
1.4 |
# Number of detected drives |
38 |
|
|
NDEV=0 |
39 |
unnilennium |
1.3 |
|
40 |
unnilennium |
1.4 |
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 |
unnilennium |
1.3 |
if (( $REMOVABLE == 0 )); then |
44 |
unnilennium |
1.4 |
SIZE=`cat /sys/block/$DEV/size` |
45 |
unnilennium |
1.3 |
GB=$(($SIZE/2**21)) |
46 |
|
|
if [ $GB -gt $MINSIZE ]; then |
47 |
unnilennium |
1.4 |
DRIVES[$NDEV]=$DEV |
48 |
|
|
((NDEV++)) |
49 |
unnilennium |
1.3 |
fi |
50 |
|
|
fi |
51 |
|
|
fi |
52 |
|
|
done |
53 |
|
|
|
54 |
unnilennium |
1.4 |
# 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 |
unnilennium |
1.3 |
cat << EOF > /tmp/part-include |
64 |
unnilennium |
1.4 |
# Clear the Master Boot Record |
65 |
unnilennium |
1.2 |
zerombr |
66 |
unnilennium |
1.4 |
# System bootloader configuration |
67 |
|
|
clearpart --all --initlabel |
68 |
|
|
# Automatically create partitions, no LVM |
69 |
|
|
autopart --lvm |
70 |
unnilennium |
1.3 |
|
71 |
|
|
EOF |
72 |
|
|
|
73 |
|
|
else |
74 |
unnilennium |
1.4 |
cat <<_EOF > /tmp/part-include |
75 |
unnilennium |
1.3 |
zerombr |
76 |
|
|
clearpart --all --drives=$ROOTDRIVE --initlabel |
77 |
unnilennium |
1.4 |
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 |
unnilennium |
1.3 |
|
85 |
|
|
fi |
86 |
|
|
|
87 |
|
|
%end |
88 |
|
|
|
89 |
|
|
|
90 |
|
|
|
91 |
unnilennium |
1.2 |
# packages to install |
92 |
unnilennium |
1.1 |
%packages |
93 |
|
|
@^minimal |
94 |
|
|
@base |
95 |
|
|
@core |
96 |
|
|
-chrony |
97 |
|
|
-kexec-tools |
98 |
|
|
|
99 |
|
|
%end |
100 |
|
|
|
101 |
|
|
|
102 |
|
|
|
103 |
unnilennium |
1.4 |
%post --interpreter=/usr/bin/bash --log=/var/log/ks.post02.log |
104 |
unnilennium |
1.1 |
# 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 |
unnilennium |
1.2 |
sleep 2; |
111 |
|
|
/sbin/e-smith/db configuration set UnsavedChanges no; |
112 |
unnilennium |
1.1 |
touch /forcequotacheck |
113 |
|
|
|
114 |
|
|
%end |
115 |
unnilennium |
1.4 |
|
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 |