gnu: libvirt: Fix path to Linux modules.

* gnu/packages/virtualization.scm (libvirt): Use LINUX_MODULE_DIRECTORY to
find modules.
[source]: Add libvirt-respect-modules-path.patch.
* gnu/packages/patches/libvirt-respect-modules-path.patch: New file.
* gnu/local.mk: Register new file.
* gnu/services/virtualization.scm (libvirt-shepherd-service)
<#:environment-variables>: Pass LINUX_MODULE_DIRECTORY.

Change-Id: Idde5b59df3c1641fcbab376e6c694730769294d3
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
nathan 2025-03-13 20:36:27 -04:00 committed by Maxim Cournoyer
parent 8e61e3baf6
commit 614ba97d98
No known key found for this signature in database
GPG key ID: 1260E46482E63562
4 changed files with 25 additions and 5 deletions

View file

@ -508,11 +508,14 @@ potential infinite waits blocking libvirt."))
(list (string-append #$libvirt "/sbin/libvirtd")
"-f" #$config-file
#$@(if listen-tcp? '("--listen") '()))
;; For finding qemu and ip binaries.
;; For finding qemu, ip binaries and kernel modules.
#:environment-variables
(list (string-append
"PATH=/run/current-system/profile/bin:"
"/run/current-system/profile/sbin"))))
(list
(string-append
"PATH=/run/current-system/profile/bin:"
"/run/current-system/profile/sbin")
"LINUX_MODULE_DIRECTORY="
"/run/booted-system/kernel/lib/modules")))
(stop #~(make-kill-destructor))))))
(define libvirt-service-type