Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1919322rdb; Mon, 9 Oct 2023 07:08:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFR9351oZzGDUw0FzCD7yFBAssjC0q7AfQq7j1rNNbaILmgGNfMK/0Tec/anvJFWnfoiJLr X-Received: by 2002:a05:6a20:5483:b0:16b:80f2:c234 with SMTP id i3-20020a056a20548300b0016b80f2c234mr12508464pzk.59.1696860481776; Mon, 09 Oct 2023 07:08:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696860481; cv=none; d=google.com; s=arc-20160816; b=CjrWA+Rr9TIVSOfHUWCipOAKRwfFeXWuwjGd1+KRQsScVFSMZMrcKa8dM5L13/V9IV 6YlT8uaMR6lfedu302Lxr87ubayaJ3Dc4w9yq5Xf0lviJt7QR6zC4kYvjrqP572F42eP LvuFZdYgA3DIzoug9Q8R+kW07ZVJ23cUKTgQuXfl3tZovbuimHnXT/L17gIFhCIVqiAO maKnCs7Lk8hXjICWXQS7b84Pf7sY/zd/48ebljGoGgFCM/UBzN+JaukbPffswVI83KzD N7VrjSbx51paoiYk+lnzgDt9IXsIFIOfGtJdVjT68sPDkLAGpGcXaK2lZm+n2smjghdh FXbw== 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=brarWfHZNCZ/eUpQXOhCyTl2NDxbkajiRmJcDbpuHgs=; fh=B3aGKZUjOknTrCzkm3ZqzvoW7atFCwPxoXW6RvZkPRs=; b=gQXz58AReNGsDhjDnMD5dCWW6MzUO1awXGrz88bg87CqGeL5uwWHvScH001E4Ck3Pd z8Q2L3JngQBYRw41FJhGtfNfc54sBSsNDdWIwvTH34n3nqdtm82PjN/Ikq+Da5bviDAc HdBo3rhoI7L8uckVWc2b2dxpvtrUaQ8L9cWNAfztI3tYksi3muzngX5NDwuv8amu2Tk7 Wee4XH9UNtNY5L/eGY8ip0KKG8ukqcL/vl/pLCn+rGvwQEffHpgHbcx5diRxBywn9YRF L4Dyue3tnINW5jP9A8cuyZoLT97yasLMchcsE+6h28SuLtczi4p/jI25/T5nYL9xrEku WNdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=RGKzRlOX; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id c10-20020a056a00248a00b0068ffda29587si7767997pfv.109.2023.10.09.07.08.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 07:08:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=RGKzRlOX; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 3CDFD80ACFC1; Mon, 9 Oct 2023 07:07:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376905AbjJIOHj (ORCPT + 99 others); Mon, 9 Oct 2023 10:07:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376856AbjJIOHi (ORCPT ); Mon, 9 Oct 2023 10:07:38 -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 3F8EC8E; Mon, 9 Oct 2023 07:07:37 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 74A1F1F390; Mon, 9 Oct 2023 14:07:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1696860455; 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=brarWfHZNCZ/eUpQXOhCyTl2NDxbkajiRmJcDbpuHgs=; b=RGKzRlOXXdF7EKqqP/+xuk+g25i4EXFcaoMbDvzg6BeFrjuYE8c6esJrX/5TvdAzobu2qn 7QvS5032wNfNueNtdEZyXeZOzw/QYrSa/lpozcpJ18+GXQ9cnM9ZDgN+WULLd4kdIkJsPT /C8lIyEndmOPKFekJuTI/DYv90GiPaI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1696860455; 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=brarWfHZNCZ/eUpQXOhCyTl2NDxbkajiRmJcDbpuHgs=; b=Gve28qXk8V1AtyFuItekX82mN33W4bquggzI4baM2iWx2XNt1eXjJf/q4al9h8r0WL2LCe svZpALoXkr2vfaBQ== 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 E17502C142; Mon, 9 Oct 2023 14:07:34 +0000 (UTC) Date: Mon, 9 Oct 2023 16:07:33 +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: <20231009140733.GV6241@kitsune.suse.cz> References: <20231005150728.3429-1-msuchanek@suse.de> <20231009085208.GT6241@kitsune.suse.cz> 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 howler.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 (howler.vger.email [0.0.0.0]); Mon, 09 Oct 2023 07:07:59 -0700 (PDT) X-Spam-Level: ** On Mon, Oct 09, 2023 at 09:34:10PM +0900, Masahiro Yamada wrote: > On Mon, Oct 9, 2023 at 5:52 PM Michal Suchánek wrote: > > > > 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. > > > How? > > scripts/package/kernel.spec hardcodes 'lib/modules' > in a couple of places. > > I am asking how to derive the module path. Not sure what you are asking here. The path is hardcoded, everywhere. The current Makefile has MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) and there is no reliable way to learn what the middle part was after the fact - $(INSTALL_MOD_PATH) can be non-empty. The rejected patch was changing this to a variable, and also default to adjusting the content to what kmod exports in pkgconfig after applying a proposed patch to make this hardcoded part configurable: export KERNEL_MODULE_DIRECTORY := $(shell pkg-config --print-variables kmod 2>/dev/null | grep '^module_directory$$' >/dev/null && pkg-config --variable=module_directory kmod || echo /lib/modules) MODLIB = $(INSTALL_MOD_PATH)$(KERNEL_MODULE_DIRECTORY)/$(KERNELRELEASE) It would be completely posible to only define the middle part as a variable that could then be used in rpm-pkg: export KERNEL_MODULE_DIRECTORY := /lib/modules MODLIB = $(INSTALL_MOD_PATH)$(KERNEL_MODULE_DIRECTORY)/$(KERNELRELEASE) Thanks Michal