-
Notifications
You must be signed in to change notification settings - Fork 1
/
linux_rhel_template_ks.cfg
executable file
·46 lines (44 loc) · 1.17 KB
/
linux_rhel_template_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
lang en_US
langsupport --default en_US
network --bootproto dhcp
cdrom
keyboard us
zerombr yes
clearpart --all
part / --size 3000 --grow
part swap --recommended
install
mouse generic3ps/2
firewall --enabled
timezone --utc Europe/London
xconfig --resolution=800x600
rootpw $password
reboot
auth --useshadow --enablemd5
bootloader --location=mbr
key --skip
%packages --resolvedeps
kernel-source
@ X Window System
@ GNOME Desktop Environment
@ Graphical Internet
@ Development Tools
# "post" step is done in Anaconda right after all packages are installed, but before reboot.
%post --log=/root/ks-post.log
/usr/sbin/adduser $user
/usr/sbin/usermod -p $userpassword_encrypted $user
mkdir -p /mnt/cdrom
sed -i 's/GRAPHICAL=yes/GRAPHICAL=no/' /etc/sysconfig/init
cp /etc/rc.d/rc.local /etc/rc.local.backup
# Generating "rc.local" file, which will act as first-boot script, after reboot:
cat >>/etc/rc.d/rc.local <<EOF
echo
echo "Installing VirtualBox Guest Additions..."
mount -t iso9660 -o ro /dev/hdc /mnt/cdrom
bash /mnt/cdrom/VBoxLinuxAdditions.run
eject /dev/hdc
usermod -a -G vboxsf $user
sed -i 's/GRAPHICAL=no/GRAPHICAL=yes/' /etc/sysconfig/init
mv /etc/rc.local.backup /etc/rc.d/rc.local
init 5
EOF