All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix detection of kernel source directory
@ 2009-06-03 12:59 James Pike
  2009-06-08  8:31 ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: James Pike @ 2009-06-03 12:59 UTC (permalink / raw)
  To: kvm

[-- Attachment #1: Type: text/plain, Size: 127 bytes --]

Fix detection of kernel source directory when it is different to build
directory.
Signed-off-by: James Pike <james@chilon.net>

[-- Attachment #2: kvm-kmod-86-configure.patch --]
[-- Type: text/plain, Size: 376 bytes --]

diff --git a/configure b/configure
index e01ba98..c3b7a5f 100755
--- a/configure
+++ b/configure
@@ -91,7 +91,7 @@ arch=${arch%%-*}
 
 # see if we have split build and source directories
 if [ -d "$kerneldir/include2" ]; then
-    kernelsourcedir=${kerneldir%/*}/source
+    kernelsourcedir=`readlink -f $kerneldir/source`
 fi
 
 if [ -n "$no_uname" -a "$want_module" ]; then

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

* Re: [PATCH] fix detection of kernel source directory
  2009-06-03 12:59 [PATCH] fix detection of kernel source directory James Pike
@ 2009-06-08  8:31 ` Jan Kiszka
  2009-06-08  8:49   ` Avi Kivity
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2009-06-08  8:31 UTC (permalink / raw)
  To: James Pike; +Cc: kvm, Avi Kivity

James Pike wrote:
> Fix detection of kernel source directory when it is different to build
> directory.
> Signed-off-by: James Pike <james@chilon.net>
> 
> diff --git a/configure b/configure
> index e01ba98..c3b7a5f 100755
> --- a/configure
> +++ b/configure
> @@ -91,7 +91,7 @@ arch=${arch%%-*}
>  
>  # see if we have split build and source directories
>  if [ -d "$kerneldir/include2" ]; then
> -    kernelsourcedir=${kerneldir%/*}/source
> +    kernelsourcedir=`readlink -f $kerneldir/source`
>  fi
>  
>  if [ -n "$no_uname" -a "$want_module" ]; then

So far I can't reproduce any problem that the above could fix, but maybe
Avi sees why we need it and that it doesn't regress elsewhere.

Jan

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

* Re: [PATCH] fix detection of kernel source directory
  2009-06-08  8:31 ` Jan Kiszka
@ 2009-06-08  8:49   ` Avi Kivity
  2009-08-15 22:24     ` James Pike
  0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2009-06-08  8:49 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: James Pike, kvm

Jan Kiszka wrote:
> James Pike wrote:
>   
>> Fix detection of kernel source directory when it is different to build
>> directory.
>> Signed-off-by: James Pike <james@chilon.net>
>>
>> diff --git a/configure b/configure
>> index e01ba98..c3b7a5f 100755
>> --- a/configure
>> +++ b/configure
>> @@ -91,7 +91,7 @@ arch=${arch%%-*}
>>  
>>  # see if we have split build and source directories
>>  if [ -d "$kerneldir/include2" ]; then
>> -    kernelsourcedir=${kerneldir%/*}/source
>> +    kernelsourcedir=`readlink -f $kerneldir/source`
>>  fi
>>  
>>  if [ -n "$no_uname" -a "$want_module" ]; then
>>     
>
> So far I can't reproduce any problem that the above could fix, but maybe
> Avi sees why we need it and that it doesn't regress elsewhere.
>
>   

I don't.  James, what triggered this?

-- 
error compiling committee.c: too many arguments to function


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

* Re: [PATCH] fix detection of kernel source directory
  2009-06-08  8:49   ` Avi Kivity
@ 2009-08-15 22:24     ` James Pike
  0 siblings, 0 replies; 4+ messages in thread
From: James Pike @ 2009-08-15 22:24 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Jan Kiszka, kvm

> kernelsourcedir=${kerneldir%/*}/source
This is incorrect when using an out of place build tree. For example if
my build directory is..

/lib/modules/2.6.20/build
then this will end up as /lib/modules/2.6.20/source which is correct.

But if I build my kernel out of place in /home/compile/linux/2.6.20
Then this will end up as:
/home/compile/linux/source

Obviously the kernel source directory here.

However the kernel build scripts do create a symlink inside of my build
directory called source that points at the kernel sources, so the
correct and simple solution would be:

kernelsourcedir=kerneldir/source

Which is simpler than my patch.

Don't you also build your kernels out of place? I thought it was fairly
standard practice to do "make O=<build dir>" from your kernel source
directory to avoid the source and build objects getting mixed up?

On Mon, Jun 08, 2009 at 11:49:17AM +0300, Avi Kivity wrote:
> Jan Kiszka wrote:
> > James Pike wrote:
> >   
> >> Fix detection of kernel source directory when it is different to build
> >> directory.
> >> Signed-off-by: James Pike <james@chilon.net>
> >>
> >> diff --git a/configure b/configure
> >> index e01ba98..c3b7a5f 100755
> >> --- a/configure
> >> +++ b/configure
> >> @@ -91,7 +91,7 @@ arch=${arch%%-*}
> >>  
> >>  # see if we have split build and source directories
> >>  if [ -d "$kerneldir/include2" ]; then
> >> -    kernelsourcedir=${kerneldir%/*}/source
> >> +    kernelsourcedir=`readlink -f $kerneldir/source`
> >>  fi
> >>  
> >>  if [ -n "$no_uname" -a "$want_module" ]; then
> >>     
> >
> > So far I can't reproduce any problem that the above could fix, but maybe
> > Avi sees why we need it and that it doesn't regress elsewhere.
> >
> >   
> 
> I don't.  James, what triggered this?
> 
> -- 
> error compiling committee.c: too many arguments to function
> 

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

end of thread, other threads:[~2009-08-15 22:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-03 12:59 [PATCH] fix detection of kernel source directory James Pike
2009-06-08  8:31 ` Jan Kiszka
2009-06-08  8:49   ` Avi Kivity
2009-08-15 22:24     ` James Pike

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.