summarylogtreecommitdiffstats
path: root/cros-container-guest-tools.install
blob: 3c5207d2eaef0a70c2267894121d9968890ab02c (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
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
post_install() {

	# update dconf after GTK+ theme installed
	if hash dconf 2>/dev/null; then
		dconf update
	fi

	# disable/mask systemd services and sockets which fail or not working as expected under Crostini
	systemctl disable getty@tty1.service
	systemctl mask systemd-journald-audit.socket
	systemctl mask rtkit-daemon.service
	systemctl mask systemd-udev-trigger.service

	# workaround for https://bugs.archlinux.org/task/58701 - remove after fix
	ln -sf /opt/google/cros-containers/cros-adapta /usr/share/themes/CrosAdapta

	# cros-host-fonts
	systemctl unmask usr-share-fonts-chromeos.mount
	systemctl enable usr-share-fonts-chromeos.mount --now

	post_upgrade
}

post_upgrade() {

	# workaround for https://bugs.archlinux.org/task/58701 - remove after fix
	ln -sf /opt/google/cros-containers/bin/sommelier /usr/bin/sommelier

cat << EOF

	This package is permanently work-in-progress while Crostini
	is in beta. Missing features, issues and bugs are possible!

	Developed and tested on Google Pixelbook, but should work 
	fine on other Chromebooks/Chromeboxes with Crostini enabled. 

	Please report any issues to the AUR page!

	(!) Manual actions required:

	1. Check if ~/.config/pulse directory is present. If not, execute
	   cp -r /etc/skel/.config/pulse ~/.config

	Restart Crostini after package was installed/updated and manual actions were done!

EOF

}

pre_remove() {

	# cros-host-fonts
	systemctl stop usr-share-fonts-chromeos.mount
}

post_remove() {

	# update dconf after GTK+ theme installed
	if hash dconf 2>/dev/null; then
		dconf update 2>/dev/null
	fi

	# restore systemd services/sockets
	systemctl enable getty@tty1.service
	systemctl unmask systemd-journald-audit.socket
	systemctl unmask rtkit-daemon.service
	systemctl unmask systemd-udev-trigger.service

	# workaround for https://bugs.archlinux.org/task/58701 - remove after fix
	rm -f /usr/share/themes/CrosAdapta
	rm -f /usr/bin/sommelier

	# cros-host-fonts
	systemctl mask usr-share-fonts-chromeos.mount
}