summaryrefslogtreecommitdiff
path: root/kvmd.install
blob: 678a38a3c2bf36b84d72e2a5739bc776dfbce18f (plain)
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
post_install() {
	post_upgrade

	echo "==> Generating KVMD certificate ..."
	kvmd-gencert --do-the-thing
}

post_upgrade() {
	echo "==> Ensuring KVMD users and groups ..."
	systemd-sysusers /usr/lib/sysusers.d/kvmd.conf

	# https://github.com/systemd/systemd/issues/13522
	usermod --expiredate= kvmd >/dev/null

	chown kvmd:kvmd /etc/kvmd/htpasswd
	chown kvmd-ipmi:kvmd-ipmi /etc/kvmd/ipmipasswd
	chown kvmd-vnc:kvmd-vnc /etc/kvmd/vncpasswd
	chmod 600 /etc/kvmd/*passwd

	chown kvmd /var/lib/kvmd/msd || true

	echo "==> Patching configs ..."
	sed -i -e 's/^dtoverlay=pi3-disable-bt$/dtoverlay=disable-bt/g' /boot/config.txt
	sed -i -e 's/^dtoverlay=dwc2$/dtoverlay=dwc2,dr_mode=peripheral/g' /boot/config.txt
}