-
Notifications
You must be signed in to change notification settings - Fork 168
/
Copy pathcentos-7-aarch64.ks
130 lines (108 loc) · 3.3 KB
/
centos-7-aarch64.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# This is a minimal CentOS kickstart designed for docker.
# It will not produce a bootable system
# To use this kickstart, run the following command
# livemedia-creator --make-tar \
# --iso=/path/to/boot.iso \
# --ks=centos-7.ks \
# --image-name=centos-root.tar.xz
#
# Once the image has been generated, it can be imported into docker
# by using: cat centos-root.tar.xz | docker import -i imagename
# Basic setup information
url --url="http://mirror.centos.org/altarch/7/os/aarch64/"
install
keyboard us --xlayouts=us --vckeymap=us
rootpw --lock --iscrypted locked
timezone --isUtc --nontp UTC
selinux --enforcing
firewall --disabled
network --bootproto=dhcp --device=link --activate --onboot=on
shutdown
bootloader --location=mbr
lang en_US.UTF-8
# Repositories to use
repo --name="instCentOS" --baseurl=http://mirror.centos.org/altarch/7/os/aarch64/ --cost=100
## Uncomment for rolling builds
repo --name="instUpdates" --baseurl=http://mirror.centos.org/altarch/7/updates/aarch64/ --cost=100
# Disk setup
clearpart --initlabel --all
part /boot/efi --size=100
part /boot --size=400 --label=boot
part swap --size=2000 --label=swap --asprimary
part / --size=8192 --label=rootfs
# Package setup
%packages --excludedocs --instLangs=en --nocore
bind-utils
bash
yum
vim-minimal
centos-release
less
-kernel*
-*firmware
-os-prober
-gettext*
-bind-license
-freetype
iputils
iproute
systemd
rootfiles
-libteam
-teamd
tar
passwd
yum-utils
yum-plugin-ovl
-GeoIP
-firewalld-filesystem
-libss
-qemu-guest-agent
%end
%post --log=/anaconda-post.log
# Post configure tasks for Docker
# remove stuff we don't need that anaconda insists on
# kernel needs to be removed by rpm, because of grubby
rpm -e kernel
yum -y remove bind-libs bind-libs-lite dhclient dhcp-common dhcp-libs \
dracut-network e2fsprogs e2fsprogs-libs ebtables ethtool file \
firewalld freetype gettext gettext-libs groff-base grub2-efi grub2-tools \
grubby initscripts iproute iptables kexec-tools libcroco libgomp \
libmnl libnetfilter_conntrack libnfnetlink libselinux-python lzo \
libunistring os-prober python-decorator python-slip python-slip-dbus \
snappy sysvinit-tools which linux-firmware centos-logos shim \
mokutil pciutils-libs xfsprogs dosfstools efibootmgr efivar-libs \
GeoIP firewalld-filesystem
yum clean all
#clean up unused directories
rm -rf /boot
rm -rf /etc/firewalld
# Lock roots account, keep roots account password-less.
passwd -l root
#LANG="en_US"
#echo "%_install_lang $LANG" > /etc/rpm/macros.image-language-conf
awk '(NF==0&&!done){print "override_install_langs='$LANG'\ntsflags=nodocs";done=1}{print}' \
< /etc/yum.conf > /etc/yum.conf.new
mv /etc/yum.conf.new /etc/yum.conf
echo 'container' > /etc/yum/vars/infra
#Setup locale properly
#localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
rm -rf /var/cache/yum/aarch64
rm -f /tmp/ks-script*
rm -rf /var/log/anaconda*
rm -rf /tmp/ks-script*
rm -rf /etc/sysconfig/network-scripts/ifcfg-*
# do we really need a hardware database in a container?
rm -rf /etc/udev/hwdb.bin
rm -rf /usr/lib/udev/hwdb.d/*
## Systemd fixes
# no machine-id by default.
:> /etc/machine-id
# Fix /run/lock breakage since it's not tmpfs in docker
umount /run
systemd-tmpfiles --create --boot
# Make sure login works
rm /var/run/nologin
#Generate installtime file record
/bin/date +%Y%m%d_%H%M > /etc/BUILDTIME
%end