forked from coreos/fedora-coreos-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
image.ks
73 lines (61 loc) · 2.49 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
69
70
71
72
73
# Currently the coreos-assembler tool is generating
# disk images via Anaconda (inside virt-install).
# This is likely to change in the future; see
# https://github.com/coreos/coreos-assembler/issues/75#issuecomment-421139257
# https://github.com/coreos/fedora-coreos-tracker/issues/18
#
# Note that coreos-assembler also injects an additional %post.
#
# For now, if you're doing something custom, you should
# be tracking issues/PRs for both this repo and particularly
# coreos-assembler.
# This line is interpreted by coreos-virt-install
#--coreos-virt-install-disk-size-gb: 8
# We use this because Kickstart doesn't have a way to specify
# the *total* size of the disk.
text
lang en_US.UTF-8
keyboard us
timezone --utc Etc/UTC
selinux --enforcing
rootpw --lock --iscrypted locked
# 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"
# https://github.com/coreos/fedora-coreos-tracker/issues/18
# See also coreos-growpart.service defined in fedora-coreos-base.yaml
# You can change this partition layout, but note that the `boot` and `root`
# filesystem labels are currently mandatory (they're interpreted by coreos-assembler).
part /boot --size=300 --fstype="xfs" --label=boot
# Note no reflinks for /boot since the bootloader may not understand them
part / --size=3000 --fstype="xfs" --label=root --grow --mkfsoptions="-m reflink=1"
reboot
%post --erroronfail
# 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