-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathks.cfg
55 lines (48 loc) · 1.63 KB
/
ks.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#version=DEVEL
install
text
autostep
cdrom
lang en_US.UTF-8
keyboard us
rootpw --iscrypted $1$ZXgWp4qe$iEAKN6nZ1hTPNqfXiq.a00
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --enforcing
timezone --utc Asia/Shanghai
zerombr
%include /tmp/partition.ks
bootloader --location=mbr
#repo --name="CentOS" --baseurl=cdrom:sr0 --cost=100
reboot
%pre
#!/bin/sh
netif=`cat /proc/net/dev | grep -E -v "(bond|lo|Inter|face)" | awk '{print $1}' | sed "s/://" | sort | head -1`
devname=`ls -1 /dev/*d*1 | egrep "[s|v]d[a-e]1$" | sed -e 's/\/dev\///g' -e 's/1//g' | sort -n | head -1`
if [ -z "$devname" ] || [ ! -b "/dev/$devname" ] ; then
devname=`ls -1 /dev/*d* | egrep "[s|v]d[a-e]$" | sed -e 's/\/dev\///g' -e 's/1//g' | sort -n | head -1`
fi
if [ ! -b "/dev/$devname" ] ; then
devname="sda"
fi
act_mem=`cat /proc/meminfo | grep MemTotal | awk '{printf("%d",$2/1024)}'`
echo "" > /tmp/partition.ks
echo "network --onboot yes --device $netif --bootproto dhcp --noipv6" >> /tmp/partition.ks
echo "clearpart --all --drives=$devname" >> /tmp/partition.ks
echo "part /boot --fstype=ext4 --size=500 --asprimary --ondisk=$devname " >> /tmp/partition.ks
echo "part pv.88555 --grow --size=1 --ondisk=$devname " >> /tmp/partition.ks
echo "volgroup VolGroup --pesize=4096 pv.88555" >> /tmp/partition.ks
echo "logvol swap --name=lv_swap --vgname=VolGroup --fstype=swap --size=${act_mem} --maxsize=28556" >> /tmp/partition.ks
echo "logvol / --fstype=ext4 --name=lv_root --vgname=VolGroup --grow --size=1" >> /tmp/partition.ks
%end
%packages --nobase
@core
bc
lrzsz
ntpdate
rsync
sysstat
wget
%end
%post --interpreter=/bin/bash
%end