linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: "Michal Suchánek" <msuchanek@suse.de>
Cc: linux-modules@vger.kernel.org, "Takashi Iwai" <tiwai@suse.com>,
	"Lucas De Marchi" <lucas.de.marchi@gmail.com>,
	"Michal Koutný" <mkoutny@suse.com>,
	"Jiri Slaby" <jslaby@suse.com>,
	"Jan Engelhardt" <jengelh@inai.de>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Nicolas Schier" <nicolas@fjasle.eu>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/2] kbuild: rpm-pkg: Fix build with non-default MODLIB
Date: Mon, 18 Dec 2023 23:16:48 +0900	[thread overview]
Message-ID: <CAK7LNASb4Gt-pQncBv3KLG=P1UtehgHNCgY8XeaQ_vfdUuSQRg@mail.gmail.com> (raw)
In-Reply-To: <20231212131219.GQ9696@kitsune.suse.cz>

On Tue, Dec 12, 2023 at 10:12 PM Michal Suchánek <msuchanek@suse.de> wrote:
>
> On Mon, Dec 11, 2023 at 01:33:23PM +0900, Masahiro Yamada wrote:
> > On Mon, Dec 11, 2023 at 6:09 AM Michal Suchánek <msuchanek@suse.de> wrote:
> > >
> > > On Mon, Dec 11, 2023 at 03:44:35AM +0900, Masahiro Yamada wrote:
> > > > On Thu, Dec 7, 2023 at 4:48 AM Michal Suchanek <msuchanek@suse.de> wrote:
> > > > >
> > > > > The default MODLIB value is composed of three variables
> > > > >
> > > > > MODLIB = $(INSTALL_MOD_PATH)$(KERNEL_MODULE_DIRECTORY)/$(KERNELRELEASE)
> > > > >
> > > > > 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 <msuchanek@suse.de>
> > > > > ---
> > > > > 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.
>
> There is. It's the ?= 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



-- 
Best Regards
Masahiro Yamada

      reply	other threads:[~2023-12-18 14:17 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05 15:07 [PATCH rebased] kbuild: rpm-pkg: Fix build with non-default MODLIB Michal Suchanek
2023-10-06 16:58 ` Nathan Chancellor
2023-10-09  8:31 ` Masahiro Yamada
2023-10-09  8:52   ` Michal Suchánek
2023-10-09 12:34     ` Masahiro Yamada
2023-10-09 14:07       ` Michal Suchánek
2023-10-09 15:14         ` Masahiro Yamada
2023-10-09 16:01           ` Jan Engelhardt
2023-10-10 10:15           ` Michal Suchánek
2023-10-17 10:15             ` Masahiro Yamada
2023-10-17 10:44               ` Michal Suchánek
2023-10-17 12:05                 ` Masahiro Yamada
2023-10-17 12:27                   ` Michal Suchánek
2023-10-17 14:46                     ` Masahiro Yamada
2023-10-17 15:10                       ` Michal Suchánek
2023-10-18  1:12                         ` Jan Engelhardt
2023-11-10 17:44                           ` Michal Suchánek
2023-11-10 17:57                             ` Jan Engelhardt
2023-12-06 19:47                       ` [PATCH v6 1/2] depmod: Handle installing modules under a different directory Michal Suchanek
2023-12-10 18:43                         ` Masahiro Yamada
2023-12-10 18:51                           ` Woody Suwalski
2023-12-10 21:07                           ` Michal Suchánek
2023-12-11  4:29                             ` Masahiro Yamada
2023-12-12 13:03                               ` Michal Suchánek
2023-12-18 14:05                                 ` Masahiro Yamada
2023-12-06 19:47                       ` [PATCH v6 2/2] kbuild: rpm-pkg: Fix build with non-default MODLIB Michal Suchanek
2023-12-10 18:44                         ` Masahiro Yamada
2023-12-10 21:08                           ` Michal Suchánek
2023-12-11  4:33                             ` Masahiro Yamada
2023-12-12 13:12                               ` Michal Suchánek
2023-12-18 14:16                                 ` Masahiro Yamada [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK7LNASb4Gt-pQncBv3KLG=P1UtehgHNCgY8XeaQ_vfdUuSQRg@mail.gmail.com' \
    --to=masahiroy@kernel.org \
    --cc=jengelh@inai.de \
    --cc=jslaby@suse.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=lucas.de.marchi@gmail.com \
    --cc=mkoutny@suse.com \
    --cc=msuchanek@suse.de \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).