From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maik Hentsche Subject: Re: [PATCH] kvm-userspace: fix module build with --kerneldir Date: Mon, 1 Dec 2008 15:28:31 +0100 Message-ID: <20081201152831.63f7ffc0@siegfried> References: <1227621454-24385-1-git-send-email-joerg.roedel@amd.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/uRTqr3GMmJAc4q5Ij_KNv09"; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: kvm@vger.kernel.org, Joerg Roedel , Eduardo Habkost , Jan Kiszka To: Avi Kivity Return-path: Received: from outbound-va3.frontbridge.com ([216.32.180.16]:33762 "EHLO VA3EHSOBE002.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752687AbYLAO2z (ORCPT ); Mon, 1 Dec 2008 09:28:55 -0500 In-Reply-To: <1227621454-24385-1-git-send-email-joerg.roedel@amd.com> Sender: kvm-owner@vger.kernel.org List-ID: --Sig_/uRTqr3GMmJAc4q5Ij_KNv09 Content-Type: multipart/mixed; boundary="MP_/w+EzYfiQz55AVhtvFBo_fEP" --MP_/w+EzYfiQz55AVhtvFBo_fEP Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Please find my reworked patch attached. Support for pre-f1d28fb04 kernels was tested with 2.6.16.1. I CC-ed everyone who contributed to this thread, thanks for your help. I hope the "bureaucracy" is correct. I'm not a kernel developer and thus only know about the contribution process what I found in the documentation. so long Maik ---- 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 Signed-off-by: Joerg Roedel --=20 \ AMD Saxony Limited Liability Company & Co. KG Operating | Wilschdorfer Landstr. 101, 01109 Dresden, Germany System | Register Court Dresden: HRA 4896 Research | General Partner authorized to represent: Center | AMD Saxony LLC (Wilmington, Delaware, US) / General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy --MP_/w+EzYfiQz55AVhtvFBo_fEP Content-Type: text/x-patch; name=kvm_patch.git.diff Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=kvm_patch.git.diff diff --git a/configure b/configure index 63f956c..97a7cb7 100755 --- a/configure +++ b/configure @@ -15,6 +15,12 @@ qemu_opts=3D() cross_prefix=3D arch=3D`uname -m` target_exec=3D +# don't use uname if kerneldir is set +no_uname=3D +depmod_version=3D +if [ -z "TMPDIR" ] ; then=20 + TMPDIR=3D. +fi =20 usage() { cat <<-EOF @@ -56,6 +62,7 @@ while [[ "$1" =3D -* ]]; do ;; --kerneldir) kerneldir=3D"$arg" + no_uname=3D1 ;; --with-patched-kernel) want_module=3D @@ -112,6 +119,21 @@ if [ -d "$kerneldir/include2" ]; then kernelsourcedir=3D${kerneldir%/*}/source fi =20 +if [ -n "$no_uname" ]; then + if [ -e "$kerneldir/.kernelrelease" ]; then + depmod_version=3D`cat "$kerneldir/.kernelrelease"` + =20 + elif [ -e "$kerneldir/include/config/kernel.release" ]; then + depmod_version=3D`cat "$kerneldir/include/config/kernel.releas= e"` + else + echo=20 + 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=3D"$prefix" --kerneldir=3D"$libkvm_kerneldi= r" \ --arch=3D"$arch" --processor=3D"$processor" \ @@ -143,6 +165,7 @@ CC=3D$cross_prefix$cc LD=3D$cross_prefix$ld OBJCOPY=3D$cross_prefix$objcopy AR=3D$cross_prefix$ar +DEPMOD_VERSION=3D$depmod_version EOF =20 cat < kernel/config.kbuild diff --git a/kernel/Makefile b/kernel/Makefile index 41449d6..8315e3d 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -107,7 +107,7 @@ install: $(ORIGMODDIR)/arch/$(ARCH_DIR)/kvm/*.ko; do \ if [ -f "$$i" ]; then mv "$$i" "$$i.orig"; fi; \ done - /sbin/depmod -a + /sbin/depmod -a $(DEPMOD_VERSION) =20 tmpspec =3D .tmp.kvm-kmod.spec =20 --MP_/w+EzYfiQz55AVhtvFBo_fEP-- --Sig_/uRTqr3GMmJAc4q5Ij_KNv09 Content-Type: application/pgp-signature; name="signature.asc" Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFJM/SPFY+OhfZweXURAueDAJ0Q1BqmXz5a8DrOeTtMZ/jrq+4UlACfWxuk BMJqF+JbeGXBoTbaN2hXMFQ= =bNrL -----END PGP SIGNATURE----- --Sig_/uRTqr3GMmJAc4q5Ij_KNv09--