1 --- kmod-26/tools/depmod.c.orig 2019-03-31 13:50:56.277614760 +0200
2 +++ kmod-26/tools/depmod.c 2019-03-31 13:53:23.093456646 +0200
5 static const char CFG_BUILTIN_KEY[] = "built-in";
6 static const char CFG_EXTERNAL_KEY[] = "external";
7 +static char kver_config_path[PATH_MAX] = SYSCONFDIR "/depmod.d/X.Y.Z";
8 static const char *default_cfg_paths[] = {
10 SYSCONFDIR "/depmod.d",
12 "/usr/local/lib/depmod.d",
14 size_t i, n_files = 0;
15 struct cfg_file **files = NULL;
17 - if (cfg_paths == NULL)
18 - cfg_paths = default_cfg_paths;
19 + if (cfg_paths == NULL) {
22 + if (uname(&u) < 0) {
23 + cfg_paths = &default_cfg_paths[1];
25 + snprintf(kver_config_path, PATH_MAX, SYSCONFDIR "/depmod.d/%s", u.release);
26 + cfg_paths = default_cfg_paths;
30 for (i = 0; cfg_paths[i] != NULL; i++)
31 cfg_files_list(&files, &n_files, cfg_paths[i]);