summaryrefslogtreecommitdiffstats
path: root/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-load_gfx_driver
blob: e6fd32cfd625dac7e3c307510672faea485bcb32 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

PCIFILE=/tmp/lspci-output

if ! lspci -n > "$PCIFILE"; then
	echo "lspci -n failed..."
	exit 1
fi

if lsmod | grep -q '^nvidia\s'; then
	# nvidia kernel module was loaded in stage31 - download libs
	echo "Proprietary nvidia kernel drivers loaded - fetch user space libs"
	systemctl start setup-slx-addon@nvidia_libs &
	echo -e "# Written by load-gfx-driver\nSLX_VMWARE_3D=yes" >> "/opt/openslx/config"
elif grep -q -E ' (8086:0102|8086:0152|8086:0162|8086:0412|8086:0416|1002:6779)( |$)' "$PCIFILE"; then
	echo "i915 - enable 3D"
	echo -e "# Written by load-gfx-driver\nSLX_VMWARE_3D=yes" >> "/opt/openslx/config"
fi

exit 0