aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/module-init-tools-moduledir.patch
blob: 08f03d1cc4c8cc9e7ba6726bc2ae3f9c0abfea66 (about) (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
This patch changes 'modprobe' & co. so they honor the 'LINUX_MODULE_DIRECTORY'
environment variable, rather than looking for modules exclusively in
/lib/modules.

Original patch by David Guibert, from Nixpkgs; adjusted to use
'LINUX_MODULE_DIRECTORY' rather than 'MODULE_DIR' as the variable name.

diff --git a/depmod.c b/depmod.c
index a1d2f8c..ff579c7 100644
--- a/depmod.c
+++ b/depmod.c
@@ -48,9 +48,6 @@
 
 #include "testing.h"
 
-#ifndef MODULE_DIR
-#define MODULE_DIR "/lib/modules/"
-#endif
 
 #ifndef MODULE_BUILTIN_KEY
 #define MODULE_BUILTIN_KEY "built-in"
@@ -1516,6 +1513,7 @@ static int parse_config_file(const char *filename,
 	char *line;
 	unsigned int linenum = 0;
 	FILE *cfile;
+ 	char *module_dir;
 
 	cfile = fopen(filename, "r");
 	if (!cfile) {
@@ -1525,6 +1523,10 @@ static int parse_config_file(const char *filename,
 		return 0;
 	}
 
+        if((module_dir = getenv("LINUX_MODULE_DIRECTORY")) == NULL) {
+                module_dir = "/lib/modules";
+        }
+
 	while ((line = getline_wrapped(cfile, &linenum)) != NULL) {
 		char *ptr = line;
 		char *cmd, *modname;
@@ -1549,8 +1551,8 @@ static int parse_config_file(const char *filename,
 							     0, *search);
 					continue;
 				}
-				nofail_asprintf(&dirname, "%s%s%s/%s", basedir,
-					MODULE_DIR, kernelversion, search_path);
+				nofail_asprintf(&dirname, "%s%s/%s/%s", basedir,
+					module_dir, kernelversion, search_path);
 				len = strlen(dirname);
 				*search = add_search(dirname, len, *search);
 				free(dirname);
@@ -1564,8 +1566,8 @@ static int parse_config_file(const char *filename,
 			if (!regex_match(kernelversion, (const char *)version))
 				continue;
 
-			nofail_asprintf(&pathname, "%s%s%s/%s/%s.ko", basedir,
-				MODULE_DIR, kernelversion, subdir, modname);
+			nofail_asprintf(&pathname, "%s%s/%s/%s/%s.ko", basedir,
+				module_dir, kernelversion, subdir, modname);
 
 			*overrides = add_override(pathname, *overrides);
 			free(pathname);
@@ -1737,6 +1739,7 @@ int main(int argc, char *argv[])
 	char *basedir = "", *dirname, *version;
 	char *system_map = NULL, *module_symvers = NULL;
 	int i;
+ 	char *module_dir;
 	const char *config = NULL;
 
 	if (native_endianness() == 0)
@@ -1832,7 +1835,11 @@ int main(int argc, char *argv[])
 	if (optind == argc)
 		all = 1;
 
-	nofail_asprintf(&dirname, "%s%s%s", basedir, MODULE_DIR, version);
+        if((module_dir = getenv("LINUX_MODULE_DIRECTORY")) == NULL) {
+                module_dir = "/lib/modules";
+        }
+
+	nofail_asprintf(&dirname, "%s%s/%s", basedir, module_dir, version);
 
 	if (maybe_all) {
 		if (!doing_stdout && !depfile_out_of_date(dirname))
@@ -1849,8 +1856,8 @@ int main(int argc, char *argv[])
 		char *dirname;
 		size_t len;
 
-		nofail_asprintf(&dirname, "%s%s%s/updates", basedir,
-				MODULE_DIR, version);
+		nofail_asprintf(&dirname, "%s%s/%s/updates", basedir,
+				module_dir, version);
 		len = strlen(dirname);
 		search = add_search(dirname, len, search);
 	}
diff --git a/modinfo.c b/modinfo.c
index 1dd8469..6a1865b 100644
--- a/modinfo.c
+++ b/modinfo.c
@@ -19,9 +19,6 @@
 #include "zlibsupport.h"
 #include "testing.h"
 
-#ifndef MODULE_DIR
-#define MODULE_DIR "/lib/modules"
-#endif
 
 struct param
 {
@@ -193,6 +190,11 @@ static struct elf_file *grab_module(const char *name,
 	struct utsname buf;
 	char *depname, *p, *moddir;
 	struct elf_file *module;
+ 	char *module_dir;
+
+        if((module_dir = getenv("LINUX_MODULE_DIRECTORY")) == NULL) {
+                module_dir = "/lib/modules";
+        }
 
 	if (strchr(name, '.') || strchr(name, '/')) {
 		module = grab_elf_file(name);
@@ -207,9 +209,9 @@ static struct elf_file *grab_module(const char *name,
 		kernel = buf.release;
 	}
 	if (strlen(basedir))
-		nofail_asprintf(&moddir, "%s/%s/%s", basedir, MODULE_DIR, kernel);
+		nofail_asprintf(&moddir, "%s/%s/%s", basedir, module_dir, kernel);
 	else
-		nofail_asprintf(&moddir, "%s/%s", MODULE_DIR, kernel);
+		nofail_asprintf(&moddir, "%s/%s", module_dir, kernel);
 
 	/* Search for it in modules.dep. */
 	nofail_asprintf(&depname, "%s/%s", moddir, "modules.dep");
diff --git a/modprobe.c b/modprobe.c
index 5464f45..cb57917 100644
--- a/modprobe.c
+++ b/modprobe.c
@@ -86,10 +86,6 @@ typedef enum
 
 } modprobe_flags_t;
 
-#ifndef MODULE_DIR
-#define MODULE_DIR "/lib/modules"
-#endif
-
 /**
  * print_usage - output the prefered program usage
  *
@@ -2136,6 +2132,7 @@ int main(int argc, char *argv[])
 	struct modprobe_conf conf = {};
 
 	recursion_depth = 0;
+ 	char *module_dir = NULL;
 
 	/* Prepend options from environment. */
 	argv = merge_args(getenv("MODPROBE_OPTIONS"), argv, &argc);
@@ -2233,7 +2230,11 @@ int main(int argc, char *argv[])
 	if (argc < optind + 1 && !dump_config && !list_only)
 		print_usage(argv[0]);
 
-	nofail_asprintf(&dirname, "%s%s/%s", basedir, MODULE_DIR, buf.release);
+	if((module_dir = getenv("LINUX_MODULE_DIRECTORY")) == NULL) {
+		module_dir = "/lib/modules";
+	}
+
+	nofail_asprintf(&dirname, "%s%s/%s", basedir, module_dir, buf.release);
 
 	/* Old-style -t xxx wildcard?  Only with -l. */
 	if (list_only) {
ty-token.scm, gnu/packages/selinux.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/shellutils.scm, gnu/packages/simh.scm, gnu/packages/sml.scm, gnu/packages/ssh.scm, gnu/packages/statistics.scm, gnu/packages/stenography.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/synergy.scm, gnu/packages/telephony.scm, gnu/packages/terminals.scm, gnu/packages/tex.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tmux.scm, gnu/packages/tor.scm, gnu/packages/toys.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/virtualization.scm, gnu/packages/vlang.scm, gnu/packages/vnc.scm, gnu/packages/vpn.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm, gnu/packages/wireservice.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, tests/lint.scm: Remove trailing ".git" from 'git-reference' URL. Ludovic Courtès 2020-07-05gnu: python-llvmlite: Use specific commit for llvm patch URLs....As this commit [1] appears to affect the patches, including the v0.30.0 tag (so the tag must have been changed). 1: https://github.com/numba/llvmlite/commit/cdd99deb32f9d48aadb0f7407fb8ad06f6a8ce6c * gnu/packages/llvm.scm (python-llvmlite)[inputs]: Use a specific commit for the patches. Christopher Baines 2020-07-03gnu: Add lld....* gnu/packages/llvm.scm (lld): New variable. Jakub Kądziołka 2020-07-03gnu: llvm-9: Backport patch to fix miscompilation for big-endian targets....* gnu/packages/llvm.scm (llvm-9)[source]: Add new patch. * gnu/packages/patches/llvm-9-fix-bitcast-miscompilation.patch: New file. * gnu/local.mk (dist_patch_DATA): Register new file. Jakub Kądziołka 2020-07-03gnu: llvm-9: Backport patches to fix miscompilations....* gnu/packages/llvm.scm (llvm-9)[source]: Add new patches. * gnu/packages/patches/llvm-9-fix-lpad-miscompilation.patch, gnu/packages/patches/llvm-9-fix-scev-miscompilation.patch: New files. * gnu/local.mk (dist_patch_DATA): Register new patches. Jakub Kądziołka 2020-05-28gnu: clang: Build 'clang-tools-extra'....* gnu/packages/llvm.scm (clang-from-llvm): Add #:tools-extra. Add 'output' field. In 'inputs', add TOOLS-EXTRA when it's given. In 'arguments', add 'add-tools-extra' and 'move-extra-tools' phases when TOOLS-EXTRA is given. Ludovic Courtès 2020-05-22gnu: llvm: Remove unused 'package-elisp-from-package' procedure....This private procedure had been unused since 3a3d4d9d545028cda846ae827a60249f7162d34e. * gnu/packages/llvm.scm (package-elisp-from-package): Remove. Ludovic Courtès 2020-05-02Merge branch 'master' into core-updatesMarius Bakke 2020-05-02gnu: llvm-for-extempore: Update to 3.8....* gnu/packages/llvm.scm (llvm-for-extempore): Update to 3.8. [source]: Use upstream patched source. * gnu/packages/patches/llvm-for-extempore.patch: Delete due to source being already patched. * gnu/local.mk (dist_patch_DATA): Remove it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Giacomo Leidi 2020-04-24Merge branch 'master' into core-updatesMarius Bakke 2020-04-24gnu: llvm: Add 10.0.0....* gnu/packages/llvm.scm (llvm-10, clang-runtime-10, clang-10) (clang-toolchain-10, llvm-9, clang-runtime-9, clang-9) (clang-toolchain-9): New variables. (llvm, clang, clang-runtime, clang-toolchain): Redefine as aliases to the '-9' bindings. * gnu/packages/patches/clang-10.0-libc-search-path.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Ludovic Courtès 2020-04-13Merge branch 'master' into core-updatesMarius Bakke 2020-04-12gnu: emacs-clang-format: Fix grammar of "allows to filter" to "filters"....* gnu/packages/llvm (emacs-clang-format): Fix grammar. Vagrant Cascadian ages/qt.scm, gnu/packages/radio.scm, gnu/packages/rails.scm, gnu/packages/rdf.scm, gnu/packages/rednotebook.scm, gnu/packages/rpc.scm, gnu/packages/rsync.scm, gnu/packages/ruby.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/screen.scm, gnu/packages/security-token.scm, gnu/packages/selinux.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/shellutils.scm, gnu/packages/simh.scm, gnu/packages/sml.scm, gnu/packages/ssh.scm, gnu/packages/statistics.scm, gnu/packages/stenography.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/synergy.scm, gnu/packages/telephony.scm, gnu/packages/terminals.scm, gnu/packages/tex.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tmux.scm, gnu/packages/tor.scm, gnu/packages/toys.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/virtualization.scm, gnu/packages/vlang.scm, gnu/packages/vnc.scm, gnu/packages/vpn.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm, gnu/packages/wireservice.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, tests/lint.scm: Remove trailing ".git" from 'git-reference' URL. Ludovic Courtès 2020-06-30gnu: umoci: Update to 0.4.6....* gnu/packages/virtualization.scm (umoci): Update to 0.4.6. [source, arguments]: Update import path. Tobias Geerinckx-Rice 2020-06-03gnu: osinfo-db: Update to 20200529....* gnu/packages/virtualization.scm (osinfo-db): Update to 20200529. Tobias Geerinckx-Rice 2020-06-03gnu: osinfo-db-tools: Update to 1.8.0....* gnu/packages/virtualization.scm (osinfo-db-tools): Update to 1.8.0. Tobias Geerinckx-Rice 2020-05-26gnu: virt-manager: Work towards enabling some tests....* gnu/packages/virtualization.scm (virt-manager)[arguments]: Set #:test-target to "test_ui", replace the 'check phase. [native-inputs]: Add some inputs required for running tests. Christopher Baines 2020-05-22packages: Introduce <content-hash> and use it in <origin>....* guix/packages.scm (<content-hash>): New record type. (define-content-hash-constructor, build-content-hash) (content-hash): New macros. (print-content-hash): New procedure. (<origin>): Rename constructor to '%origin'. [sha256]: Remove field. [hash]: New field. Adjust users. (origin-compatibility-helper, origin): New macros. (origin-sha256): New deprecated procedure. (origin->derivation): Adjust accordingly. * tests/packages.scm ("package-source-derivation, origin, sha512"): New test. * guix/tests.scm: Hide (gcrypt hash) 'sha256' for proper syntax matching. * tests/challenge.scm: Add #:prefix for (gcrypt hash) and adjust users. * tests/derivations.scm: Likewise. * tests/store.scm: Likewise. * tests/graph.scm ("bag DAG, including origins"): Provide 'sha256' field with the right length. * gnu/packages/aspell.scm (aspell-dictionary) (aspell-dict-ca, aspell-dict-it): Use 'hash' and 'content-hash' for proper syntax matching. * gnu/packages/bash.scm (bash-patch): Rename 'sha256' to 'sha256-bv'. * gnu/packages/bootstrap.scm (bootstrap-executable): Rename 'sha256' to 'bv'. * gnu/packages/readline.scm (readline-patch): Likewise. * gnu/packages/virtualization.scm (qemu-patch): Rename 'sha256' to 'sha256-bv'. * guix/import/utils.scm: Hide (gcrypt hash) 'sha256'. Ludovic Courtès 2020-05-21gnu: criu: Download sources over HTTPS....* gnu/packages/virtualization.scm (criu)[source]: Use HTTPS. Tobias Geerinckx-Rice 2020-05-21gnu: criu: Update to 3.14....* gnu/packages/virtualization.scm (criu): Update to 3.14. Tobias Geerinckx-Rice 2020-05-17gnu: qemu-minimal: Use 'match' to find architecture....* gnu/packages/virtualization.scm (qemu-minimal)[arguments]: Use 'match' to target the correct architecture. Efraim Flashner 2020-05-14gnu: qemu-minimal: Only build for the host's architecture....* gnu/packages/virtualization.scm (qemu-minimal)[arguments]: Adjust configure-flags so that each architecture only builds for its native architectures. [synopsis]: Adjust to clarify it's only for the host's architecture. Efraim Flashner 2020-05-08gnu: QEMU: Update to 5.0.0....* gnu/packages/patches/qemu-CVE-2020-1711.patch, gnu/packages/patches/qemu-CVE-2020-7039.patch, gnu/packages/patches/qemu-CVE-2020-7211.patch, gnu/packages/patches/qemu-CVE-2020-8608.patch, gnu/packages/patches/qemu-fix-documentation-build-failure.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/virtualization.scm (qemu)[source](patches): Remove. [arguments]: Add phase 'patch-/bin/sh-references'. In the 'configure' phase, add shebang substitutions. Remove phase 'prevent-network-configuration'. [inputs]: Change from LIBCAP to LIBCAP-NG. Marius Bakke 2020-05-05Merge branch 'master' into core-updatesMarius Bakke 2020-05-03gnu: qemu-minimal: Don't include libcacard as an input....This probably isn't useful for QEMU without GUI support. * gnu/package/virtualization.scm (qemu-minimal)[inputs]: Don't include libcacard. Christopher Baines 2020-05-03gnu: qemu: Add libcacard as an input to enable smartcard support....This fixes an error in gnome-boxes when starting virtual machines: Unable to start domain: unsupported configuration: this QEMU binary lacks smartcard passthrough mode support * gnu/packages/virtualization.scm (qemu)[inputs]: Add libcacard. Christopher Baines 2020-04-15Merge branch 'master' into core-updatesMarius Bakke 2020-04-15Merge branch 'version-1.1.0'Ludovic Courtès 2020-04-14gnu: xen: Update to 4.13.0....* gnu/packages/virtualization.scm (xen): Update to 4.13.0. Danny Milosavljevic 2020-04-14gnu: xen: Fix build failure....* gnu/packages/virtualization.scm (xen)[arguments]<#:phases>[set-environment-up]: Use CPATH instead of C_INCLUDE_PATH, CPLUS_INCLUDE_PATH. Danny Milosavljevic 2020-04-11Merge branch 'master' into core-updatesMarius Bakke 2020-04-11gnu: bubblewrap: Update to 0.4.1 [fixes CVE-2020-5291]....Relevant only ‘[i]f bubblewrap is installed in setuid mode and the kernel supports unprivileged user namespaces’. Bubblewrap is not setuid by default on Guix System. * gnu/packages/virtualization.scm (bubblewrap): Update to 0.4.1. Tobias Geerinckx-Rice 2020-04-09gnu: qemu: Skip tests on i686-linux....* gnu/packages/virtualization.scm (qemu)[arguments]: Add #:tests?. Ludovic Courtès