aboutsummaryrefslogtreecommitdiffstats
path: root/ci.d/archlinux
blob: c899c43bf5a9ab1f6eead4c0c7c8033c8370514c (plain) (blame)
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
#!/usr/bin/env sh

# archlinux_enable_cron
archlinux_enable_cron() {
	lxc_do systemctl enable cronie
}

# archlinux_fix_network
#
# Only necessary with default LXC. A better fix would be to
# append the following lines to /usr/share/lxc/config/common.seccomp:
#
#   keyctl_chown errno 38
#   keyctl errno 38
#
archlinux_fix_network() {
	# We ForceConnect because the interface is up at container startup.
	lxc_do bash -c \
		'printf "%s\n" \
			"Interface=eth0" \
			"Connection=ethernet" \
			"IP=dhcp" \
			"ForceConnect=yes" > /etc/netctl/eth0'
	sleep 1
	lxc_do netctl enable eth0

	# Fix a bug in Netctl that prevents starting the service.
	lxc_do bash -c ' \
		echo ".include /usr/lib/systemd/system/[email protected]" \
			> /etc/systemd/system/[email protected]'
	lxc_do systemctl daemon-reload
	sleep 1

	# There's probably a better way to do this.
	lxc_do rm /etc/resolv.conf
	lxc_do bash -c 'echo "nameserver 10.0.3.1" > /etc/resolv.conf'

	# Should be good!
	lxc_do systemctl start netctl@eth0
}