Re: [ANNOUNCE] kvm-74 release

Iain Paton
2008-09-01T18:28:20Z

Avi Kivity wrote:

> If the kernel was built, installed, and is now running,

it's not. change control, downtime windows and such like nonsense prevent me from doing things that way. The target systems don't
have any development tools installed and the build system will never run the kernel being built. catch 22.

> ./configure;
> make should suffice. I've never tested this though. Have you tried this?

yes this does work, just not in the environment I'm in.

>> I don't have enough understanding of kernel makefile magic to see what
>> I'm
>> missing, so any help would be appreciated.
>
> Me neither.
>

Ok, so after some digging it appears that to support building with O= you need some modifications to LINUXINCLUDE within the
makefile. Looking at what's done in the toplevel kernel makefile they do the following

# Use LINUXINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option
LINUXINCLUDE := -Iinclude \
$(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
-include include/linux/autoconf.h

KBUILD_SRC is calculated from what's passed in to make by O=

So something like the following change to the KVM makefile works happily. I'm quite sure this isn't the correct way to do it, but
perhaps it can point someone with more of a clue than me in the right direction :)

--- kernel/Makefile.org 2008-09-01 18:46:15.272561974 +0100
+++ kernel/Makefile 2008-09-01 18:51:14.629935513 +0100
@@ -36,7 +36,9 @@
all:: header-link prerequisite
# include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat
$(MAKE) -C $(KERNELDIR) M=`pwd` \
- LINUXINCLUDE="-I`pwd`/include -Iinclude -Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \
+ LINUXINCLUDE="-I`pwd`/include -Iinclude \
+ $(if $(O),-Iinclude2 -I$(KERNELDIR)/include) \
+ -Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \
-include include/linux/autoconf.h \
-include `pwd`/$(ARCH_DIR)/external-module-compat.h"
"$$@"

With the above patch I can get some working modules using the following:

./configure --kerneldir=/home/ilp/kernels/v2.6/linux-2.6.26-org
make O=/home/ilp/kernels/v2.6/linux-2.6.26-dv