Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3568941rdb; Sun, 10 Dec 2023 10:45:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFAwyeVDTG1dlm/OnIOrAH4+EwOZbKZKoji/gOJA6shrX5i9n/JBw7hRmiWs5HO1UpUZOFG X-Received: by 2002:a17:903:41c1:b0:1d0:6ffd:611c with SMTP id u1-20020a17090341c100b001d06ffd611cmr3741494ple.62.1702233929869; Sun, 10 Dec 2023 10:45:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702233929; cv=none; d=google.com; s=arc-20160816; b=Q0eiVNGB0Di/zvCG/pPVQuFJhfxcvMK3pOgJTMiaV884Cdshd/jSvOe3CbmtLnnH8J x98c9z8Qv+GmgaqvQcM2M1G1MJxFnCGvXyT/TSkUsMkSgJ9iVGXdbzKvAELzNAcIJp2d XngAJPHhf09iQzLiCRpO72VFSKOwtJ7+aVlcLHMPjtmSGR3yy3kSoY8BFrOy92yUJnRT iA8vFCmmml/+UB+luX6rP8gDS8ycQyCTeqKzkoKKT+gEh9d/45h4NWwvAdYMi3QodyC6 skoIiY+T0uqNeM5y3AbIC5K/xhF0RAPQbaLG3IpfqUSN21nRIYpRUfFrZE2Y/lgeu3ls 8X2g== 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=BQ1FHE29HiMEzGUsfzkwy3zffbK35qf3dAJjCciFlJo=; fh=F7OL9Oh/Ta59yoSl5vFOeG5sqapvXgjhYy1ss38QfFk=; b=SVyZDDZPYS7nl5JKoCAhVZ6mM8U0P9ebY2JR3EyKu8biCCSBexH47q1tReV72ufGTy wC+tINRbTdjPkpIpWP5Au81uv4uqeEjEs5M5akCPU9Iir7onjD0IusIhLp9P4w+2FkBh jmxtQWxTGrYbTW+iyoHKf7hlVGWMdLlqABasXAfopQCLrqRWdtBuQeXCCljNw+gJmqYi QW2fGBoR2To/NCR9u4fTOQpNvgsh/ekG4uc1Nx835nIyGpuU+LRJLaCJ1vey6VX9MXNq d+Mk8DwjoYwqvFcyHPGNAu69n8VRriiPP1i3hu/IwBAO5ZaheOgxOHXGBv9N2CNy1Jnd M7lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EdD0Cccc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id l8-20020a170902f68800b001d1e31980cesi4917598plg.306.2023.12.10.10.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 10:45:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EdD0Cccc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id DE4D98087384; Sun, 10 Dec 2023 10:45:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231807AbjLJSpG (ORCPT + 99 others); Sun, 10 Dec 2023 13:45:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjLJSpF (ORCPT ); Sun, 10 Dec 2023 13:45:05 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0309E95 for ; Sun, 10 Dec 2023 10:45:12 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4492C433C9; Sun, 10 Dec 2023 18:45:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702233911; bh=skyqUr35HpShBRuA1+rQmpve+SHE2Muqp1aZH8EcMNE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=EdD0CcccleHZ6zyod+UY3GEQGA8Y1gbrVpSY/dPlXaOppTVbT4RdUTz+LoSfsZ4Hh JkwbKCaA1YFUNB471gVb/HEnPkiX2yfzzvRwn8cqK4VZPNegJNUKMG0dmkhU/XivkS MaAx0Gt6Iw+D3+lNbwYxSOD27drKKDXo89q2Cj35VL4tiXrpjIAFK+HFbBaAAUVJHr IxEs+ai3DPsObG8u8vju6It3iRLyDutsByL/2r2i47JUs8V9S+ejrqA3hTLlo0qgdB pWKVSeFqmdigR9mYY4tzwT5ACEvY99+yb7yoLvC4DQESlx+so3+fnu4ouf/8xzyQco mz1rmh8k6uR7g== Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-59052ab970eso1617191eaf.1; Sun, 10 Dec 2023 10:45:11 -0800 (PST) X-Gm-Message-State: AOJu0YyH6TuMq2UyUBWzMGPxu3brKoAeeVHnXyjayeZFyjiEL7Ti5yOM blDsKgjWqWzEnHXzZT5MFgpiy++3pfOpNSsWFKg= X-Received: by 2002:a05:6870:6ec7:b0:1fa:fa54:1a4f with SMTP id qv7-20020a0568706ec700b001fafa541a4fmr1642722oab.13.1702233911082; Sun, 10 Dec 2023 10:45:11 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Masahiro Yamada Date: Mon, 11 Dec 2023 03:44:35 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 2/2] kbuild: rpm-pkg: Fix build with non-default MODLIB 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 agentk.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 (agentk.vger.email [0.0.0.0]); Sun, 10 Dec 2023 10:45:27 -0800 (PST) On Thu, Dec 7, 2023 at 4:48=E2=80=AFAM Michal Suchanek = wrote: > > The default MODLIB value is composed of three variables > > MODLIB =3D $(INSTALL_MOD_PATH)$(KERNEL_MODULE_DIRECTORY)/$(KERNELRELEASE) > > However, the kernel.spec hadcodes the default value of > $(KERNEL_MODULE_DIRECTORY), and changed value is not reflected when > building the package. > > Pass KERNEL_MODULE_DIRECTORY to kernel.spec to fix this problem. > > Signed-off-by: Michal Suchanek > --- > Build on top of the previous patch adding KERNEL_MODULE_DIRECTORY The SRPM package created by 'make srcrpm-pkg' may not work if rpmbuild is executed in a different machine. %{make} %{makeflags} INSTALL_MOD_PATH=3D%{buildroot} KERNEL_MODULE_DIRECTORY=3D%{KERNEL_MODULE_DIRECTORY} modules_install will align with the specified install destination, but depmod will still fail. (same issue as 1/2) > --- > 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..12996ed365f8 100644 > --- a/scripts/package/kernel.spec > +++ b/scripts/package/kernel.spec > @@ -67,7 +67,7 @@ cp $(%{make} %{makeflags} -s image_name) %{buildroot}/b= oot/vmlinuz-%{KERNELRELEA > %{make} %{makeflags} INSTALL_HDR_PATH=3D%{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/%{KER= NELRELEASE}/build > +ln -fns /usr/src/kernels/%{KERNELRELEASE} %{buildroot}%{KERNEL_MODULE_DI= RECTORY}/%{KERNELRELEASE}/build > %if %{with_devel} > %{make} %{makeflags} run-command KBUILD_RUN_COMMAND=3D'${srctree}/script= s/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 > +%{KERNEL_MODULE_DIRECTORY}/%{KERNELRELEASE} > +%exclude %{KERNEL_MODULE_DIRECTORY}/%{KERNELRELEASE}/build > /boot/* > > %files headers > @@ -110,5 +110,5 @@ fi > %files devel > %defattr (-, root, root) > /usr/src/kernels/%{KERNELRELEASE} > -/lib/modules/%{KERNELRELEASE}/build > +%{KERNEL_MODULE_DIRECTORY}/%{KERNELRELEASE}/build > %endif > diff --git a/scripts/package/mkspec b/scripts/package/mkspec > index ce201bfa8377..e952fa4f2937 100755 > --- a/scripts/package/mkspec > +++ b/scripts/package/mkspec > @@ -24,6 +24,7 @@ fi > cat< %define ARCH ${ARCH} > %define KERNELRELEASE ${KERNELRELEASE} > +%define KERNEL_MODULE_DIRECTORY ${KERNEL_MODULE_DIRECTORY} > %define pkg_release $("${srctree}/init/build-version") > EOF > > -- > 2.42.0 > > -- Best Regards Masahiro Yamada