From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH] kvm-userspace: fix module build with --kerneldir Date: Tue, 9 Dec 2008 16:02:41 +0100 Message-ID: <20081209150241.GY12816@amd.com> References: <1227621454-24385-1-git-send-email-joerg.roedel@amd.com> <20081201152831.63f7ffc0@siegfried> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: Avi Kivity , kvm@vger.kernel.org, Eduardo Habkost , Jan Kiszka To: Maik Hentsche Return-path: Received: from outbound-sin.frontbridge.com ([207.46.51.80]:57899 "EHLO SG2EHSOBE003.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753073AbYLIPDC (ORCPT ); Tue, 9 Dec 2008 10:03:02 -0500 Content-Disposition: inline In-Reply-To: <20081201152831.63f7ffc0@siegfried> Sender: kvm-owner@vger.kernel.org List-ID: Hey Avi, do you plan to apply this patch? Or, if not, can you give a comment why not? Thanks, Joerg On Mon, Dec 01, 2008 at 03:28:31PM +0100, Maik Hentsche wrote: > 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 > > > -- > \ 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 > diff --git a/configure b/configure > index 63f956c..97a7cb7 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 < 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) > > tmpspec = .tmp.kvm-kmod.spec > -- | 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