mirror of
https://https.git.savannah.gnu.org/git/guix.git/
synced 2025-07-14 02:50:45 +02:00
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:
parent
8e61e3baf6
commit
614ba97d98
4 changed files with 25 additions and 5 deletions
|
@ -1674,6 +1674,7 @@ dist_patch_DATA = \
|
||||||
%D%/packages/patches/librewolf-neuter-locale-download.patch \
|
%D%/packages/patches/librewolf-neuter-locale-download.patch \
|
||||||
%D%/packages/patches/librewolf-use-system-wide-dir.patch \
|
%D%/packages/patches/librewolf-use-system-wide-dir.patch \
|
||||||
%D%/packages/patches/libvirt-add-install-prefix.patch \
|
%D%/packages/patches/libvirt-add-install-prefix.patch \
|
||||||
|
%D%/packages/patches/libvirt-respect-modules-path.patch \
|
||||||
%D%/packages/patches/libziparchive-add-includes.patch \
|
%D%/packages/patches/libziparchive-add-includes.patch \
|
||||||
%D%/packages/patches/lightdm-arguments-ordering.patch \
|
%D%/packages/patches/lightdm-arguments-ordering.patch \
|
||||||
%D%/packages/patches/lightdm-vnc-ipv6.patch \
|
%D%/packages/patches/lightdm-vnc-ipv6.patch \
|
||||||
|
|
15
gnu/packages/patches/libvirt-respect-modules-path.patch
Normal file
15
gnu/packages/patches/libvirt-respect-modules-path.patch
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
Honor the LINUX_MODULE_DIRECTORY environment variable.
|
||||||
|
|
||||||
|
Upstream-status: N/A
|
||||||
|
|
||||||
|
--- a/src/util/virpci.c
|
||||||
|
+++ b/src/util/virpci.c
|
||||||
|
@@ -1459,6 +1459,7 @@ virPCIDeviceFindBestVFIOVariant(virPCIDevice *dev,
|
||||||
|
}
|
||||||
|
|
||||||
|
uname(&unameInfo);
|
||||||
|
- modulesAliasPath = g_strdup_printf("/lib/modules/%s/modules.alias", unameInfo.release);
|
||||||
|
+ char* modulepath = getenv("LINUX_MODULE_DIRECTORY");
|
||||||
|
+ modulesAliasPath = g_strdup_printf("%s/%s/modules.alias", modulepath ? modulepath : "/lib/modules", unameInfo.release);
|
||||||
|
if (virFileReadAll(modulesAliasPath, 8 * 1024 * 1024, &modulesAliasContent) < 0)
|
||||||
|
return -1;
|
|
@ -1562,7 +1562,8 @@ pretty simple, REST API.")
|
||||||
version ".tar.xz"))
|
version ".tar.xz"))
|
||||||
(sha256
|
(sha256
|
||||||
(base32 "15jpfrn3d2zyhbm5ip7bmpjb6ch2bfxm1h6yfgh0l3bw3g9ppgg1"))
|
(base32 "15jpfrn3d2zyhbm5ip7bmpjb6ch2bfxm1h6yfgh0l3bw3g9ppgg1"))
|
||||||
(patches (search-patches "libvirt-add-install-prefix.patch"))))
|
(patches (search-patches "libvirt-add-install-prefix.patch"
|
||||||
|
"libvirt-respect-modules-path.patch"))))
|
||||||
(build-system meson-build-system)
|
(build-system meson-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
(list
|
(list
|
||||||
|
|
|
@ -508,11 +508,14 @@ potential infinite waits blocking libvirt."))
|
||||||
(list (string-append #$libvirt "/sbin/libvirtd")
|
(list (string-append #$libvirt "/sbin/libvirtd")
|
||||||
"-f" #$config-file
|
"-f" #$config-file
|
||||||
#$@(if listen-tcp? '("--listen") '()))
|
#$@(if listen-tcp? '("--listen") '()))
|
||||||
;; For finding qemu and ip binaries.
|
;; For finding qemu, ip binaries and kernel modules.
|
||||||
#:environment-variables
|
#:environment-variables
|
||||||
(list (string-append
|
(list
|
||||||
"PATH=/run/current-system/profile/bin:"
|
(string-append
|
||||||
"/run/current-system/profile/sbin"))))
|
"PATH=/run/current-system/profile/bin:"
|
||||||
|
"/run/current-system/profile/sbin")
|
||||||
|
"LINUX_MODULE_DIRECTORY="
|
||||||
|
"/run/booted-system/kernel/lib/modules")))
|
||||||
(stop #~(make-kill-destructor))))))
|
(stop #~(make-kill-destructor))))))
|
||||||
|
|
||||||
(define libvirt-service-type
|
(define libvirt-service-type
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue