mirror of
https://gitlab.com/nonguix/nonguix.git
synced 2024-11-22 00:18:07 +01:00
nongnu: nvidia-driver: Simplify udev rules creation.
* nongnu/packages/nvidia.scm (nvidia-driver)[arguments]<#:phases>: Simplify udev rules creation. Signed-off-by: Jonathan Brielmaier <jonathan.brielmaier@web.de>
This commit is contained in:
parent
9f4e8e82f1
commit
fe9813a3ee
1 changed files with 11 additions and 17 deletions
|
@ -135,26 +135,20 @@
|
||||||
|
|
||||||
;; Add udev rules for nvidia
|
;; Add udev rules for nvidia
|
||||||
(let ((rulesdir (string-append #$output "/lib/udev/rules.d/"))
|
(let ((rulesdir (string-append #$output "/lib/udev/rules.d/"))
|
||||||
(rules (string-append #$output "/lib/udev/rules.d/90-nvidia.rules"))
|
(rules (string-append #$output "/lib/udev/rules.d/90-nvidia.rules")))
|
||||||
(sh (search-input-file inputs "/bin/sh"))
|
|
||||||
(mknod (search-input-file inputs "/bin/mknod"))
|
|
||||||
(cut (search-input-file inputs "/bin/cut"))
|
|
||||||
(grep (search-input-file inputs "/bin/grep")))
|
|
||||||
(mkdir-p rulesdir)
|
(mkdir-p rulesdir)
|
||||||
(call-with-output-file rules
|
(call-with-output-file rules
|
||||||
(lambda (port)
|
(lambda (port)
|
||||||
(put-string port
|
(put-string port (format #f "~
|
||||||
(string-append
|
KERNEL==\"nvidia\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidiactl c $$(@grep@ nvidia-frontend /proc/devices | @cut@ -d \\ -f 1) 255'\"
|
||||||
"KERNEL==\"nvidia\", "
|
KERNEL==\"nvidia_modeset\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidia-modeset c $$(@grep@ nvidia-frontend /proc/devices | @cut@ -d \\ -f 1) 254'\"
|
||||||
"RUN+=\"" sh " -c '" mknod " -m 666 /dev/nvidiactl c $$(" grep " nvidia-frontend /proc/devices | " cut " -d \\ -f 1) 255'\"" "\n"
|
KERNEL==\"card*\", SUBSYSTEM==\"drm\", DRIVERS==\"nvidia\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidia0 c $$(@grep@ nvidia-frontend /proc/devices | @cut@ -d \\ -f 1) 0'\"
|
||||||
"KERNEL==\"nvidia_modeset\", "
|
KERNEL==\"nvidia_uvm\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidia-uvm c $$(@grep@ nvidia-uvm /proc/devices | @cut@ -d \\ -f 1) 0'\"
|
||||||
"RUN+=\"" sh " -c '" mknod " -m 666 /dev/nvidia-modeset c $$(" grep " nvidia-frontend /proc/devices | " cut " -d \\ -f 1) 254'\"" "\n"
|
KERNEL==\"nvidia_uvm\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidia-uvm-tools c $$(@grep@ nvidia-uvm /proc/devices | @cut@ -d \\ -f 1) 0'\"
|
||||||
"KERNEL==\"card*\", SUBSYSTEM==\"drm\", DRIVERS==\"nvidia\", "
|
"))))
|
||||||
"RUN+=\"" sh " -c '" mknod " -m 666 /dev/nvidia0 c $$(" grep " nvidia-frontend /proc/devices | " cut " -d \\ -f 1) 0'\"" "\n"
|
(substitute* rules
|
||||||
"KERNEL==\"nvidia_uvm\", "
|
(("@\\<(sh|grep|mknod|cut)\\>@" all cmd)
|
||||||
"RUN+=\"" sh " -c '" mknod " -m 666 /dev/nvidia-uvm c $$(" grep " nvidia-uvm /proc/devices | " cut " -d \\ -f 1) 0'\"" "\n"
|
(search-input-file inputs (string-append "/bin/" cmd)))))
|
||||||
"KERNEL==\"nvidia_uvm\", "
|
|
||||||
"RUN+=\"" sh " -c '" mknod " -m 666 /dev/nvidia-uvm-tools c $$(" grep " nvidia-uvm /proc/devices | " cut " -d \\ -f 1) 0'\"" "\n" )))))
|
|
||||||
|
|
||||||
;; ------------------------------
|
;; ------------------------------
|
||||||
;; Add a file to load nvidia drivers
|
;; Add a file to load nvidia drivers
|
||||||
|
|
Loading…
Reference in a new issue