From patchwork Tue Jan 19 14:52:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas De Marchi X-Patchwork-Id: 12030459 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 334B3C10F12 for ; Tue, 19 Jan 2021 18:27:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1049123121 for ; Tue, 19 Jan 2021 18:27:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387906AbhASPFQ (ORCPT ); Tue, 19 Jan 2021 10:05:16 -0500 Received: from mga03.intel.com ([134.134.136.65]:39971 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391697AbhASOzX (ORCPT ); Tue, 19 Jan 2021 09:55:23 -0500 IronPort-SDR: 0YUn7F61nsEQaJoh29Es5yjl3e2Ib339lGQHJ6OFUKVaGRd5GvTkllKpFB95BVnjL9s2MQUyX8 3QIlQaKwGL0A== X-IronPort-AV: E=McAfee;i="6000,8403,9868"; a="179023520" X-IronPort-AV: E=Sophos;i="5.79,359,1602572400"; d="scan'208,217";a="179023520" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2021 06:54:20 -0800 IronPort-SDR: 4Ika1PSKCAtE4RxATFNUHrhnx6BQfG3g9gnjLNZJ/n/cKDTXhe61jAUBspzcAp4ewhns3kznvn w2tgDLZTJVRA== X-IronPort-AV: E=Sophos;i="5.79,359,1602572400"; d="scan'208,217";a="365772519" Received: from caophong-mobl.amr.corp.intel.com (HELO ldmartin-desk1.intel.com) ([10.213.166.105]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2021 06:54:18 -0800 From: Lucas De Marchi To: linux-modules@vger.kernel.org Cc: Jan Tojnar Subject: [PATCH 1/3] libkmod: Fix documentation on config precedence order Date: Tue, 19 Jan 2021 06:52:36 -0800 Message-Id: <20210119145238.12774-1-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Precedence: bulk List-ID: /etc is has higher priority than /run. --- libkmod/libkmod.c | 2 +- man/depmod.d.xml | 2 +- man/modprobe.d.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c index 43423d6..25655b9 100644 --- a/libkmod/libkmod.c +++ b/libkmod/libkmod.c @@ -235,7 +235,7 @@ static char *get_kernel_release(const char *dirname) * @config_paths: ordered array of paths (directories or files) where * to load from user-defined configuration parameters such as * alias, blacklists, commands (install, remove). If - * NULL defaults to /run/modprobe.d, /etc/modprobe.d and + * NULL defaults to /etc/modprobe.d, /run/modprobe.d and * /lib/modprobe.d. Give an empty vector if configuration should * not be read. This array must be null terminated. * diff --git a/man/depmod.d.xml b/man/depmod.d.xml index 4341a56..6472bda 100644 --- a/man/depmod.d.xml +++ b/man/depmod.d.xml @@ -40,8 +40,8 @@ /usr/lib/depmod.d/*.conf - /etc/depmod.d/*.conf /run/depmod.d/*.conf + /etc/depmod.d/*.conf DESCRIPTION diff --git a/man/modprobe.d.xml b/man/modprobe.d.xml index 211af84..a674d69 100644 --- a/man/modprobe.d.xml +++ b/man/modprobe.d.xml @@ -41,8 +41,8 @@ /lib/modprobe.d/*.conf - /etc/modprobe.d/*.conf /run/modprobe.d/*.conf + /etc/modprobe.d/*.conf DESCRIPTION From patchwork Tue Jan 19 14:52:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas De Marchi X-Patchwork-Id: 12030069 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73C76C433DB for ; Tue, 19 Jan 2021 15:05:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 487A92250E for ; Tue, 19 Jan 2021 15:05:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731601AbhASPFK (ORCPT ); Tue, 19 Jan 2021 10:05:10 -0500 Received: from mga03.intel.com ([134.134.136.65]:39977 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391698AbhASOzW (ORCPT ); Tue, 19 Jan 2021 09:55:22 -0500 IronPort-SDR: RQKG49JKx8KoFCSYy3gdxpF4tHKUMRsG1Yytqig/q7+l3G9wtIxCq6kWTJ2krX43Wq4B3YZGk4 4H3H4h59NVxg== X-IronPort-AV: E=McAfee;i="6000,8403,9868"; a="179023528" X-IronPort-AV: E=Sophos;i="5.79,359,1602572400"; d="scan'208";a="179023528" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2021 06:54:22 -0800 IronPort-SDR: UtpXDQyd1UOken36U0p2DC4oN9/enEi/3X13A/k/Cqy2/N9bv0LULtDbqMu8pnAlR6MBJbzaVH B/urSehjc58g== X-IronPort-AV: E=Sophos;i="5.79,359,1602572400"; d="scan'208";a="365772525" Received: from caophong-mobl.amr.corp.intel.com (HELO ldmartin-desk1.intel.com) ([10.213.166.105]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2021 06:54:20 -0800 From: Lucas De Marchi To: linux-modules@vger.kernel.org Cc: Jan Tojnar Subject: [PATCH 2/3] depmod: fix precedence order Date: Tue, 19 Jan 2021 06:52:37 -0800 Message-Id: <20210119145238.12774-2-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210119145238.12774-1-lucas.demarchi@intel.com> References: <20210119145238.12774-1-lucas.demarchi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: Configuration in /etc should have higher prio than /run. Given how rarely configuration in /run is used with depmod, this is likely not to cause any problems, even if it's a change in behavior. --- tools/depmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/depmod.c b/tools/depmod.c index 3f31cdf..8e1d9ec 100644 --- a/tools/depmod.c +++ b/tools/depmod.c @@ -51,8 +51,8 @@ static int verbose = DEFAULT_VERBOSE; static const char CFG_BUILTIN_KEY[] = "built-in"; static const char CFG_EXTERNAL_KEY[] = "external"; static const char *default_cfg_paths[] = { - "/run/depmod.d", SYSCONFDIR "/depmod.d", + "/run/depmod.d", "/lib/depmod.d", NULL }; From patchwork Tue Jan 19 14:52:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas De Marchi X-Patchwork-Id: 12030073 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C780C433E0 for ; Tue, 19 Jan 2021 15:07:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 12B11207C4 for ; Tue, 19 Jan 2021 15:07:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387715AbhASPFO (ORCPT ); Tue, 19 Jan 2021 10:05:14 -0500 Received: from mga03.intel.com ([134.134.136.65]:39972 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391709AbhASOzX (ORCPT ); Tue, 19 Jan 2021 09:55:23 -0500 IronPort-SDR: i9kCwhN0zenE5DbnjvweKdm2+hNtqd1SDKm+SD2VK/j+nemmJoXC4Ni8snqLe19Jlzalmc8qm9 DJ8+mqe4T4iw== X-IronPort-AV: E=McAfee;i="6000,8403,9868"; a="179023532" X-IronPort-AV: E=Sophos;i="5.79,359,1602572400"; d="scan'208";a="179023532" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2021 06:54:24 -0800 IronPort-SDR: 4Dk6ziHeO+IFmpd30IgqkjBmInIf/zK9Jm1c5bDaZhJ10DCpXtNwEPwdNf9EYYV08RXQh4X1UE R7E3iqUHE2NA== X-IronPort-AV: E=Sophos;i="5.79,359,1602572400"; d="scan'208";a="365772532" Received: from caophong-mobl.amr.corp.intel.com (HELO ldmartin-desk1.intel.com) ([10.213.166.105]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2021 06:54:22 -0800 From: Lucas De Marchi To: linux-modules@vger.kernel.org Cc: Jan Tojnar Subject: [PATCH 3/3] Support /usr/local for configuration files Date: Tue, 19 Jan 2021 06:52:38 -0800 Message-Id: <20210119145238.12774-3-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210119145238.12774-1-lucas.demarchi@intel.com> References: <20210119145238.12774-1-lucas.demarchi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: Add /usr/local to the search path for configuration files. These are intended for local installs, provided /usr/local is given as prefix. --- libkmod/libkmod.c | 10 ++++++---- man/depmod.d.xml | 1 + man/modprobe.d.xml | 1 + tools/depmod.c | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c index 25655b9..7c2b889 100644 --- a/libkmod/libkmod.c +++ b/libkmod/libkmod.c @@ -64,6 +64,7 @@ static struct _index_files { static const char *default_config_paths[] = { SYSCONFDIR "/modprobe.d", "/run/modprobe.d", + "/usr/local/lib/modprobe.d", "/lib/modprobe.d", NULL }; @@ -234,10 +235,11 @@ static char *get_kernel_release(const char *dirname) * Otherwise, give an absolute dirname. * @config_paths: ordered array of paths (directories or files) where * to load from user-defined configuration parameters such as - * alias, blacklists, commands (install, remove). If - * NULL defaults to /etc/modprobe.d, /run/modprobe.d and - * /lib/modprobe.d. Give an empty vector if configuration should - * not be read. This array must be null terminated. + * alias, blacklists, commands (install, remove). If NULL + * defaults to /etc/modprobe.d, /run/modprobe.d, + * /usr/local/lib/modprobe.d and /lib/modprobe.d. Give an empty + * vector if configuration should not be read. This array must + * be null terminated. * * Create kmod library context. This reads the kmod configuration * and fills in the default values. diff --git a/man/depmod.d.xml b/man/depmod.d.xml index 6472bda..b315e93 100644 --- a/man/depmod.d.xml +++ b/man/depmod.d.xml @@ -40,6 +40,7 @@ /usr/lib/depmod.d/*.conf + /usr/local/lib/depmod.d/*.conf /run/depmod.d/*.conf /etc/depmod.d/*.conf diff --git a/man/modprobe.d.xml b/man/modprobe.d.xml index a674d69..0ab3e91 100644 --- a/man/modprobe.d.xml +++ b/man/modprobe.d.xml @@ -41,6 +41,7 @@ /lib/modprobe.d/*.conf + /usr/local/lib/modprobe.d/*.conf /run/modprobe.d/*.conf /etc/modprobe.d/*.conf diff --git a/tools/depmod.c b/tools/depmod.c index 8e1d9ec..170a1d8 100644 --- a/tools/depmod.c +++ b/tools/depmod.c @@ -53,6 +53,7 @@ static const char CFG_EXTERNAL_KEY[] = "external"; static const char *default_cfg_paths[] = { SYSCONFDIR "/depmod.d", "/run/depmod.d", + "/usr/local/lib/depmod.d", "/lib/depmod.d", NULL };