Re: [PATCH 2/2] kvm-kmod: Document the build process

2009-10-23 Thread Jan Kiszka
Dietmar Maurer wrote:
 
 -Original Message-
 From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On
 Behalf Of Wolfgang Mauerer
 Sent: Mittwoch, 21. Oktober 2009 16:21
 To: Dietmar Maurer
 Cc: kvm@vger.kernel.org; Kiszka, Jan
 Subject: Re: [PATCH 2/2] kvm-kmod: Document the build process

 Hio,

 Dietmar Maurer wrote:
 +  Before the kvm module can be built, the linux submodule must be
 initialised
 +  and populated. The required sequence of commands is
 +
 +  git submodule init
 +  git submodule update
 +  ./configure
 +  make sync
 +  make
 +
 +  Notice that you can also specify an existing Linux tree for the
 + synchronisation stage by using
 +
 +  make sync LINUX=/path/to/tree
 I always get errors when i try to sync (with our Linux-2.6.24 tree)

 ./configure --kerneldir=${TOP}/linux-2.6.24-openvz
 make sync LINUX=${TOP}/linux-2.6.24-openvz

 make[1]: Entering directory `/a/dir/kvm-kmod-2.6.30.1'
 ./sync kvm-kmod-2.6.30.1
 Traceback (most recent call last):
   File ./sync, line 210, in module
 header_sync(arch)
   File ./sync, line 181, in header_sync
 hack(T, 'x86', 'include/linux/kvm.h')
   File ./sync, line 127, in hack
 _hack(T + '/' + file, arch)
   File ./sync, line 118, in _hack
 data = file(fname).read()
 IOError: [Errno 2] No such file or directory:
 'header/include/linux/kvm.h'
 make[1]: *** [sync] Error 1

 Any idea whats wrong?
 Do you have a checked out Linux tree in linux-2.6/?
 
 Sorry, seem I am confused. You wrote
 
 +  make sync LINUX=/path/to/tree
 
 So why do I need another linux tree? Can't we fix the 'sync' script?

There is nothing to fix. The sync script takes the KVM kernel module
sources from a recent kernel A and patch them so that kvm-kmod can build
them for an ancient kernel B.

Now you have two options where this kernel A could be located on sync:
by default (LINUX unset), it is in kvm-kmod/linux-2.6 (that git
submodule). Or you define a different local tree via
LINUX=/path/to/kernel/A - like above.

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 2/2] kvm-kmod: Document the build process

2009-10-21 Thread Dietmar Maurer
 +  Before the kvm module can be built, the linux submodule must be
 initialised
 +  and populated. The required sequence of commands is
 +
 +  git submodule init
 +  git submodule update
 +  ./configure
 +  make sync
 +  make
 +
 +  Notice that you can also specify an existing Linux tree for the
 +  synchronisation stage by using
 +
 +  make sync LINUX=/path/to/tree

I always get errors when i try to sync (with our Linux-2.6.24 tree)

./configure --kerneldir=${TOP}/linux-2.6.24-openvz
make sync LINUX=${TOP}/linux-2.6.24-openvz

make[1]: Entering directory `/a/dir/kvm-kmod-2.6.30.1'
./sync kvm-kmod-2.6.30.1
Traceback (most recent call last):
  File ./sync, line 210, in module
header_sync(arch)
  File ./sync, line 181, in header_sync
hack(T, 'x86', 'include/linux/kvm.h')
  File ./sync, line 127, in hack
_hack(T + '/' + file, arch)
  File ./sync, line 118, in _hack
data = file(fname).read()
IOError: [Errno 2] No such file or directory: 'header/include/linux/kvm.h'
make[1]: *** [sync] Error 1

Any idea whats wrong?

- Dietmar

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] kvm-kmod: Document the build process

2009-10-21 Thread Wolfgang Mauerer
Hio,

Dietmar Maurer wrote:
 +  Before the kvm module can be built, the linux submodule must be
 initialised
 +  and populated. The required sequence of commands is
 +
 +  git submodule init
 +  git submodule update
 +  ./configure
 +  make sync
 +  make
 +
 +  Notice that you can also specify an existing Linux tree for the
 +  synchronisation stage by using
 +
 +  make sync LINUX=/path/to/tree
 
 I always get errors when i try to sync (with our Linux-2.6.24 tree)
 
 ./configure --kerneldir=${TOP}/linux-2.6.24-openvz
 make sync LINUX=${TOP}/linux-2.6.24-openvz
 
 make[1]: Entering directory `/a/dir/kvm-kmod-2.6.30.1'
 ./sync kvm-kmod-2.6.30.1
 Traceback (most recent call last):
   File ./sync, line 210, in module
 header_sync(arch)
   File ./sync, line 181, in header_sync
 hack(T, 'x86', 'include/linux/kvm.h')
   File ./sync, line 127, in hack
 _hack(T + '/' + file, arch)
   File ./sync, line 118, in _hack
 data = file(fname).read()
 IOError: [Errno 2] No such file or directory: 'header/include/linux/kvm.h'
 make[1]: *** [sync] Error 1
 
 Any idea whats wrong?

Do you have a checked out Linux tree in linux-2.6/?
Currently, the linux-2.6 submodule seems to reference
a commit that is not present in the standard kvm
repo, so I assume that git submodule update
has failed for you. For now, you can fix this by
using git checkout in linux-2.6/

Btw.: Wrt. git sync, I've also updated to README
a bit to the two different kernel trees that come into
play. Comments?

Jan: I think the bogous reference is a leftover
from the tree that you've added as submodule; after
my patch to use Avi's tree, the information might be
out of sync.

Best, Wolfgang
diff --git a/README b/README
index 40a72d3..34cc51a 100644
--- a/README
+++ b/README
@@ -1,16 +1,21 @@
 Building the KVM kernel module is performed differently depending on whether
 you are working from a clone of the git repository or from a source release.
+Notice that two kernels are involved: One from which the KVM sources
+are taken (kernel A), and one for which the module is built (kernel B). 
+For out-of-tree module builds, it is well possible that kernel A is more
+recent than kernel B.
 
 - To build from a release, simply use ./configure (possibly with any
   arguments that are required for your setup, see ./configure --help)
-  and make.
+  and make. The kernel specified with --kerneldir refers to kernel B,
+  that is, the kernel for which the module is built.
 
 - Building from a cloned git repository requires a kernel tree with the main
-  kvm sources that is included as a submodule in the linux-2.6/ directory.  By
-  default, the KVM development tree on git.kernel.org is used, but you can
-  change this setting in .gitmodules
+  kvm sources (kernel A) that is included as a submodule in the linux-2.6/
+  directory.  By default, the KVM development tree on git.kernel.org is used,
+  but you can change this setting in .gitmodules
 
-  Before the kvm module can be built, the linux submodule must be initialised 
+  Before the kvm module can be built, the linux submodule must be initialised
   and populated. The required sequence of commands is
 
   git submodule init
@@ -24,3 +29,5 @@ you are working from a clone of the git repository or from a source release.
 
   make sync LINUX=/path/to/tree
 
+  The synchronisation stage refers to kernel A, that is, the kernel
+  from which the KVM sources are taken.