summaryrefslogtreecommitdiffstats
path: root/modules.d/slx-drm/module-setup.sh
blob: 13c15b9ef4bddc6d657080a3a27be2ca0d2e353e (plain) (blame)
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
#!/usr/bin/env bash
check() {
	# Tell dracut that this module should only be included if it is required
	# explicitly.
	return 255
}
depends() {
	echo drm
}
installkernel() {
	instmods acpi_ipmi
}
install() {
	# grab what mltk produced, to externalize this part!
	for dir in "/drm.cfg.d" "/lib/modules/nvidia"; do
		[ -d "$dir" ] || continue
		mkdir -p "${initdir}/${dir%/*}"
		cp -ar "$dir" "${initdir}/${dir%/*}"
	done
	for _name in "s3-activate-nvidia-drivers" "s3-copy-nvidia-drivers"; do
		inst "$moddir/hooks/${_name}.sh" \
				"/usr/local/bin/${_name}.sh"
		inst_simple "${moddir}/services/${_name}.service" \
				"${systemdsystemunitdir}/${_name}.service"
		mkdir --parents \
				"${initdir}/${systemdsystemunitdir}/initrd.target.wants"
		ln_r "${systemdsystemunitdir}/${_name}.service" \
				"${systemdsystemunitdir}/initrd.target.wants/${_name}.service"
	done
}