Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2579939rwp; Fri, 14 Jul 2023 08:11:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlHZZmFBgrB+a1E4YBB65u+yVYjx2GiYOWutsktmXjsa1Ta/diuLXH/+3yqzpsXXYuaEkljN X-Received: by 2002:a17:906:7493:b0:993:d8c0:f0f6 with SMTP id e19-20020a170906749300b00993d8c0f0f6mr4114594ejl.1.1689347506391; Fri, 14 Jul 2023 08:11:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689347506; cv=none; d=google.com; s=arc-20160816; b=05hCYC9zv06dSJl1IrEwKpXQ01sARnOPgz1rC9617JaTeeaoriHTjk7p7vtKXTadkX 9GIovlpS6mAAAVyiVGJpAKvp4sfSDasN9M3nVZPQY8Oq/W2mfBmwqk6esEhngF8NvJsA Pr96xS8UG5wM2FpkG0xDSIs+KEXCN4Avums6t7GAK8/6C1yfJSM8sp8LYMpH+TdRW6MY oP+tQ93tAUwJCV6JgHBABLwklIEmD2M28gvfxTvMV1+nR+sw/ztBqQ7E3i9HXck6FDWX 0ffgmpJDaCKLiN0OBqL7wDNMw2No/lzmmae/ezAYqCded078v3ElXBSDNF8yL3T/U9wZ jYAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=1XAhxBqyavPKKiCIsZyWgV67fhIxl0ST4aikj1J+tkI=; fh=HDztna6PbmjtuJh8EtYkhtVXFnuILxPdrwf1Wy9pp6k=; b=yeCthkOMW6LNUoCzGO9n7sWzD4UnmdtK1tyDcl/ZJKAy4LyrcxAXkFE/CcVyD06MXu fz7/Vp+bz7Q5hgY+ULjBlsFwgC35fHbRfZ4/dMWSBcjlfQUiiGqcP3i0h36FlU6uH8zi Q38FVCRM/xOwUXVt6mOtfiEVaLg3G/+EQGgqnUyvbFRZtUT4GjZ8HDTb1bqgf/unEJUW BRl6HgimgtE1Ir36SSh4Dl8JIEAftRaFjVD/mY1PAiu7OhWCeM2vq78WOYFtPolj7l5k mO+OpGJgh+MPtmOA5s0XlMgUIHI2Ke6dq484EnO9m1OJXpwND6e8phWo7fHyBner4YcM kTWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ZsM4+BcF; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t14-20020a17090616ce00b00982a5377650si9146714ejd.247.2023.07.14.08.11.22; Fri, 14 Jul 2023 08:11:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ZsM4+BcF; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236037AbjGNOfb (ORCPT + 99 others); Fri, 14 Jul 2023 10:35:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236075AbjGNOfN (ORCPT ); Fri, 14 Jul 2023 10:35:13 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3734330F8; Fri, 14 Jul 2023 07:34:48 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id EAEA01F747; Fri, 14 Jul 2023 14:34:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1689345286; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1XAhxBqyavPKKiCIsZyWgV67fhIxl0ST4aikj1J+tkI=; b=ZsM4+BcFWVLl/wAs4b/YLl068yXfKEFNzT435VUO9+J1i4LePJoLWQHjfLAI4pyN2kVqzb lozi3PZ+MfAmK4vzdRJL0uwX1gIsKRuTHcxahecc0AoHAukPkhzQJo2rMCQZxa3ODgiJEP O1Fec9Yb9F6Wj0Bxtf8YBe9Fk4UrPcE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1689345286; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1XAhxBqyavPKKiCIsZyWgV67fhIxl0ST4aikj1J+tkI=; b=s7HPsZbFrKx5gTQ3CHN/4oZJwqknSsvrsIMSLPA27f7S7lna7b9W/b9ATcCMj74lopGI1C HxVexwa8tm3OChDw== Received: from kitsune.suse.cz (kitsune.suse.cz [10.100.12.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id AC53A2C142; Fri, 14 Jul 2023 14:34:46 +0000 (UTC) Date: Fri, 14 Jul 2023 16:34:45 +0200 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Nicolas Schier Cc: linux-modules@vger.kernel.org, Takashi Iwai , Lucas De Marchi , Michal =?iso-8859-1?Q?Koutn=FD?= , Jiri Slaby , Jan Engelhardt , Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH kmod v2 2/4] libkmod, depmod: Load modprobe.d, depmod.d from $prefix/lib. Message-ID: <20230714143445.GM9196@kitsune.suse.cz> References: <20230711153126.28876-1-msuchanek@suse.de> <20230712140103.5468-2-msuchanek@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 14, 2023 at 04:16:44PM +0200, Nicolas Schier wrote: > On Wed, Jul 12, 2023 at 04:00:46PM +0200 Michal Suchanek wrote: > > There is an ongoing effort to limit use of files outside of /usr (or > > $prefix on general). Currently all modprobe.d paths are hardcoded to > > outside of $prefix. Teach kmod to load modprobe.d from $prefix/lib. > > > > On some distributions /usr/lib and /lib are the same directory because > > of a compatibility symlink, and it is possible to craft configuration > > files with sideeffects that would behave differently when loaded twice. > > However, the override semantic ensures that one 'overrides' the other, > > and only one configuration file of the same name is loaded from any of > > the search directories. > > > > Signed-off-by: Michal Suchanek > > --- > > v2: Fix commit message typo > > --- > > Makefile.am | 1 + > > libkmod/libkmod.c | 3 ++- > > man/Makefile.am | 9 +++++++-- > > man/depmod.d.xml | 1 + > > man/modprobe.d.xml | 1 + > > tools/depmod.c | 1 + > > 6 files changed, 13 insertions(+), 3 deletions(-) > > > > diff --git a/Makefile.am b/Makefile.am > > index 8ba85c91a0f3..7aa5bfa5638d 100644 > > --- a/Makefile.am > > +++ b/Makefile.am > > @@ -19,6 +19,7 @@ AM_CPPFLAGS = \ > > -include $(top_builddir)/config.h \ > > -I$(top_srcdir) \ > > -DSYSCONFDIR=\""$(sysconfdir)"\" \ > > + -DPREFIX=\""$(prefix)"\" \ > > ${zlib_CFLAGS} > > > > AM_CFLAGS = $(OUR_CFLAGS) > > diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c > > index 2670f9a4611a..13c82b069e84 100644 > > --- a/libkmod/libkmod.c > > +++ b/libkmod/libkmod.c > > @@ -65,6 +65,7 @@ static const char *const default_config_paths[] = { > > SYSCONFDIR "/modprobe.d", > > "/run/modprobe.d", > > "/usr/local/lib/modprobe.d", > > + PREFIX "/lib/modprobe.d", > > "/lib/modprobe.d", > > NULL > > }; > > @@ -237,7 +238,7 @@ static char *get_kernel_release(const char *dirname) > > * to load from user-defined configuration parameters such as > > * 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 > > + * /usr/local/lib/modprobe.d and PREFIX/lib/modprobe.d. Give an empty > > In the chunk above, there still is /lib/modprobe.d included in the > default_config_paths array. Indeed, if this is rendered as documentation somewhere this would be misleading. Thanks Michal