From patchwork Thu Oct 5 15:07:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Michal_Such=C3=A1nek?= X-Patchwork-Id: 148818 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2016:b0:403:3b70:6f57 with SMTP id fe22csp392158vqb; Thu, 5 Oct 2023 08:51:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEWNDufJD+HgxxATRBQAS+bsAyeiMuBBEBllNBftOwD2qrGjp0uNW3CWGsiZXx2zCK630Xq X-Received: by 2002:a17:902:db11:b0:1c3:432f:9f69 with SMTP id m17-20020a170902db1100b001c3432f9f69mr5264903plx.23.1696521116221; Thu, 05 Oct 2023 08:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696521116; cv=none; d=google.com; s=arc-20160816; b=jzUAMy4JYkoOKFy9F/WWwjOifN4h3UG2NsJFvOxeY4U5C4dt2qnNfBMcCnWLMdh9IL k8r9W9mv4YGaiXW1duLbD/31b3qZ+HiU4BlmMFIw17a/E9bGrU+sXZ6B2q6okhPz1Xdu YruW0PbTG9+4zO2v4eFCiwoR2Xfa0P4J/T8uF5LkBZbaD8KwYOAHiv3uHYDSXM+Vr8Ec bmWLZEK0Jmyd8HjhWit/SdwfbY5X8AH9prdWSIZlGho8ACv0gJKCGGqTntbW8xCC3nyh YuqWc59TxxSTLc7YIs7CkTdw/SKTJx1ZWeQVlTSPR4H+QgGX61lqCayzV+D/TMHbWtcQ hWWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=yZlU7QN0oRlDYYCQ2eW8q/GdWjqvw1DcFTvoKMkfVz8=; fh=7ByzS/mEoQQEEIPtamNSKJQ9KKVcLMvzVSazzOrE35g=; b=ZIgpCFS8YahFrUaAiVd3iBr6pa5ddOrKKSya6Lj16/q2rshD9iKXc0MuF1AlF1Nljt Oetum39m7ODZxVMpsfHhA23+meRJTdLvWtb2gVNyBSvBdpVtfxwGPJB0r0PcX4mQqiE3 dMdkxUDGoBdUKU3a1LgLOiLeP2IKp7Ts7sqZX8J0+ZnaiwPglKOSocQlsqdrq4qkLYok siaGb9PTrz1F2IgGnU4RiJIGWvvo2u3G+Sqx3GDpdo6EDzozz9ipaV2eUhlrfMhj7e7z bqa1PlX8ciISZFFTphO1SWXfyVPZJXB8K3C9vXMM61bTLlrMVqiJqEnxMsz4jQp3Q6DF PEbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ov2VnqDI; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id q5-20020a170902dac500b001c6d1940305si1824394plx.532.2023.10.05.08.51.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 08:51:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ov2VnqDI; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id BC6C3840530D; Thu, 5 Oct 2023 08:51:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234135AbjJEPt4 (ORCPT + 19 others); Thu, 5 Oct 2023 11:49:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234569AbjJEPtF (ORCPT ); Thu, 5 Oct 2023 11:49:05 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46E078C37; Thu, 5 Oct 2023 08:07:49 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id D89EF1F38D; Thu, 5 Oct 2023 15:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1696518467; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=yZlU7QN0oRlDYYCQ2eW8q/GdWjqvw1DcFTvoKMkfVz8=; b=ov2VnqDIVSqkpksz2LmAeiGObLWtzfZogfmYV5AAr9s9quUiBPRZJ71FwxA7JmI/K/kjDU 6SC1JbcUjWGz5lhROAqphQuenK7OdwFHGKbZgSZ5Rvh3zB7CTnaJGtf9nlaamenUZWbF0H qWL9j/y9ZM00hKDMDocR3eQYp9hyGfE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1696518467; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=yZlU7QN0oRlDYYCQ2eW8q/GdWjqvw1DcFTvoKMkfVz8=; b=ZhTwBZlLV3Jc4irtOEOMLaKr2L3qMg95Ll4Tmq+LMYA9lxj9Myk5tq4YKSYhsTc6vkOe8O AEqAHUMSIL58k7DQ== Received: from kitsune.suse.cz (kitsune.suse.cz [10.100.12.127]) by relay2.suse.de (Postfix) with ESMTP id 63D052C143; Thu, 5 Oct 2023 15:07:47 +0000 (UTC) From: Michal Suchanek To: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Nicolas Schier , 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 , Michal Suchanek Subject: [PATCH rebased] kbuild: rpm-pkg: Fix build with non-default MODLIB Date: Thu, 5 Oct 2023 17:07:28 +0200 Message-ID: <20231005150728.3429-1-msuchanek@suse.de> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Thu, 05 Oct 2023 08:51:30 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778931326180938141 X-GMAIL-MSGID: 1778931326180938141 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 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<