Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3751415rdb; Sun, 10 Dec 2023 20:34:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmR8QEeCkhHiOO6WZn/hh7EXVU9886rI0GuvMvpbhS2xf4vhBDWFbZeiWJ+n+u9PIsiOBS X-Received: by 2002:a05:6359:223:b0:170:6c3b:4f7b with SMTP id ej35-20020a056359022300b001706c3b4f7bmr4318787rwb.20.1702269254131; Sun, 10 Dec 2023 20:34:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702269254; cv=none; d=google.com; s=arc-20160816; b=0RQzWEt5cs4XOjs0WXiQcju8mOvibZ5udgDU1YU5Zdm2EWJ6fS3kUjfU/ELGtg9af8 1XE+xFbX/2OqNs9FebbD3exIXbY6y57iAysuXZdxb9d/VGUS503jhlIaPeYxWCAVYtsi 1Kdvy/iHKCmgaVlVizLvMmkJeL7wxUD8LmZ8ZmJAdrna76ntDO18GTBtHboh8LOYjduK vgGFWpHnu1va5ABobmXuqP42XIyDC2rsxOE5GoO18gLQAGTGDNRkhtPyGw6x4X5qk+LD yjKAOayZqVNk4VVT2Zvv3uPYEfDIPWR2IT1MOUAGCPGQLIqNqUqFF4Rdcn/dX4T+RLk9 BfKA== 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=eM1+rJu8LH+HlvgvUQZbdCsFlo2iU0k5Ph3oBajmleI=; fh=PigGyr0k2UHxlHDObR4tN2IY8Z8lWBCCEIGD12vhblo=; b=OCjfzW2rTF+JuwjziVaeOpDmJXXXiZwC92ngv2+UQ00Lc82cw7Qoeh8RB+8/VXr8AD PGYrkfEkcgsMjMKb2vWyzbi6Wq/+aIvGs4zA8OOm8hRjJlO2LLWhg7+BQWOoUuMKs+IQ PSPb7+oCtiieYHP9cbitoD85/gdvgwtYNyHwmZb6LK8jIohxomMTE0OnhT/UeUtC+nF2 bncyslZDegXP6JYuIq9TcL81iEVeR8tYtTjxy+F1C5fNMf++MP1arHNttdji7nUju1Ci tfRQmWXlhYp8zMDMZSAjyIHS4D+5levgsQ+yC8Wb1ZXYPm5rYbr0UwEPd2DHmYfbCUl2 gWgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N0l7Q09e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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. [23.128.96.32]) by mx.google.com with ESMTPS id s11-20020a170902ea0b00b001ce5ba27888si5630046plg.211.2023.12.10.20.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 20:34:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N0l7Q09e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 9D22D807E51B; Sun, 10 Dec 2023 20:34:11 -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 S229589AbjLKEdz (ORCPT + 99 others); Sun, 10 Dec 2023 23:33:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjLKEdy (ORCPT ); Sun, 10 Dec 2023 23:33:54 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2E53EB for ; Sun, 10 Dec 2023 20:34:00 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35BE8C433C9; Mon, 11 Dec 2023 04:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702269240; bh=WQmmFM7+2b72O3G9hhh8eE5TPDlkXNRawk8A5t2M6a0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=N0l7Q09eJQfnZG3INq9PmZNflY3/gnjtU8zNyadwdLx0/TobCxRHx02CNi709mUg5 sgiuOIct99rGCRbU+UYfiUdz9oHm+XUteen52qrycNrl4OoPOBuM/cSdKET+dzwOwo tB0d5QNGjt3CJ5P8MSHMFCpB39A50mkpnXuRBtwU1cZD1R+IfXVBJ2/EMPCJh3Hqya IX14UW45+6rMt8Mo7Be/wdf7jS8W7BpNWxinbCdZtH2hBfxNkHD3LH8rNHLq/4u8KP TJoqroqRvDb5+gC3Xoepp8ETQMbpWGunOLygdRxD1lAJsOTQmPFh7AMVz8wRWKKqTF OMmfvPdS8eUSw== Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-1f055438492so3137632fac.3; Sun, 10 Dec 2023 20:34:00 -0800 (PST) X-Gm-Message-State: AOJu0YwptOjbjwhMHAOmSNIK51aXLCbuRwUb1jHJ8/UvbxfqT1OioH8O gnSJS5s/eXPuv1bu3akkfdfkF1B80XDm6apmKQM= X-Received: by 2002:a05:6870:a454:b0:1fa:f170:bf27 with SMTP id n20-20020a056870a45400b001faf170bf27mr4673457oal.40.1702269239586; Sun, 10 Dec 2023 20:33:59 -0800 (PST) MIME-Version: 1.0 References: <20231210210859.GN9696@kitsune.suse.cz> In-Reply-To: <20231210210859.GN9696@kitsune.suse.cz> From: Masahiro Yamada Date: Mon, 11 Dec 2023 13:33:23 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 2/2] kbuild: rpm-pkg: Fix build with non-default MODLIB To: =?UTF-8?Q?Michal_Such=C3=A1nek?= 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 20:34:11 -0800 (PST) On Mon, Dec 11, 2023 at 6:09=E2=80=AFAM Michal Such=C3=A1nek wrote: > > On Mon, Dec 11, 2023 at 03:44:35AM +0900, Masahiro Yamada wrote: > > 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)/$(KERNELRELE= ASE) > > > > > > 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. > > That's why there is an option to override KERNEL_MODULE_DIRECTORY? Yes. But, as I pointed out in 1/2, depmod must follow the packager's decision. 'make srcrpm-pkg' creates a SRPM on machine A. 'rpmbuild' builds it into binary RPMs on machine B. If A and B disagree about kmod.pc, depmod will fail because there is no code to force the decision made on machine A. > Thanks > > Michal > > > > > > > > > %{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.spe= c > > > index 3eee0143e0c5..12996ed365f8 100644 > > > --- a/scripts/package/kernel.spec > > > +++ b/scripts/package/kernel.spec > > > @@ -67,7 +67,7 @@ cp $(%{make} %{makeflags} -s image_name) %{buildroo= t}/boot/vmlinuz-%{KERNELRELEA > > > %{make} %{makeflags} INSTALL_HDR_PATH=3D%{buildroot}/usr headers_ins= tall > > > 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}%{KERNEL_MODUL= E_DIRECTORY}/%{KERNELRELEASE}/build > > > %if %{with_devel} > > > %{make} %{makeflags} run-command KBUILD_RUN_COMMAND=3D'${srctree}/sc= ripts/package/install-extmod-build %{buildroot}/usr/src/kernels/%{KERNELREL= EASE}' > > > %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 -- Best Regards Masahiro Yamada