Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1762028rdb; Mon, 9 Oct 2023 01:53:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEP/6JwdZPw2uvNbbezUQrcMl8oNFAep/Yxrsv8N6n/eoN66fOYFxR+heitszBPOUcrxUKh X-Received: by 2002:a17:902:d382:b0:1c1:fe87:f550 with SMTP id e2-20020a170902d38200b001c1fe87f550mr15308020pld.7.1696841623663; Mon, 09 Oct 2023 01:53:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696841623; cv=none; d=google.com; s=arc-20160816; b=aknGjKT+847EvIjVRDn9j31uyMpFUQOHrjO3wFKEVX8uhWTV27wBGcfhKnGRjgt6qI +RI1eUbjIfg+XDilAHrbLIjH7lQh+FPLKqCsQCmgPdpyLVImhVwAfd7q3ezUNPRAgb8c V7HHzuDOths9PEY/nJxaAX7QjCJdPXUQM6wn4xow5VsCUyWbUD8fy9/YN8npxOcylKGQ ofcSsQVqb+9/4i+FaFqr+Kpwt+4lg8oLsOMCQ37t+H3DovaFtRZjYAbh7iwmyAO+gImU UwAT+KelMwCP78RpWzeu3X2BN/3CGkbI+djo7fcaa6VwAWXNZVJM/B+o85tnwpIXdT7B 4KLA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=S+ENGRtc9kO336DfttkT+4HSplaWliy8Mo2bgqKSB/E=; fh=B3aGKZUjOknTrCzkm3ZqzvoW7atFCwPxoXW6RvZkPRs=; b=TnRfvzLN8Z9FZf+S8xfAhH9uuEvl5CKfegWbA9Q+vuKhI9tGC5NUsCj8mZwF5LM5Ud R3xQ1nmwMYb1ACQJP4rEzk3A4OvxGrlP6Ys3K6BiSkHwMgz9CEynvZtiTZvWBHFsXBOy qG+T79KEeZ0QN/H9zvZ3QLtLKtd5vjzvNOPPWOntaMRP2w6yO7wzasavxz6mLR5kX3cI y88E0jzT4/Vf5zRyvbHjmPEZbXG7nPLdxMYcoq4pzxeudWA8TXlylo9+Yu9kVga/XXPM bNHQrK0o5Pgu/EpXbtkyAOxdhf2MK8KK13kYXy5IYUWxxsgaVX2MpiEkRvZTjO/FRMUT MHCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=J7fKzO1n; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id u8-20020a1709026e0800b001c60de17b5esi8917497plk.118.2023.10.09.01.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 01:53:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=J7fKzO1n; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id B64928056C65; Mon, 9 Oct 2023 01:53:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345746AbjJIIxR (ORCPT + 99 others); Mon, 9 Oct 2023 04:53:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345754AbjJIIxF (ORCPT ); Mon, 9 Oct 2023 04:53:05 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88FF410E5; Mon, 9 Oct 2023 01:52:17 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 5577721835; Mon, 9 Oct 2023 08:52:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1696841530; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S+ENGRtc9kO336DfttkT+4HSplaWliy8Mo2bgqKSB/E=; b=J7fKzO1nm+oOwsztyCeYtaPIvy797QsY3JttQRQ7ajgueexta+2ZyJfdYXNnvjH7yVd698 5uB+V94le13H5WBXYyth98m08dh1QCOJzMDgGfCzNMXXV//w7YeaFyhz7wkIMn8LGh84be O/ugHH72+rlBSBzsQPCEVF4tPSD4h+s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1696841530; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S+ENGRtc9kO336DfttkT+4HSplaWliy8Mo2bgqKSB/E=; b=+3GyJk/vSzZ/27KkKuztuGDRCAN7YudyxTcWCnP27cTn3Eg6EQXdY8L31/D6Utk9K2+eiR nsWW0/X9H86adAAg== 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 CF3BD2C142; Mon, 9 Oct 2023 08:52:09 +0000 (UTC) Date: Mon, 9 Oct 2023 10:52:08 +0200 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Masahiro Yamada 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 , Nathan Chancellor , Nick Desaulniers Subject: Re: [PATCH rebased] kbuild: rpm-pkg: Fix build with non-default MODLIB Message-ID: <20231009085208.GT6241@kitsune.suse.cz> References: <20231005150728.3429-1-msuchanek@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 groat.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 (groat.vger.email [0.0.0.0]); Mon, 09 Oct 2023 01:53:39 -0700 (PDT) X-Spam-Level: ** Hello, On Mon, Oct 09, 2023 at 05:31:02PM +0900, Masahiro Yamada wrote: > On Fri, Oct 6, 2023 at 12:49 AM 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 > > > In other words, do you want to say > > "If defining this middle part as a variable had been accepted, > this patch would have been unneeded." ? If it were accepted I would not have to guess what the middle part is, and could use the variable that unambiguosly defines it instead. Thanks Michal > > > If your original patch were accepted, how would this patch look like? > > kernel.spec needs to know the module directory somehow. > > > Would you add the following in scripts/package/mkspec ? > > %define MODLIB $(pkg-config --print-variables kmod 2>/dev/null | grep > '^module_directory$' >/dev/null && pkg-config > --variable=module_directory kmod || echo /lib/modules) > > > > > > > > > > > > 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 > > --- > > 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 > > > > > -- > Best Regards > Masahiro Yamada