nixpkgs/pkgs/tools/misc/ddcutil/nixos-paths.diff
2021-04-02 22:52:36 +02:00

33 lines
1.3 KiB
Diff

diff --git a/src/app_sysenv/query_sysenv_modules.c b/src/app_sysenv/query_sysenv_modules.c
index 59df64f1..fb244dd0 100644
--- a/src/app_sysenv/query_sysenv_modules.c
+++ b/src/app_sysenv/query_sysenv_modules.c
@@ -50,7 +50,9 @@ bool is_module_loadable(char * module_name, int depth) {
g_snprintf(module_name_ko, 100, "%s.ko", module_name);
char dirname[PATH_MAX];
- g_snprintf(dirname, PATH_MAX, "/lib/modules/%s/kernel/drivers/i2c", utsbuf.release);
+ g_snprintf(dirname, PATH_MAX,
+ "/run/booted-system/kernel-modules/lib/modules/%s/kernel/drivers/i2c",
+ utsbuf.release);
struct dirent *dent;
DIR *d;
diff --git a/src/util/linux_util.c b/src/util/linux_util.c
index 5eb8491c..3a129ccf 100644
--- a/src/util/linux_util.c
+++ b/src/util/linux_util.c
@@ -29,8 +29,10 @@ bool is_module_builtin(char * module_name)
int rc = uname(&utsbuf);
assert(rc == 0);
- char modules_builtin_fn[100];
- snprintf(modules_builtin_fn, 100, "/lib/modules/%s/modules.builtin", utsbuf.release);
+ char modules_builtin_fn[PATH_MAX];
+ snprintf(modules_builtin_fn, PATH_MAX,
+ "/run/booted-system/kernel-modules/lib/modules/%s/modules.builtin",
+ utsbuf.release);
char ko_name[40];
snprintf(ko_name, 40, "%s.ko", module_name);