summaryrefslogtreecommitdiffstats
path: root/modules.d/slx-drm
diff options
context:
space:
mode:
Diffstat (limited to 'modules.d/slx-drm')
-rwxr-xr-xmodules.d/slx-drm/module-setup.sh18
-rw-r--r--modules.d/slx-drm/services/s3-activate-nvidia-drivers.service13
-rw-r--r--modules.d/slx-drm/services/s3-copy-nvidia-drivers.service12
3 files changed, 8 insertions, 35 deletions
diff --git a/modules.d/slx-drm/module-setup.sh b/modules.d/slx-drm/module-setup.sh
index 13c15b9e..6f4b9ac7 100755
--- a/modules.d/slx-drm/module-setup.sh
+++ b/modules.d/slx-drm/module-setup.sh
@@ -17,14 +17,12 @@ install() {
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
+ # Prepare /lib/modules and depmod for nvidia if applicable
+ slx_service "s3-activate-nvidia-drivers" "Enable loading of nVidia drivers if a suitable GPU is found" \
+ --wafter "dracut-cmdline.service" \
+ --wbefore "dracut-pre-udev.service"
+ # Copy nVidia drivers to stage 4 if they're loaded
+ slx_service "s3-copy-nvidia-drivers" "Copy nVidia drivers to stage 4 if in use" \
+ --wafter "initrd-root-fs.target" \
+ --wafter "s3-activate-nvidia-drivers.service"
}
diff --git a/modules.d/slx-drm/services/s3-activate-nvidia-drivers.service b/modules.d/slx-drm/services/s3-activate-nvidia-drivers.service
deleted file mode 100644
index 4ea86525..00000000
--- a/modules.d/slx-drm/services/s3-activate-nvidia-drivers.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=Enable loading of nVidia drivers if a suitable GPU is found
-Requires=dracut-cmdline.service
-After=dracut-cmdline.service
-Before=dracut-pre-udev.service
-Wants=dracut-pre-udev.service
-DefaultDependencies=no
-IgnoreOnIsolate=true
-
-[Service]
-Type=oneshot
-RemainAfterExit=true
-ExecStart=/usr/local/bin/s3-activate-nvidia-drivers.sh
diff --git a/modules.d/slx-drm/services/s3-copy-nvidia-drivers.service b/modules.d/slx-drm/services/s3-copy-nvidia-drivers.service
deleted file mode 100644
index 587a1175..00000000
--- a/modules.d/slx-drm/services/s3-copy-nvidia-drivers.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=Copy nVidia drivers to stage 4 if in use
-After=dracut-mount.service
-After=s3-activate-nvidia-drivers.service
-Before=initrd-switch-root.target
-DefaultDependencies=no
-IgnoreOnIsolate=true
-
-[Service]
-Type=oneshot
-RemainAfterExit=true
-ExecStart=/usr/local/bin/s3-copy-nvidia-drivers.sh