1 |
# System authorization information |
2 |
auth --enableshadow --passalgo=sha512 |
3 |
# Use CDROM installation media |
4 |
cdrom |
5 |
# we do not want Selinux |
6 |
selinux --disabled |
7 |
# services to activate |
8 |
services --disabled=lm_sensors |
9 |
# default root pass, willbe changed in post-install process anyway |
10 |
rootpw --lock |
11 |
|
12 |
# include the partitioning logic from the pre section. |
13 |
%include /tmp/part-include |
14 |
|
15 |
%pre |
16 |
# pre section |
17 |
#----- partitioning logic below-------------- |
18 |
# pick the first drive that is not removable and is over MINSIZE |
19 |
DIR="/sys/block" |
20 |
|
21 |
# minimum size of hard drive needed specified in GIGABYTES |
22 |
MINSIZE=20 |
23 |
|
24 |
ROOTDRIVE="" |
25 |
|
26 |
# /sys/block/*/size is in 512 byte chunks |
27 |
|
28 |
for DEV in sda sdb sdc sdd hda hdb vda vdb xvda xvdb; do |
29 |
if [ -d $DIR/$DEV ]; then |
30 |
REMOVABLE=`cat $DIR/$DEV/removable` |
31 |
if (( $REMOVABLE == 0 )); then |
32 |
echo $DEV |
33 |
SIZE=`cat $DIR/$DEV/size` |
34 |
GB=$(($SIZE/2**21)) |
35 |
if [ $GB -gt $MINSIZE ]; then |
36 |
echo "$(($SIZE/2**21))" |
37 |
if [ -z $ROOTDRIVE ]; then |
38 |
ROOTDRIVE=$DEV |
39 |
fi |
40 |
fi |
41 |
fi |
42 |
fi |
43 |
done |
44 |
|
45 |
echo "ROOTDRIVE=$ROOTDRIVE" |
46 |
|
47 |
# drives smaller than 40GB use smaller boot and swap partitions |
48 |
# drives larger than 40GB use percentage-based partition sizes |
49 |
|
50 |
if [ $GB -lt 40 ]; then |
51 |
|
52 |
# drives smaller than 40GB |
53 |
cat << EOF > /tmp/part-include |
54 |
zerombr |
55 |
clearpart --all --drives=$ROOTDRIVE --initlabel |
56 |
bootloader --location=mbr --driveorder=$ROOTDRIVE |
57 |
# for boot partition |
58 |
part /boot --fstype ext4 --size=300 --ondisk=$ROOTDRIVE |
59 |
# for LVM partition |
60 |
part pv.8 --size=4600 --grow --ondisk=$ROOTDRIVE |
61 |
# LVM |
62 |
volgroup main --pesize=65536 pv.8 |
63 |
logvol / --fstype ext4 --name=root --vgname=main --grow --size=3000 |
64 |
logvol swap --fstype swap --name=swap --vgname=main --size=1500 |
65 |
|
66 |
EOF |
67 |
|
68 |
|
69 |
else |
70 |
# drives 40GB and larger |
71 |
|
72 |
cat << EOF > /tmp/part-include |
73 |
zerombr |
74 |
clearpart --all --drives=$ROOTDRIVE --initlabel |
75 |
bootloader --location=mbr --driveorder=$ROOTDRIVE |
76 |
# for boot partition |
77 |
part /boot --fstype ext4 --size=500 --ondisk=$ROOTDRIVE |
78 |
# for LVM partition |
79 |
part pv.8 --size=4600 --grow --ondisk=$ROOTDRIVE |
80 |
# LVM |
81 |
volgroup main --pesize=65536 pv.8 |
82 |
logvol / --fstype ext4 --name=root --vgname=main --grow --size=3000 |
83 |
logvol swap --fstype swap --name=swap --vgname=main --size=4000 |
84 |
|
85 |
EOF |
86 |
|
87 |
fi |
88 |
|
89 |
%end |
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
# packages to install |
108 |
%packages |
109 |
@^minimal |
110 |
@base |
111 |
@core |
112 |
-chrony |
113 |
-kexec-tools |
114 |
|
115 |
%end |
116 |
|
117 |
|
118 |
# pre script could be inserted there to handle partitionning |
119 |
|
120 |
%post --interpreter=/usr/bin/bash |
121 |
# before reboot performing post-install |
122 |
# this is for first alpha iso. we should put this in anaconda |
123 |
# and / or handle possible upgrade later |
124 |
/sbin/rsyslogd; |
125 |
sleep 2; |
126 |
/sbin/e-smith/signal-event post-install; |
127 |
sleep 2; |
128 |
/sbin/e-smith/db configuration set UnsavedChanges no; |
129 |
touch /forcequotacheck |
130 |
|
131 |
%end |