summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMaik Hentsche <maik.hentsche@amd.com>2008-12-01 15:28:31 +0100
committerAvi Kivity <avi@redhat.com>2008-12-10 12:06:05 +0200
commit7ccb99635abc5f3beb8d0586fd0e6b9d5e78d96c (patch)
tree77a2f6f2d39383aad97793167b0820027aaf2839 /configure
parent30cfbdbe89cccdee0a22e81880925ac51671abf6 (diff)
kvm: external module: fix module build with --kerneldir
When kvm-userspace is build with a different kernel version than the running kernel the depmod at the end will fail. This patch fixed the problem. Signed-off-by: Maik Hentsche <maik.hentsche@amd.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure23
1 files changed, 23 insertions, 0 deletions
diff --git a/configure b/configure
index 63f956c6..4e88961c 100755
--- a/configure
+++ b/configure
@@ -15,6 +15,12 @@ qemu_opts=()
cross_prefix=
arch=`uname -m`
target_exec=
+# don't use uname if kerneldir is set
+no_uname=
+depmod_version=
+if [ -z "TMPDIR" ] ; then
+ TMPDIR=.
+fi
usage() {
cat <<-EOF
@@ -56,6 +62,7 @@ while [[ "$1" = -* ]]; do
;;
--kerneldir)
kerneldir="$arg"
+ no_uname=1
;;
--with-patched-kernel)
want_module=
@@ -112,6 +119,21 @@ if [ -d "$kerneldir/include2" ]; then
kernelsourcedir=${kerneldir%/*}/source
fi
+if [ -n "$no_uname" ]; then
+ if [ -e "$kerneldir/.kernelrelease" ]; then
+ depmod_version=`cat "$kerneldir/.kernelrelease"`
+
+ elif [ -e "$kerneldir/include/config/kernel.release" ]; then
+ depmod_version=`cat "$kerneldir/include/config/kernel.release"`
+ else
+ echo
+ echo "Error: kernelversion not found"
+ echo "Please make sure your kernel is configured"
+ echo
+ exit 1
+ fi
+fi
+
#configure user dir
(cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
--arch="$arch" --processor="$processor" \
@@ -143,6 +165,7 @@ CC=$cross_prefix$cc
LD=$cross_prefix$ld
OBJCOPY=$cross_prefix$objcopy
AR=$cross_prefix$ar
+DEPMOD_VERSION=$depmod_version
EOF
cat <<EOF > kernel/config.kbuild