1 |
# System authorization information |
# System authorization information |
2 |
auth --enableshadow --passalgo=sha512 |
auth --enableshadow --passalgo=sha512 |
3 |
|
|
4 |
# Use CDROM installation media |
# Use CDROM installation media |
5 |
cdrom |
#cdrom #what about usb stick |
6 |
# Use graphical install |
|
7 |
#graphical |
# we do not want Selinux |
|
#%include /usr/share/anaconda/interactive-defaults.ks |
|
|
#install |
|
|
ignoredisk --only-use=vda |
|
|
# Keyboard layouts |
|
|
keyboard --xlayouts='us' |
|
|
# System language |
|
|
lang en_US.UTF-8 |
|
8 |
selinux --disabled |
selinux --disabled |
|
#reboot |
|
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 |
# System timezone |
# Accept eula |
17 |
timezone America/New_York --isUtc |
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 |
# System bootloader configuration |
67 |
bootloader --append=" crashkernel=auto quiet" --location=mbr --boot-drive=vda |
clearpart --all --initlabel |
68 |
#Clear the Master Boot Record |
# Automatically create partitions, no LVM |
69 |
#zerombr yes |
autopart --lvm |
70 |
|
|
71 |
|
EOF |
72 |
|
|
73 |
|
else |
74 |
|
cat <<_EOF > /tmp/part-include |
75 |
zerombr |
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 |
# Partition clearing information |
fi |
|
#clearpart --all --initlabel --drives=vda |
|
86 |
|
|
87 |
# autopartionning |
%end |
|
autopart --type=lvm |
|
88 |
|
|
|
## Disks for 500 MB boot partition |
|
|
#part raid.01 --size=500 --asprimary --ondisk=vda |
|
|
#part raid.02 --size=500 --asprimary --ondisk=vdb |
|
|
|
|
|
## Disks for LVM partition |
|
|
#part raid.11 --size=1 --grow --ondisk=vda |
|
|
#part raid.12 --size=1 --grow --ondisk=vdb |
|
|
|
|
|
## RAID settings |
|
|
#raid /boot --fstype ext2 --device md0 --level=RAID1 raid.01 raid.02 |
|
|
#raid pv.01 --device md1 --level=RAID1 raid.11 raid.12 |
|
|
|
|
|
# LVM configuration |
|
|
#volgroup vg pv.01 |
|
|
#logvol / --vgname=vg --size=1 --grow --fstype ext3 --name=root |
|
|
#logvol swap --vgname=vg --recommended --name=swap |
|
89 |
|
|
90 |
|
|
|
# services to activate |
|
|
services --disabled=lm_sensors |
|
91 |
# packages to install |
# packages to install |
92 |
%packages |
%packages |
93 |
@^minimal |
@^minimal |
99 |
%end |
%end |
100 |
|
|
101 |
|
|
|
# pre script could be inserted there to handle partitionning |
|
102 |
|
|
103 |
%post --interpreter=/usr/bin/bash |
%post --interpreter=/usr/bin/bash --log=/var/log/ks.post02.log |
104 |
# before reboot performing post-install |
# before reboot performing post-install |
105 |
# this is for first alpha iso. we should put this in anaconda |
# this is for first alpha iso. we should put this in anaconda |
106 |
# and / or handle possible upgrade later |
# and / or handle possible upgrade later |
112 |
touch /forcequotacheck |
touch /forcequotacheck |
113 |
|
|
114 |
%end |
%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 |