Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3569033rdb; Sun, 10 Dec 2023 10:45:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IG8opzvuYa1+avdBf+bWs4PCdxB89K784lYqElr2xPuPOVmga9nQwmcyacf0dNTgmQfWffO X-Received: by 2002:a05:6602:257c:b0:7b7:d2e:8550 with SMTP id dj28-20020a056602257c00b007b70d2e8550mr4922746iob.0.1702233941800; Sun, 10 Dec 2023 10:45:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702233941; cv=none; d=google.com; s=arc-20160816; b=nI1ltYErfeEnZC/HPgZUzs2WcpIGFODfNxSl/8kHHKrsOWXOICsulq2wtPqGaFlh7b YgpTWX6vzf2F5cBPCK689KHFzE2k7dEd0J+9KemqS0sfS4wuTLhKp3HyKichgcAVEWHf VQtEI7blgJSRyeIzJjXMt6Mbxi1ulJOIsO49Nna5VdLbkkgEW97vE2g6VQ9md6lBDUSN omcFJP7bOpgo7kngFOgr8qzcvlaTJ8mvMRDaTnEAhxwHWFSsEd36oKGEJn8YTWRLSX/F p5mabir4kpGmQIQgt8aXGPAjn9wTPzGFrvVP8OMtf8d1jQyFFtIi1/pXC2pnzjlHo3bO WsnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=xvyHiRyz/YggHrpVgiUYOr/h5G/D+XzZtSKhg3TpNhc=; fh=F7OL9Oh/Ta59yoSl5vFOeG5sqapvXgjhYy1ss38QfFk=; b=tg8I2qN2sWQVvTmqOQmcIkSL9rQri7GUYWcW1sISltR5fZ5kAGC+93v2jrIIVRO72S CkQsab9eoBwyOy/ZBga4I+1bt2Poov+cAxRbLfbsm/gFh8ZmUxpjlsqxbFcOdEVOCLrG MIIhxuiW8lzW8w2JmaeEOrz0ZJW2vCDae1vxJ1I+6X2NGSFoBr64e5EwmVL2rNZ96qQo 0VeexcfJuCebzdFJtGtgRZ9f9eHKYTxAb1W/CnWitLbcr8yvHeu1NMJUTO1wwe+sqvWU BBqMMSR/1l//YchIKt7OkmsC4KVRJ46/7lu+fiuzITZGiP7BXiXtKGt5NP16x+pbtWaK 19HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Icrh23fS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id r35-20020a63fc63000000b005c624eec079si3790023pgk.724.2023.12.10.10.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 10:45:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Icrh23fS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 4CC88807C755; Sun, 10 Dec 2023 10:45:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232018AbjLJSoR (ORCPT + 99 others); Sun, 10 Dec 2023 13:44:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjLJSoQ (ORCPT ); Sun, 10 Dec 2023 13:44:16 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5280FDF for ; Sun, 10 Dec 2023 10:44:22 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA761C43391; Sun, 10 Dec 2023 18:44:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702233861; bh=9SODrnF5mnSkO6mjlA/PnjTFQYLuo6SeN7rFnxhsZrc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Icrh23fSCnU25t5zjraKFxz0GFZldNjGdSgApNqZiV7tIVx2PTB436CWxUMlr0IlV gVJH7LCThW6zZZhE1f7XttM316utHvEBWXX6cUIj+xrCe36gJwyLoxGgCUzpk3M04/ pGLJmkcQxXVHZtnJIZP02XoRUKPPJu5BA+0p6bog0/qLcxyuWsj2DxNNEmfN8Tb4Fh oLKVIUCEJmXlrdbJBbUqiLv7g52wiB9DNEck9W3TyWuR+c63eYgD9h2JBDjM1wu0D/ lCD/4nr7b9ykOCEpS0wO9NmeyZXk+tMxKhXdyq8f16LiRQ+X/P+Zg+igEPWRLMjcsO FvVkBcO3swKvA== Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-1f03d9ad89fso2494364fac.1; Sun, 10 Dec 2023 10:44:21 -0800 (PST) X-Gm-Message-State: AOJu0Yybw5QVTtM5j2ImDIbQC8ireAOEFjufxWlzrSdAqLvYVAqFgxGY iIxy0Ku4pLymR258OeMCZcYbWWdbE7E0TzfgBD0= X-Received: by 2002:a05:6870:c1cc:b0:1fb:75a:6d2b with SMTP id i12-20020a056870c1cc00b001fb075a6d2bmr4139539oad.82.1702233861235; Sun, 10 Dec 2023 10:44:21 -0800 (PST) MIME-Version: 1.0 References: <32b332af189bfca8acdb231cee294355aa4af290.1701892062.git.msuchanek@suse.de> In-Reply-To: <32b332af189bfca8acdb231cee294355aa4af290.1701892062.git.msuchanek@suse.de> From: Masahiro Yamada Date: Mon, 11 Dec 2023 03:43:44 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 1/2] depmod: Handle installing modules under a different directory To: Michal Suchanek Cc: linux-modules@vger.kernel.org, Takashi Iwai , Lucas De Marchi , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Jiri Slaby , Jan Engelhardt , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sun, 10 Dec 2023 10:45:05 -0800 (PST) On Thu, Dec 7, 2023 at 4:48=E2=80=AFAM Michal Suchanek = wrote: > > Some distributions aim at shipping all files in /usr. > > The path under which kernel modules are installed is hardcoded to /lib > which conflicts with this goal. > > When kmod provides kmod.pc, use it to determine the correct module > installation path. > > With kmod that does not provide the config /lib/modules is used as > before. > > While pkg-config does not return an error when a variable does not exist > the kmod configure script puts some effort into ensuring that > module_directory is non-empty. With that empty module_directory from > pkg-config can be used to detect absence of the variable. > > Signed-off-by: Michal Suchanek > --- > v6: > - use ?=3D instead of :=3D to make it easier to override the value "KERNEL_MODULE_DIRECTORY=3D/local/usr/lib/modules make modules_install" will override the install destination, but depmod will not be not aware of it. How to avoid the depmod error? > - use shorter expression for determining the module directory assuming > it's non-empty > --- > Makefile | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/Makefile b/Makefile > index 511b5616aa41..84f32bd563d4 100644 > --- a/Makefile > +++ b/Makefile > @@ -1081,7 +1081,9 @@ export INSTALL_DTBS_PATH ?=3D $(INSTALL_PATH)/dtbs/= $(KERNELRELEASE) > # makefile but the argument can be passed to make if needed. > # > > -MODLIB =3D $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) > +export KERNEL_MODULE_DIRECTORY ?=3D $(or $(shell pkg-config --variable= =3Dmodule_directory kmod 2>/dev/null),/lib/modules) > + > +MODLIB =3D $(INSTALL_MOD_PATH)$(KERNEL_MODULE_DIRECTORY)/$(KERNELRELEASE= ) > export MODLIB > > PHONY +=3D prepare0 > -- > 2.42.0 > > -- Best Regards Masahiro Yamada