summarylogtreecommitdiffstats
path: root/pinephone-dev-tools.install
blob: c332283708abb80dd27c5f0d4fdbb11cb8fa1cd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
post_install() {
	# Enable automatic start of USB Gadget
	systemctl enable pinephone-usb-gadget
	
	# Try setting up USB networking directly; if it doesn't work (i.e. the NM
	# connection file isn't created), then we're probably creating an image and
	# need a systemd service running on first boot to setup USB networking
	/usr/sbin/pinephone-setup-usb-network
	if [ ! -e /etc/NetworkManager/system-connections/USB.nmconnection ]; then
		systemctl enable pinephone-setup-usb-network
	fi
}

pre_remove() {
	# Remove USB gadget network connection
	nmcli connection delete USB

	# Disable automatic start of USB gadget
	systemctl disable pinephone-usb-gadget
}