Skip to contentSkip to conversation

kbuild: use $(srctree) to locate config headers from external modules

PATCH In review Devin J. Pohly 2 participants 4 messages Aug 1, 2014 – Aug 4, 2014 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: use $(srctree) to locate config headers from external modules

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.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index f6a7794..60c14a2 100644
@@ -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.";\
Signature · 1 line
2.0.3
#1 lore raw
Quoted 6 lines · 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.

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

#2 lore raw
Quoted 6 lines · Michal Marek

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

#3 lore raw
Quoted 8 lines · Devin J. Pohly
Quoted 6 lines · Michal Marek

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

Quoted 7 lines

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