linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Schier <nicolas@fjasle.eu>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [PATCH 6/8] kbuild: move more module installation code to scripts/Makefile.modinst
Date: Tue, 29 Aug 2023 05:50:52 +0200	[thread overview]
Message-ID: <ZO1rHGjch2s1Mitt@bergen.fjasle.eu> (raw)
In-Reply-To: <CAK7LNAQ=5x+zOApY95Oqen0tyfVthb7QYjeskgQmUqGBDtSoiw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3139 bytes --]

On Tue 29 Aug 2023 11:35:41 GMT, Masahiro Yamada wrote:
> On Tue, Aug 29, 2023 at 11:15 AM Nicolas Schier <nicolas@fjasle.eu> wrote:
> >
> > On Wed 23 Aug 2023 20:50:46 GMT, Masahiro Yamada wrote:
> > > Move more relevant code to scripts/Makefile.modinst.
> > >
> > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > > ---
> > >
> > >  Makefile                 | 34 +++++++--------------------------
> > >  scripts/Makefile.modinst | 41 +++++++++++++++++++++++++++++++++++++---
> > >  2 files changed, 45 insertions(+), 30 deletions(-)
> > >
> > > diff --git a/Makefile b/Makefile
> > > index 7d9cab3d2186..82d22debf6c9 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -1477,24 +1477,6 @@ endif
> > >
> > >  endif # CONFIG_MODULES
> > >
> > > -modinst_pre :=
> > > -ifneq ($(filter modules_install,$(MAKECMDGOALS)),)
> > > -modinst_pre := __modinst_pre
> > > -endif
> > > -
> > > -modules_install: $(modinst_pre)
> > > -PHONY += __modinst_pre
> > > -__modinst_pre:
> > > -     @rm -rf $(MODLIB)/kernel
> > > -     @rm -f $(MODLIB)/build
> > > -     @mkdir -p $(MODLIB)
> > > -ifdef CONFIG_MODULES
> > > -     @ln -s $(CURDIR) $(MODLIB)/build
> > > -     @sed 's:^\(.*\)\.o$$:kernel/\1.ko:' modules.order > $(MODLIB)/modules.order
> > > -endif
> > > -     @cp -f modules.builtin $(MODLIB)/
> > > -     @cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
> > > -
> > >  ###
> > >  # Cleaning is done on three levels.
> > >  # make clean     Delete most generated files
> > > @@ -1836,12 +1818,15 @@ help:
> > >       @echo  '  clean           - remove generated files in module directory only'
> > >       @echo  ''
> > >
> > > +ifndef CONFIG_MODULES
> > > +modules modules_install: __external_modules_error
> > >  __external_modules_error:
> > >       @echo >&2 '***'
> > >       @echo >&2 '*** The present kernel disabled CONFIG_MODULES.'
> > >       @echo >&2 '*** You cannot build or install external modules.'
> > >       @echo >&2 '***'
> > >       @false
> > > +endif
> > >
> > >  endif # KBUILD_EXTMOD
> > >
> > > @@ -1850,6 +1835,9 @@ endif # KBUILD_EXTMOD
> > >
> > >  PHONY += modules modules_install modules_prepare
> > >
> > > +modules_install:
> > > +     $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
> >
> > I was a bit surprised to see 'modules_install' being allowed
> > unconditionally for in-tree usage (thus, even if CONFIG_MODULES=n), but
> > then realised that this is the same behaviour as we had before.  Out of
> > curiosity:  _why_ do we need to install
> > $(MODLIB)/modules.builtin{,.modinfo} also for configs w/
> > CONFIG_MODULES=n?
> 
> 
> I see your tags in commit
> 8ae071fc216a25f4f797f33c56857f4dd6b4408e    :)
> 
> 
> Some drivers need to load firmware.
> 
> To make such drivers working in initrd,
> mkinitramfs needs to copy necessary firmware files
> into the initrd.
> So, the tool needs to know which drivers are enabled.
> 
> That is my understanding why modules.builtin(.modinfo)
> is needed even with CONFIG_MODULES=n.

Ups, yes.  Thanks for the reminder!

Kind regards,
Nicolas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-08-29  3:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23 11:50 [PATCH 1/8] kbuild: do not run depmod for 'make modules_sign' Masahiro Yamada
2023-08-23 11:50 ` [PATCH 2/8] kbuild: add modules_sign to no-{compiler,sync-config}-targets Masahiro Yamada
2023-08-23 19:53   ` Nicolas Schier
2023-08-23 11:50 ` [PATCH 3/8] kbuild: move depmod rule to scripts/Makefile.modinst Masahiro Yamada
2023-08-23 19:53   ` Nicolas Schier
2023-08-26 13:50     ` Masahiro Yamada
2023-08-23 11:50 ` [PATCH 4/8] kbuild: remove $(MODLIB)/source symlink Masahiro Yamada
2023-08-23 20:17   ` Nicolas Schier
2023-08-23 11:50 ` [PATCH 5/8] kbuild: reduce the number of mkdir calls during modules_install Masahiro Yamada
2023-08-23 20:22   ` Nicolas Schier
2023-08-23 11:50 ` [PATCH 6/8] kbuild: move more module installation code to scripts/Makefile.modinst Masahiro Yamada
2023-08-28 14:25   ` Nicolas Schier
2023-08-29  2:35     ` Masahiro Yamada
2023-08-29  3:50       ` Nicolas Schier [this message]
2023-08-23 11:50 ` [PATCH 7/8] kbuild: support 'make modules_sign' with CONFIG_MODULE_SIG_ALL=n Masahiro Yamada
2023-08-28 14:31   ` Nicolas Schier
2023-08-23 11:50 ` [PATCH 8/8] kbuild: support modules_sign for external modules as well Masahiro Yamada
2023-08-28 14:52   ` Nicolas Schier
2023-08-23 19:52 ` [PATCH 1/8] kbuild: do not run depmod for 'make modules_sign' Nicolas Schier
2023-08-26 13:36   ` Masahiro Yamada

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=ZO1rHGjch2s1Mitt@bergen.fjasle.eu \
    --to=nicolas@fjasle.eu \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.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).