forked from coreos/fedora-coreos-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
image.ks
68 lines (55 loc) · 2.1 KB
/
image.ks
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
56
57
58
59
60
61
62
63
64
65
66
67
68
# This line is interpreted by coreos-virt-install
#--coreos-virt-install-disk-size-gb: 8
text
lang en_US.UTF-8
keyboard us
timezone --utc Etc/UTC
selinux --enforcing
rootpw --lock --iscrypted locked
# create core user for now
# https://github.com/openshift/os/issues/96
user --name=core --groups='wheel,sudo,adm,systemd-journal'
# Explicitly disable firewall since cloud providers generally provide
# higher level firewall constructs (i.e. security groups).
firewall --disabled
network --bootproto=dhcp --onboot=on
zerombr
clearpart --initlabel --all
# Add the following to kernel boot args:
# - ip=dhcp # how to get network
# - rd.neednet=1 # tell dracut we need network
# - $coreos_firstboot # This is actually a GRUB variable
bootloader --timeout=1 --append="no_timer_check console=ttyS0,115200n8 console=tty0 net.ifnames=0 biosdevname=0 ip=dhcp rd.neednet=1 rw $coreos_firstboot"
part /boot --size=300 --fstype="xfs" --label=boot
part pv.01 --grow
volgroup coreos pv.01
logvol / --size=3000 --fstype="xfs" --name=root --vgname=coreos --label=root
reboot
%post --erroronfail
# https://github.com/dustymabe/ignition-dracut/pull/12
touch /boot/coreos-firstboot
# Configure docker-storage-setup to resize the partition table on boot
# https://github.com/projectatomic/docker-storage-setup/pull/25
echo 'GROWPART=true' >> /etc/sysconfig/docker-storage-setup
# https://pagure.io/atomic-wg/issue/343
echo 'ROOT_SIZE=+100%FREE' >> /etc/sysconfig/docker-storage-setup
# Remove any persistent NIC rules generated by udev
rm -vf /etc/udev/rules.d/*persistent-net*.rules
# simple eth0 config, again not hard-coded to the build hardware
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"
TYPE="Ethernet"
PERSISTENT_DHCLIENT="yes"
NM_CONTROLLED="yes"
EOF
# Anaconda is writing a /etc/resolv.conf from the generating environment.
# The system should start out with an empty file.
truncate -s 0 /etc/resolv.conf
# clean-up
echo "Removing random-seed so it's not the same in every image."
rm -f /var/lib/random-seed
echo "Removing /root/anaconda-ks.cfg"
rm -f /root/anaconda-ks.cfg
%end