From: Jan Palus Date: Sun, 31 Mar 2019 12:01:12 +0000 (+0200) Subject: patch to load configs from depmod.d/ X-Git-Tag: auto/th/kmod-26-2 X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=601b1eecd5ea50cf9e0c398c4b932fcf0ff95fc9;p=packages%2Fkmod.git patch to load configs from depmod.d/ mimic same behavior as for modprobe.d --- diff --git a/kmod-depmod.d-kver.patch b/kmod-depmod.d-kver.patch new file mode 100644 index 0000000..1b25599 --- /dev/null +++ b/kmod-depmod.d-kver.patch @@ -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]); diff --git a/kmod.spec b/kmod.spec index 97ae95e..d6bb020 100644 --- 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}