]> git.pld-linux.org Git - packages/kmod.git/blob - kmod-depmod.d-kver.patch
- up to 32; python modules removed upstream
[packages/kmod.git] / kmod-depmod.d-kver.patch
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
3 @@ -50,7 +50,9 @@
4  
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[] = {
9 +       kver_config_path,
10         SYSCONFDIR "/depmod.d",
11         "/run/depmod.d",
12         "/usr/local/lib/depmod.d",
13 @@ -815,8 +817,16 @@
14         size_t i, n_files = 0;
15         struct cfg_file **files = NULL;
16  
17 -       if (cfg_paths == NULL)
18 -               cfg_paths = default_cfg_paths;
19 +       if (cfg_paths == NULL) {
20 +               struct utsname u;
21 +
22 +               if (uname(&u) < 0) {
23 +                       cfg_paths = &default_cfg_paths[1];
24 +               } else {
25 +                       snprintf(kver_config_path, PATH_MAX, SYSCONFDIR "/depmod.d/%s", u.release);
26 +                       cfg_paths = default_cfg_paths;
27 +               }
28 +       }
29  
30         for (i = 0; cfg_paths[i] != NULL; i++)
31                 cfg_files_list(&files, &n_files, cfg_paths[i]);
This page took 0.114598 seconds and 3 git commands to generate.