Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp517120rdb; Fri, 6 Oct 2023 09:58:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHR+GLiedA0eovS3adEoW2F2X7r7YAusYzCRFEIDBEJCb2nb9tHOBbIcJ21PwJ8ojn8O0Kn X-Received: by 2002:a05:6a20:549a:b0:159:beec:79ba with SMTP id i26-20020a056a20549a00b00159beec79bamr11010699pzk.2.1696611522588; Fri, 06 Oct 2023 09:58:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696611522; cv=none; d=google.com; s=arc-20160816; b=QXzMBvydQQ9W7Twd6OCVUrRttiHHhDldJoqLqOb60a/i3eYCFEKQhNWgvfE4esHHFL EJea3alPpD6gPYWHRtBne2QhnEWEP9tRveYwbZCPr86dlRFK/NORGPz/lhqXn/VcjQ76 dsVY98fqWMVKEM/TqAwEC7ngVw1WizOJSfJf/k4quvYfr0U9cDcsaK3aZWpPTs/9XO4d Vta2BGXtf8WbpxNbfDWaj2hyhDD4Yp3/7MRT6r3TAugkVTVtxsnujnK5HiRXIN/+9lzb kaui9Njb9NkuiteF72LZwpt4pIMUXfW7qVy4cyKZcBoQ9wICMQugiVXUrhx0GexS+4Tz mzBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jgmpleV3039fp9l4OMHO0FV1DugDkVNJiQasH2lNJkM=; fh=ENUiCDoxRRp+lMPRlTNGFdG/YzU21XvhVV56Lbh8QYE=; b=l1wnKJ471w17LZcjBku+t7OfAS6HB5+E4P0O+kPZIeI2AI+d69gtSi7cR07r5day2z AN0Fe9USMNV3bfm7CBi3ZB8IEGpQfJ6diu/bzMf0NHT65gIKyaGXt4ZK+3Rs5XyqZG4S YUlmQU/iByZ+2f96GAj1Kttl5Zc4w5nj29d9Z9YTP3wMxqIO7hRd+yhnz9O2YFDPuN+I hcEVoQOXkTZ3twYRGvsKNoVD433GuqOgRimvEGbJ4wKB2K70FiyHnPyefyMXRR+VBQUM EyCNxlOANavLPoM+tRxoNreEI5A6h7Bv4dsJIk/tN32j+BETkBT3MXB18LCfCtw68Cg6 f0ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QtctmrP7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id h19-20020a635753000000b00578ed63fdacsi3891043pgm.878.2023.10.06.09.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 09:58:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QtctmrP7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 6CAAD816ECD5; Fri, 6 Oct 2023 09:58:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232678AbjJFQ6U (ORCPT + 99 others); Fri, 6 Oct 2023 12:58:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231666AbjJFQ6T (ORCPT ); Fri, 6 Oct 2023 12:58:19 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9928BAD; Fri, 6 Oct 2023 09:58:18 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3B1CC433C8; Fri, 6 Oct 2023 16:58:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696611498; bh=W/PV9BEnW7qV8HRBjAeCSKH71F8YRJwxXRxGjI45a6Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QtctmrP7HPX723W0dFuw/syZx1G3b4jfABirVj7JKuUFR4u0ANnNX9D9WFqmGsizJ iomwfbA3VchilnHSRmBdJbSjGjzv5uZ49OeA095CjlXG8M7ItBd8qPL9QMUK/QrZ65 tnkIn0MBo8NLpb3kkkez6smKI0yHnyR3oxGlCH7Tw/BF5baOzK8QzamZtZYZ52UHfJ yuPotqd/7l+OL/s5ThUw+Zlv1HX02eOtqk4dWMHcHjngAb1dbCohYH2U37ymWy+5oD qVCziJ7OACmhP86Vhm0WeDvNsTJ8c6ZOUc6cwNYampiMTHyv1l+aZYg0NdiQL/F+lj fowcyiaLg/Xng== Date: Fri, 6 Oct 2023 09:58:15 -0700 From: Nathan Chancellor To: Michal Suchanek Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolas Schier , linux-modules@vger.kernel.org, Takashi Iwai , Lucas De Marchi , Michal =?iso-8859-1?Q?Koutn=FD?= , Jiri Slaby , Jan Engelhardt , Nick Desaulniers Subject: Re: [PATCH rebased] kbuild: rpm-pkg: Fix build with non-default MODLIB Message-ID: <20231006165815.GA3359308@dev-arch.thelio-3990X> References: <20231005150728.3429-1-msuchanek@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231005150728.3429-1-msuchanek@suse.de> X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 06 Oct 2023 09:58:40 -0700 (PDT) X-Spam-Level: ** On Thu, Oct 05, 2023 at 05:07:28PM +0200, Michal Suchanek wrote: > The default MODLIB value is composed of two variables and the hardcoded > string '/lib/modules/'. > > MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) > > Defining this middle part as a variable was rejected on the basis that > users can pass the whole MODLIB to make, such as > > make 'MODLIB=$(INSTALL_MOD_PATH)/usr/lib/modules/$(KERNELRELEASE)' > > However, this middle part of MODLIB is independently hardcoded by > rpm-pkg, and when the user alters MODLIB this is not reflected when > building the package. > > Given that $(INSTALL_MOD_PATH) is overridden during the rpm package build > it is likely going to be empty. Then MODLIB can be passed to the rpm > package, and used in place of the whole > /usr/lib/modules/$(KERNELRELEASE) part. > > Signed-off-by: Michal Suchanek This appears to work for me. Reviewed-by: Nathan Chancellor > --- > scripts/package/kernel.spec | 8 ++++---- > scripts/package/mkspec | 1 + > 2 files changed, 5 insertions(+), 4 deletions(-) > > diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec > index 3eee0143e0c5..15f49c5077db 100644 > --- a/scripts/package/kernel.spec > +++ b/scripts/package/kernel.spec > @@ -67,7 +67,7 @@ cp $(%{make} %{makeflags} -s image_name) %{buildroot}/boot/vmlinuz-%{KERNELRELEA > %{make} %{makeflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install > cp System.map %{buildroot}/boot/System.map-%{KERNELRELEASE} > cp .config %{buildroot}/boot/config-%{KERNELRELEASE} > -ln -fns /usr/src/kernels/%{KERNELRELEASE} %{buildroot}/lib/modules/%{KERNELRELEASE}/build > +ln -fns /usr/src/kernels/%{KERNELRELEASE} %{buildroot}%{MODLIB}/build > %if %{with_devel} > %{make} %{makeflags} run-command KBUILD_RUN_COMMAND='${srctree}/scripts/package/install-extmod-build %{buildroot}/usr/src/kernels/%{KERNELRELEASE}' > %endif > @@ -98,8 +98,8 @@ fi > > %files > %defattr (-, root, root) > -/lib/modules/%{KERNELRELEASE} > -%exclude /lib/modules/%{KERNELRELEASE}/build > +%{MODLIB} > +%exclude %{MODLIB}/build > /boot/* > > %files headers > @@ -110,5 +110,5 @@ fi > %files devel > %defattr (-, root, root) > /usr/src/kernels/%{KERNELRELEASE} > -/lib/modules/%{KERNELRELEASE}/build > +%{MODLIB}/build > %endif > diff --git a/scripts/package/mkspec b/scripts/package/mkspec > index d41608efb747..d41b2e5304ac 100755 > --- a/scripts/package/mkspec > +++ b/scripts/package/mkspec > @@ -18,6 +18,7 @@ fi > cat< %define ARCH ${ARCH} > %define KERNELRELEASE ${KERNELRELEASE} > +%define MODLIB ${MODLIB} > %define pkg_release $("${srctree}/init/build-version") > EOF > > -- > 2.42.0 >