mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Roman Zippel <zippel@linux-m68k.org>
Cc: Andi Kleen <ak@suse.de>,
	linux-kernel@vger.kernel.org, agruen@suse.de,
	Dave Jones <davej@redhat.com>
Subject: Re: Building external modules against objdirs
Date: Tue, 1 Aug 2006 21:42:16 +0200	[thread overview]
Message-ID: <20060801194216.GA15462@mars.ravnborg.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0607311135350.6762@scrub.home>

On Mon, Jul 31, 2006 at 11:39:30AM +0200, Roman Zippel wrote:
> Hi,
> 
> On Sun, 30 Jul 2006, Sam Ravnborg wrote:
> 
> > On Sun, Jul 30, 2006 at 08:37:02PM +0200, Andi Kleen wrote:
> >  
> > > 
> > > The echo didn't output for some reason, but adding it to the error gives
> > > 
> > > /home/lsrc/quilt/linux/Makefile:456: *** triggered by /home/lsrc/quilt/linux/drivers/net/wireless/Kconfig /home/lsrc/quilt/linux/drivers/message/fusion/Kconfig /home/lsrc/quilt/linux/net/ieee80211/Kconfig /home/lsrc/quilt/linux/net/netfilter/Kconfig kernel configuration not valid - run 'make prepare' in /home/lsrc/quilt/linux to update it.  Stop.
> > 
> > What happens is that a few Kconfig files in your quilt tree are updated
> > after last time you reran 'make'.
> > And then kbuild say that config is invalid since it has not been updated
> > since last edit of Kconfig files.
> > 
> > Hmm...
> 
> What we could do is to call silentoldconfig and set 
> KCONFIG_NOSILENTUPDATE, if the .config is uptodate it will only update 
> autoconf and abort otherwise.
External modules shall to a great extent just rely on the avialble
kernel, and any attempt to do automatic updates are not OK.
The kernel source could be RO and no rights to write in the
directories either.
So it is preferable to bail out in case we cannot build the external
module but to avoid the consistency checks all over.
Following patch does this for the configuration part.

	Sam

diff --git a/Makefile b/Makefile
index 110db85..291bb5e 100644
--- a/Makefile
+++ b/Makefile
@@ -436,12 +436,13 @@ core-y		:= usr/
 endif # KBUILD_EXTMOD
 
 ifeq ($(dot-config),1)
-# In this section, we need .config
+# Read in config
+-include include/config/auto.conf
 
+ifeq ($(KBUILD_EXTMOD),)
 # Read in dependencies to all Kconfig* files, make sure to run
 # oldconfig if changes are detected.
 -include include/config/auto.conf.cmd
--include include/config/auto.conf
 
 # To avoid any implicit rule to kick in, define an empty command
 $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
@@ -451,16 +452,27 @@ # with it and forgot to run make oldconf
 # if auto.conf.cmd is missing then we are probably in a cleaned tree so
 # we execute the config step to be sure to catch updated Kconfig files
 include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
-ifeq ($(KBUILD_EXTMOD),)
 	$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
 else
-	$(error kernel configuration not valid - run 'make prepare' in $(srctree) to update it)
-endif
+# external modules needs include/linux/autoconf.h and include/config/auto.conf
+# but do not care if they are up-to-date. Use auto.conf to trigger the test
+PHONY += include/config/auto.conf
+
+include/config/auto.conf:
+	$(Q)test -e include/linux/autoconf.h -a -e $@ || (		\
+	echo;								\
+	echo "  ERROR: Kernel configuration is invalid.";		\
+	echo "         include/linux/autoconf.h or $@ is missing.";	\
+	echo "         Run 'make oldconfig && make prepare' on kernel src to fix it.";	\
+	echo;								\
+	/bin/false)
+
+endif # KBUILD_EXTMOD
 
 else
 # Dummy target needed, because used as prerequisite
 include/config/auto.conf: ;
-endif
+endif # $(dot-config)
 
 # The all: target is the default when no target is given on the
 # command line.

  reply	other threads:[~2006-08-01 19:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-30 16:46 Andi Kleen
2006-07-30 17:51 ` Sam Ravnborg
2006-07-30 17:49   ` Andi Kleen
2006-07-30 18:31     ` Sam Ravnborg
2006-07-30 18:37       ` Andi Kleen
2006-07-30 19:17         ` Sam Ravnborg
2006-07-30 20:06           ` Andi Kleen
2006-07-31  9:39           ` Roman Zippel
2006-08-01 19:42             ` Sam Ravnborg [this message]
2006-07-30 18:34     ` Sam Ravnborg
2006-07-30 18:42       ` Andi Kleen

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=20060801194216.GA15462@mars.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=agruen@suse.de \
    --cc=ak@suse.de \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zippel@linux-m68k.org \
    /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

all inboxes | Powered by JetHome®