Commit 9ee4e3365dd0dab4c1e02fe44dc08a223b826c72

Authored by Sam Ravnborg
1 parent 58a2f7d85a

kbuild: external modules shall not check config consistency

external modules needs include/linux/autoconf.h and include/config/auto.conf
but skip the integrity test of these. Even with a newer Kconfig file we
shall just proceed since external modules simply uses the kernel source and
shall not attempt to modify it.
Error out if a config fiel is missing since they are mandatory.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

Showing 1 changed file with 18 additions and 6 deletions Side-by-side Diff

... ... @@ -436,12 +436,13 @@
436 436 endif # KBUILD_EXTMOD
437 437  
438 438 ifeq ($(dot-config),1)
439   -# In this section, we need .config
  439 +# Read in config
  440 +-include include/config/auto.conf
440 441  
  442 +ifeq ($(KBUILD_EXTMOD),)
441 443 # Read in dependencies to all Kconfig* files, make sure to run
442 444 # oldconfig if changes are detected.
443 445 -include include/config/auto.conf.cmd
444   --include include/config/auto.conf
445 446  
446 447 # To avoid any implicit rule to kick in, define an empty command
447 448 $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
448 449  
449 450  
450 451  
... ... @@ -451,16 +452,27 @@
451 452 # if auto.conf.cmd is missing then we are probably in a cleaned tree so
452 453 # we execute the config step to be sure to catch updated Kconfig files
453 454 include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
454   -ifeq ($(KBUILD_EXTMOD),)
455 455 $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
456 456 else
457   - $(error kernel configuration not valid - run 'make prepare' in $(srctree) to update it)
458   -endif
  457 +# external modules needs include/linux/autoconf.h and include/config/auto.conf
  458 +# but do not care if they are up-to-date. Use auto.conf to trigger the test
  459 +PHONY += include/config/auto.conf
459 460  
  461 +include/config/auto.conf:
  462 + $(Q)test -e include/linux/autoconf.h -a -e $@ || ( \
  463 + echo; \
  464 + echo " ERROR: Kernel configuration is invalid."; \
  465 + echo " include/linux/autoconf.h or $@ are missing."; \
  466 + echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
  467 + echo; \
  468 + /bin/false)
  469 +
  470 +endif # KBUILD_EXTMOD
  471 +
460 472 else
461 473 # Dummy target needed, because used as prerequisite
462 474 include/config/auto.conf: ;
463   -endif
  475 +endif # $(dot-config)
464 476  
465 477 # The all: target is the default when no target is given on the
466 478 # command line.