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

PCIFILE=/tmp/lspci-output

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

if grep -E ' 8086:0152( |$)' "$PCIFILE" > /dev/null; then
	echo "i915 - enable 3D"
	echo -e "# Written by load-gfx-driver\nSLX_VMWARE_3D=yes" >> "/opt/openslx/config"
fi

if lsmod | grep -q '^nvidia\s'; then
	# nvidia kernel module was loaded in stage31 - download libs
	systemctl start setup-slx-addon@nvidia_libs &
	echo -e "# Written by load-gfx-driver\nSLX_VMWARE_3D=yes" >> "/opt/openslx/config"
fi

exit 0