linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] kbuild: use $(srctree) to locate config headers from external modules
@ 2014-08-01 19:47 Devin J. Pohly
  2014-08-04 14:10 ` Michal Marek
  0 siblings, 1 reply; 4+ messages in thread
From: Devin J. Pohly @ 2014-08-01 19:47 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild, linux-kernel, Devin J. Pohly

When making modules_install for an out-of-tree module, the current
directory is $(KBUILD_OUTPUT), and the Makefile recipe which verifies
the existence of files in include/config is unable to find them using a
relative path.  This leads to a spurious and puzzling "Kernel
configuration is invalid" warning when no configuration is actually
needed.

Since the file check is done in a recipe with `test -e' rather than as a
target or include, the usual search paths provided by VPATH and -I are
not consulted, so an explicit path is needed in this case.

Signed-off-by: Devin J. Pohly <djpohly+linux@gmail.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index f6a7794..60c14a2 100644
--- a/Makefile
+++ b/Makefile
@@ -590,7 +590,7 @@ else
 PHONY += include/config/auto.conf
 
 include/config/auto.conf:
-	$(Q)test -e include/generated/autoconf.h -a -e $@ || (		\
+	$(Q)test -e $(srctree)/include/generated/autoconf.h -a -e $(srctree)/$@ || (		\
 	echo >&2;							\
 	echo >&2 "  ERROR: Kernel configuration is invalid.";		\
 	echo >&2 "         include/generated/autoconf.h or $@ are missing.";\
-- 
2.0.3


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

* Re: [PATCH 1/1] kbuild: use $(srctree) to locate config headers from external modules
  2014-08-01 19:47 [PATCH 1/1] kbuild: use $(srctree) to locate config headers from external modules Devin J. Pohly
@ 2014-08-04 14:10 ` Michal Marek
  2014-08-04 14:43   ` Devin J. Pohly
  0 siblings, 1 reply; 4+ messages in thread
From: Michal Marek @ 2014-08-04 14:10 UTC (permalink / raw)
  To: Devin J. Pohly; +Cc: linux-kbuild, linux-kernel, Devin J. Pohly

On 2014-08-01 21:47, Devin J. Pohly wrote:
> When making modules_install for an out-of-tree module, the current
> directory is $(KBUILD_OUTPUT), and the Makefile recipe which verifies
> the existence of files in include/config is unable to find them using a
> relative path.  This leads to a spurious and puzzling "Kernel
> configuration is invalid" warning when no configuration is actually
> needed.

include/generated is located in $(KBUILD_OUTPUT), which is different
from $(srctree) when using O=. Can you post a sequence of commands that
leads to the error you are seeing?

Thanks,
Michal

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

* Re: [PATCH 1/1] kbuild: use $(srctree) to locate config headers from external modules
  2014-08-04 14:10 ` Michal Marek
@ 2014-08-04 14:43   ` Devin J. Pohly
  2014-08-04 14:53     ` Michal Marek
  0 siblings, 1 reply; 4+ messages in thread
From: Devin J. Pohly @ 2014-08-04 14:43 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild, linux-kernel

On Mon, Aug 04, 2014 at 04:10:20PM +0200, Michal Marek wrote:
> include/generated is located in $(KBUILD_OUTPUT), which is different
> from $(srctree) when using O=. Can you post a sequence of commands that
> leads to the error you are seeing?
> 
> Thanks,
> Michal

Well, I was attempting to do something like this:

$ make -C $KDIR M=$PWD modules
$ make -C $KDIR M=$PWD O=$pkgdir modules_install

... but I your statement just made the problem really obvious: I don't
need to be using O= at all in this case.  Duh.

$ make -C $KDIR M=$PWD modules
$ make -C $KDIR M=$PWD INSTALL_MOD_PATH=$pkgdir modules_install

works as expected, and the only patch needed was to my brain. :)  Mea
culpa.

*dp


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

* Re: [PATCH 1/1] kbuild: use $(srctree) to locate config headers from external modules
  2014-08-04 14:43   ` Devin J. Pohly
@ 2014-08-04 14:53     ` Michal Marek
  0 siblings, 0 replies; 4+ messages in thread
From: Michal Marek @ 2014-08-04 14:53 UTC (permalink / raw)
  To: Devin J. Pohly; +Cc: linux-kbuild, linux-kernel

On 2014-08-04 16:43, Devin J. Pohly wrote:
> On Mon, Aug 04, 2014 at 04:10:20PM +0200, Michal Marek wrote:
>> include/generated is located in $(KBUILD_OUTPUT), which is different
>> from $(srctree) when using O=. Can you post a sequence of commands that
>> leads to the error you are seeing?
>>
>> Thanks,
>> Michal
> 
> Well, I was attempting to do something like this:
> 
> $ make -C $KDIR M=$PWD modules
> $ make -C $KDIR M=$PWD O=$pkgdir modules_install
> 
> ... but I your statement just made the problem really obvious: I don't
> need to be using O= at all in this case.  Duh.

Right, the directory you use in make -C ... M=$PWD when building an out
of tree module is the directory you used in make O=... when building the
kernel.

Michal

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

end of thread, other threads:[~2014-08-04 14:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-01 19:47 [PATCH 1/1] kbuild: use $(srctree) to locate config headers from external modules Devin J. Pohly
2014-08-04 14:10 ` Michal Marek
2014-08-04 14:43   ` Devin J. Pohly
2014-08-04 14:53     ` Michal Marek

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).