Linux-PM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/1] kbuild: Support building a tree of modules with -M=<root>
@ 2019-08-09  0:21 Shaun Tancheff
  2019-08-09  0:21 ` [PATCH 1/1] kbuild: recursive build of external kernel modules Shaun Tancheff
  0 siblings, 1 reply; 6+ messages in thread
From: Shaun Tancheff @ 2019-08-09  0:21 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Shaun Tancheff, linux-kbuild, Joe Lawrence,
	James E . J . Bottomley, Jonathan Corbet, Martin K . Petersen,
	Michal Marek, Shuah Khan, Thomas Renninger, linux-doc,
	linux-kernel, linux-pm, linux-scsi

Currently when building lustre against 5.3 kernel modules fail to
generate <module>.ko files.

Lustre builds a tree of modules however the numerous modules.order files
are created but only the modules.order file at the root appears to be 
read.

This changes the the scheme for KBUILD_EXTMOD to write to and read from
a single modules.order file at the root.

Shaun Tancheff (1):
  kbuild: recursive build of external kernel modules

 Makefile               | 1 +
 scripts/Makefile.build | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] kbuild: recursive build of external kernel modules
  2019-08-09  0:21 [PATCH 0/1] kbuild: Support building a tree of modules with -M=<root> Shaun Tancheff
@ 2019-08-09  0:21 ` Shaun Tancheff
  2019-08-12 15:23   ` Masahiro Yamada
  0 siblings, 1 reply; 6+ messages in thread
From: Shaun Tancheff @ 2019-08-09  0:21 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Shaun Tancheff, linux-kbuild, Joe Lawrence,
	James E . J . Bottomley, Jonathan Corbet, Martin K . Petersen,
	Michal Marek, Shuah Khan, Thomas Renninger, linux-doc,
	linux-kernel, linux-pm, linux-scsi

When building a tree of external modules stage 2 fails
silently as the root modules.order is empty.

Modify the modules.order location to be fixed to the
root when KBUILD_EXTMOD is specified and write all
module paths to the single modules.order file.

Signed-off-by: Shaun Tancheff <stancheff@cray.com>
---
 Makefile               | 1 +
 scripts/Makefile.build | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 23cdf1f41364..a9964492f47e 100644
--- a/Makefile
+++ b/Makefile
@@ -1622,6 +1622,7 @@ $(module-dirs): prepare $(objtree)/Module.symvers
 
 modules: $(module-dirs)
 	@$(kecho) '  Building modules, stage 2.';
+	$(Q)$rm -f $(KBUILD_EXTMOD)/modules.order
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
 
 PHONY += modules_install
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 0d434d0afc0b..f9908b3d59e0 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -64,7 +64,13 @@ builtin-target := $(obj)/built-in.a
 endif
 
 ifeq ($(CONFIG_MODULES)$(need-modorder),y1)
+ifneq ($(KBUILD_EXTMOD),)
+modorder-target := $(KBUILD_EXTMOD)/modules.order
+modorder-add := >>
+else
 modorder-target := $(obj)/modules.order
+modorder-add := >
+endif
 endif
 
 mod-targets := $(patsubst %.o, %.mod, $(obj-m))
@@ -423,7 +429,7 @@ endif # builtin-target
 $(modorder-target): $(subdir-ym) FORCE
 	$(Q){ $(foreach m, $(modorder), \
 	$(if $(filter %/modules.order, $m), cat $m, echo $m);) :; } \
-	| $(AWK) '!x[$$0]++' - > $@
+	| $(AWK) '!x[$$0]++' - $(modorder-add) $@
 
 #
 # Rule to compile a set of .o files into one .a file (with symbol table)
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] kbuild: recursive build of external kernel modules
  2019-08-09  0:21 ` [PATCH 1/1] kbuild: recursive build of external kernel modules Shaun Tancheff
@ 2019-08-12 15:23   ` Masahiro Yamada
  2019-08-12 17:34     ` Shaun Tancheff
  0 siblings, 1 reply; 6+ messages in thread
From: Masahiro Yamada @ 2019-08-12 15:23 UTC (permalink / raw)
  To: Shaun Tancheff
  Cc: Shaun Tancheff, Linux Kbuild mailing list, Joe Lawrence,
	James E . J . Bottomley, Jonathan Corbet, Martin K . Petersen,
	Michal Marek, Shuah Khan, Thomas Renninger,
	open list:DOCUMENTATION, Linux Kernel Mailing List,
	Linux PM mailing list, linux-scsi

On Fri, Aug 9, 2019 at 9:21 AM Shaun Tancheff <shaun@tancheff.com> wrote:
>
> When building a tree of external modules stage 2 fails
> silently as the root modules.order is empty.
>
> Modify the modules.order location to be fixed to the
> root when KBUILD_EXTMOD is specified and write all
> module paths to the single modules.order file.

Could you try v5.3-rc4 please?




> Signed-off-by: Shaun Tancheff <stancheff@cray.com>
> ---
>  Makefile               | 1 +
>  scripts/Makefile.build | 8 +++++++-
>  2 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 23cdf1f41364..a9964492f47e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1622,6 +1622,7 @@ $(module-dirs): prepare $(objtree)/Module.symvers
>
>  modules: $(module-dirs)
>         @$(kecho) '  Building modules, stage 2.';
> +       $(Q)$rm -f $(KBUILD_EXTMOD)/modules.order
>         $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
>
>  PHONY += modules_install
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 0d434d0afc0b..f9908b3d59e0 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -64,7 +64,13 @@ builtin-target := $(obj)/built-in.a
>  endif
>
>  ifeq ($(CONFIG_MODULES)$(need-modorder),y1)
> +ifneq ($(KBUILD_EXTMOD),)
> +modorder-target := $(KBUILD_EXTMOD)/modules.order
> +modorder-add := >>
> +else
>  modorder-target := $(obj)/modules.order
> +modorder-add := >
> +endif
>  endif
>
>  mod-targets := $(patsubst %.o, %.mod, $(obj-m))
> @@ -423,7 +429,7 @@ endif # builtin-target
>  $(modorder-target): $(subdir-ym) FORCE
>         $(Q){ $(foreach m, $(modorder), \
>         $(if $(filter %/modules.order, $m), cat $m, echo $m);) :; } \
> -       | $(AWK) '!x[$$0]++' - > $@
> +       | $(AWK) '!x[$$0]++' - $(modorder-add) $@
>
>  #
>  # Rule to compile a set of .o files into one .a file (with symbol table)
> --
> 2.20.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] kbuild: recursive build of external kernel modules
  2019-08-12 15:23   ` Masahiro Yamada
@ 2019-08-12 17:34     ` Shaun Tancheff
  2019-08-13  1:06       ` Masahiro Yamada
  0 siblings, 1 reply; 6+ messages in thread
From: Shaun Tancheff @ 2019-08-12 17:34 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Shaun Tancheff, Linux Kbuild mailing list, Joe Lawrence,
	James E . J . Bottomley, Jonathan Corbet, Martin K . Petersen,
	Michal Marek, Shuah Khan, Thomas Renninger,
	open list:DOCUMENTATION, Linux Kernel Mailing List,
	Linux PM mailing list, linux-scsi

On Mon, Aug 12, 2019 at 10:24 AM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> On Fri, Aug 9, 2019 at 9:21 AM Shaun Tancheff <shaun@tancheff.com> wrote:
> >
> > When building a tree of external modules stage 2 fails
> > silently as the root modules.order is empty.
> >
> > Modify the modules.order location to be fixed to the
> > root when KBUILD_EXTMOD is specified and write all
> > module paths to the single modules.order file.
>
> Could you try v5.3-rc4 please?

So it seems we are using 'subdir-m' but that is now gone?

Is there a recommend pattern for backward compatibility?

Thanks!
>
> > Signed-off-by: Shaun Tancheff <stancheff@cray.com>
> > ---
> >  Makefile               | 1 +
> >  scripts/Makefile.build | 8 +++++++-
> >  2 files changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/Makefile b/Makefile
> > index 23cdf1f41364..a9964492f47e 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -1622,6 +1622,7 @@ $(module-dirs): prepare $(objtree)/Module.symvers
> >
> >  modules: $(module-dirs)
> >         @$(kecho) '  Building modules, stage 2.';
> > +       $(Q)$rm -f $(KBUILD_EXTMOD)/modules.order
> >         $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
> >
> >  PHONY += modules_install
> > diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> > index 0d434d0afc0b..f9908b3d59e0 100644
> > --- a/scripts/Makefile.build
> > +++ b/scripts/Makefile.build
> > @@ -64,7 +64,13 @@ builtin-target := $(obj)/built-in.a
> >  endif
> >
> >  ifeq ($(CONFIG_MODULES)$(need-modorder),y1)
> > +ifneq ($(KBUILD_EXTMOD),)
> > +modorder-target := $(KBUILD_EXTMOD)/modules.order
> > +modorder-add := >>
> > +else
> >  modorder-target := $(obj)/modules.order
> > +modorder-add := >
> > +endif
> >  endif
> >
> >  mod-targets := $(patsubst %.o, %.mod, $(obj-m))
> > @@ -423,7 +429,7 @@ endif # builtin-target
> >  $(modorder-target): $(subdir-ym) FORCE
> >         $(Q){ $(foreach m, $(modorder), \
> >         $(if $(filter %/modules.order, $m), cat $m, echo $m);) :; } \
> > -       | $(AWK) '!x[$$0]++' - > $@
> > +       | $(AWK) '!x[$$0]++' - $(modorder-add) $@
> >
> >  #
> >  # Rule to compile a set of .o files into one .a file (with symbol table)
> > --
> > 2.20.1
> >
>
>
> --
> Best Regards
> Masahiro Yamada

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] kbuild: recursive build of external kernel modules
  2019-08-12 17:34     ` Shaun Tancheff
@ 2019-08-13  1:06       ` Masahiro Yamada
  2019-08-13 22:10         ` Shaun Tancheff
  0 siblings, 1 reply; 6+ messages in thread
From: Masahiro Yamada @ 2019-08-13  1:06 UTC (permalink / raw)
  To: Shaun Tancheff
  Cc: Shaun Tancheff, Linux Kbuild mailing list, Joe Lawrence,
	James E . J . Bottomley, Jonathan Corbet, Martin K . Petersen,
	Michal Marek, Shuah Khan, Thomas Renninger,
	open list:DOCUMENTATION, Linux Kernel Mailing List,
	Linux PM mailing list, linux-scsi

On Tue, Aug 13, 2019 at 2:34 AM Shaun Tancheff <shaun@tancheff.com> wrote:
>
> On Mon, Aug 12, 2019 at 10:24 AM Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
> >
> > On Fri, Aug 9, 2019 at 9:21 AM Shaun Tancheff <shaun@tancheff.com> wrote:
> > >
> > > When building a tree of external modules stage 2 fails
> > > silently as the root modules.order is empty.
> > >
> > > Modify the modules.order location to be fixed to the
> > > root when KBUILD_EXTMOD is specified and write all
> > > module paths to the single modules.order file.
> >
> > Could you try v5.3-rc4 please?
>
> So it seems we are using 'subdir-m' but that is now gone?
>
> Is there a recommend pattern for backward compatibility?
>
> Thanks!


Please convert

subdir-m += dir1
subdir-m += dir2

into

obj-m += dir1/
obj-m += dir2/


Thanks.

-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] kbuild: recursive build of external kernel modules
  2019-08-13  1:06       ` Masahiro Yamada
@ 2019-08-13 22:10         ` Shaun Tancheff
  0 siblings, 0 replies; 6+ messages in thread
From: Shaun Tancheff @ 2019-08-13 22:10 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Shaun Tancheff, Linux Kbuild mailing list, Joe Lawrence,
	James E . J . Bottomley, Jonathan Corbet, Martin K . Petersen,
	Michal Marek, Shuah Khan, Thomas Renninger,
	open list:DOCUMENTATION, Linux Kernel Mailing List,
	Linux PM mailing list, linux-scsi

On Mon, Aug 12, 2019 at 8:07 PM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> On Tue, Aug 13, 2019 at 2:34 AM Shaun Tancheff <shaun@tancheff.com> wrote:
> >
> > On Mon, Aug 12, 2019 at 10:24 AM Masahiro Yamada
> > <yamada.masahiro@socionext.com> wrote:
> > >
> > > On Fri, Aug 9, 2019 at 9:21 AM Shaun Tancheff <shaun@tancheff.com> wrote:
> > > >
> > > > When building a tree of external modules stage 2 fails
> > > > silently as the root modules.order is empty.
> > > >
> > > > Modify the modules.order location to be fixed to the
> > > > root when KBUILD_EXTMOD is specified and write all
> > > > module paths to the single modules.order file.
> > >
> > > Could you try v5.3-rc4 please?
> >
> > So it seems we are using 'subdir-m' but that is now gone?
> >
> > Is there a recommend pattern for backward compatibility?
> >
> > Thanks!
>
>
> Please convert
>
> subdir-m += dir1
> subdir-m += dir2
>
> into
>
> obj-m += dir1/
> obj-m += dir2/

After working through some local quirks everything is working now.
Thanks!

>
>
> Thanks.
>
> --
> Best Regards
> Masahiro Yamada

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09  0:21 [PATCH 0/1] kbuild: Support building a tree of modules with -M=<root> Shaun Tancheff
2019-08-09  0:21 ` [PATCH 1/1] kbuild: recursive build of external kernel modules Shaun Tancheff
2019-08-12 15:23   ` Masahiro Yamada
2019-08-12 17:34     ` Shaun Tancheff
2019-08-13  1:06       ` Masahiro Yamada
2019-08-13 22:10         ` Shaun Tancheff

Linux-PM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-pm/0 linux-pm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pm linux-pm/ https://lore.kernel.org/linux-pm \
		linux-pm@vger.kernel.org linux-pm@archiver.kernel.org
	public-inbox-index linux-pm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-pm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox