]> git.pld-linux.org Git - packages/kmod.git/commitdiff
patch to load configs from depmod.d/<kernel version> auto/th/kmod-26-2
authorJan Palus <atler@pld-linux.org>
Sun, 31 Mar 2019 12:01:12 +0000 (14:01 +0200)
committerJan Palus <atler@pld-linux.org>
Sun, 31 Mar 2019 12:01:12 +0000 (14:01 +0200)
mimic same behavior as for modprobe.d

kmod-depmod.d-kver.patch [new file with mode: 0644]
kmod.spec

diff --git a/kmod-depmod.d-kver.patch b/kmod-depmod.d-kver.patch
new file mode 100644 (file)
index 0000000..1b25599
--- /dev/null
@@ -0,0 +1,31 @@
+--- kmod-26/tools/depmod.c.orig        2019-03-31 13:50:56.277614760 +0200
++++ kmod-26/tools/depmod.c     2019-03-31 13:53:23.093456646 +0200
+@@ -50,7 +50,9 @@
+ static const char CFG_BUILTIN_KEY[] = "built-in";
+ static const char CFG_EXTERNAL_KEY[] = "external";
++static char kver_config_path[PATH_MAX] = SYSCONFDIR "/depmod.d/X.Y.Z";
+ static const char *default_cfg_paths[] = {
++      kver_config_path,
+       "/run/depmod.d",
+       SYSCONFDIR "/depmod.d",
+       "/lib/depmod.d",
+@@ -815,8 +817,16 @@
+       size_t i, n_files = 0;
+       struct cfg_file **files = NULL;
+-      if (cfg_paths == NULL)
+-              cfg_paths = default_cfg_paths;
++      if (cfg_paths == NULL) {
++              struct utsname u;
++
++              if (uname(&u) < 0) {
++                      cfg_paths = &default_cfg_paths[1];
++              } else {
++                      snprintf(kver_config_path, PATH_MAX, SYSCONFDIR "/depmod.d/%s", u.release);
++                      cfg_paths = default_cfg_paths;
++              }
++      }
+       for (i = 0; cfg_paths[i] != NULL; i++)
+               cfg_files_list(&files, &n_files, cfg_paths[i]);
index 97ae95e172112005fd93e2ccd85a7dffe11ade76..d6bb02049d8e8f5406ad5d2bb5cc2bb26d465f8e 100644 (file)
--- a/kmod.spec
+++ b/kmod.spec
@@ -21,6 +21,7 @@ Source0:      https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.t
 Source1:       %{name}-blacklist
 Source2:       %{name}-usb
 Patch0:                %{name}-modprobe.d-kver.patch
+Patch1:                %{name}-depmod.d-kver.patch
 URL:           https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git
 BuildRequires: autoconf >= 2.64
 BuildRequires: automake >= 1:1.11
@@ -141,6 +142,7 @@ Wiązania Pythona 3 do API kmod.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %{__libtoolize}
This page took 0.120686 seconds and 4 git commands to generate.