Received: by 2002:a05:7412:a9a3:b0:f9:327e:43ab with SMTP id o35csp129933rdh; Mon, 18 Dec 2023 06:24:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKeYA1fO/5r5crhT1ivGru35Zc08RYcz3cbkRUWXn0zK8gO2ZD+SyihNo7YHxYzxnI9AaV X-Received: by 2002:aa7:938f:0:b0:6d4:a05:1e4e with SMTP id t15-20020aa7938f000000b006d40a051e4emr4488502pfe.56.1702909461810; Mon, 18 Dec 2023 06:24:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702909461; cv=none; d=google.com; s=arc-20160816; b=RPnzmr0sWBKhCqjHxpWczSaIU4SnU36uoV7CHZ5mGMYmVtVcT27uXqkZ165dVVHrHK +qejrxPDMDio+fyT8907ZQa6rQ/hQq9FdsJiHHxfe6hWA8jVOkCcHWsnfHqHSaVIMRPL 03b1V5xe6CBF+t9V9QnpRbNactVrNHBEFb/7/1WTw7qplBeeFZEcPgTzh1IBAtohl+GM C1glBBdfETvrelY5INJZw+wXSBajuyKMUaXqzbgDoCpP9V4B10jqwAXmesacOjHu0i5o NjKyhErES5hhkJ8ZkgRXbSUZdbUp18b/aXGsraUKBmdID26ZY3eXCxwcanW5nXJeoZGs L5Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=xFTUf/b5KG1UjaGYwApJDRRbExU38ClFqfnkgLIArbY=; fh=PigGyr0k2UHxlHDObR4tN2IY8Z8lWBCCEIGD12vhblo=; b=Ys5IlkUJw1xwBbFV6s06C3nRMdqp8Iqto2xNFbfnihuhUC9T0vxb1c98H5Uu7iaoDq 7CxWFM0zCRM7O7TbRzaFUdBU53BBvp3GthPOXWv37TQ2THi3p5tA2pE95Kje16dd1iYt VunmdM3SQXy43uF48CPus3+BTbEtZXaQcNFkVA7ZRLIqU5rr8N8MvyOsc9r436oC05IO dwEMOwvCqoTGtpMmoNUIJCQgF+z3G7bAq2o8MXvNKmitq3aVke/aucXS0qU4B49SxpLt Q0cXdNEbfzsyKMowJzyPY+8Lexxra6WEH4vTPQyN0y3tbHgrulvqg8fPOWezFFwiW6ej N5Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lrYkAkoU; spf=pass (google.com: domain of linux-kernel+bounces-3824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3824-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id o25-20020a635a19000000b005cd783d410csi4382746pgb.610.2023.12.18.06.24.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 06:24:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lrYkAkoU; spf=pass (google.com: domain of linux-kernel+bounces-3824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3824-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7BEACB22861 for ; Mon, 18 Dec 2023 14:17:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F9D91D13B; Mon, 18 Dec 2023 14:17:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lrYkAkoU" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 886D7129EF9; Mon, 18 Dec 2023 14:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34ABDC433C9; Mon, 18 Dec 2023 14:17:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702909045; bh=xFTUf/b5KG1UjaGYwApJDRRbExU38ClFqfnkgLIArbY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=lrYkAkoUyEMqTMpXfpDLPgyQ4SlgJDxqngQRnqefEqNcN82dbNT8F/nk1ryeszDRT rlleUJLI/BiXg8KDMQo2S/wQ6cKSDIUGreSmHsklQfDfqJ/V0Ib3pPgRtP4Go+f/K3 GgiIYAxfMylrT8hFlfuHCcPIcIbBWaSu7Dia7miGjxn3guYSL1Of5d5Wb8yVwTv5wS +qc97mti+071/BowoRuTy9APAlDLhl/cXOkjo1tnySsY5ozR65W1l+9iEdDgc70pei W1vCPWCd8L623IPx82onJNBQlPo0UOAjCcT2qKEKmWVR1aCBl4CrzLCm14t6SRQn0Z fKKHL2p23NVBg== Received: by mail-oa1-f52.google.com with SMTP id 586e51a60fabf-1f066fc2a2aso891718fac.0; Mon, 18 Dec 2023 06:17:25 -0800 (PST) X-Gm-Message-State: AOJu0YzgEQgi+NThNSdSwjnerz5ZDOipo39r18CgfO6e5BLT1oDs6lcI EKos2e1usE4EoOGv+7YfvBN06ngd7m1ol4ezi6Y= X-Received: by 2002:a05:6871:a90e:b0:1fb:75b:2b80 with SMTP id wn14-20020a056871a90e00b001fb075b2b80mr9048238oab.60.1702909044529; Mon, 18 Dec 2023 06:17:24 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231210210859.GN9696@kitsune.suse.cz> <20231212131219.GQ9696@kitsune.suse.cz> In-Reply-To: <20231212131219.GQ9696@kitsune.suse.cz> From: Masahiro Yamada Date: Mon, 18 Dec 2023 23:16:48 +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 On Tue, Dec 12, 2023 at 10:12=E2=80=AFPM Michal Such=C3=A1nek wrote: > > On Mon, Dec 11, 2023 at 01:33:23PM +0900, Masahiro Yamada wrote: > > 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)/$(KERNEL= RELEASE) > > > > > > > > > > However, the kernel.spec hadcodes the default value of > > > > > $(KERNEL_MODULE_DIRECTORY), and changed value is not reflected wh= en > > > > > 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 decisio= n. > > > > '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. > > There is. It's the ?=3D in the top Makefile. Nope. Only Kbuild follows the specified KERNEL_MODULE_DIRECTORY. depmod still uses the MODULE_DRECTORY determined when it was compiled. > > Currently the test that determines the module directory uses make logic > so it's not possible to pass on the shell magic before executing it so > it could be executed inside the rpm spec file as well. > > OUtsourcing it into an external script would mean that the sources need > to be unpacked before the script can be executed. That would require > using dynamically generated file list in the spec file because the > module location would not be known at spec parse time. Possible but > convoluted. I do not require that. This is simple; builders must follow the packager's decision. To make it work, depmod must follow MODULE_DIRECTORY given from an external environment. > In the end I do not think this is a problem that needs solving. Most > distributions that build kernel packages would use their own packaging > files, not rpm-pkg. That limits rpm-pkg to ad-hoc use when people want > to build one-off test kernel. It's reasonable to do on the same > distribution as the target system. The option to do so on a distribution > with different module directory is available if somebody really needs > that. > > Thanks > > Michal --=20 Best Regards Masahiro Yamada