From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Habkost Subject: Re: [PATCH] kvm-userspace: fix module build with --kerneldir Date: Thu, 27 Nov 2008 12:15:04 -0200 Message-ID: <1227794857-sup-8264@blackpad> References: <1227621454-24385-1-git-send-email-joerg.roedel@amd.com> <492D27FA.5090707@redhat.com> <20081126115915.4cf3308d@siegfried> <492D2F85.5050004@redhat.com> <492D3E23.4050106@siemens.com> <492D72AA.8050202@redhat.com> Content-Type: text/plain; charset=UTF-8 Cc: Jan Kiszka , Maik Hentsche , kvm@vger.kernel.org, "joerg.roedel" To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:46722 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751545AbYK0OPo (ORCPT ); Thu, 27 Nov 2008 09:15:44 -0500 In-Reply-To: <492D72AA.8050202@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Excerpts from Avi Kivity's message of Qua Nov 26 14:00:42 -0200 2008: > Jan Kiszka wrote: > > Avi Kivity wrote: > >> If the user specified $kerneldir, it should be in the form > >> /lib/modules/$version/build, no? > >> > > > > This is not sufficiently generic. KVM should to accept arbitrary paths > > to kernel directories, not just those special links (which could cause > > problems anyway if the link is set up for the target and makes no sense > > on the build host). > > > > > > Fair enough. This seems to work: > > awk ' / = / { a[$1] = $3 } END { printf("%s.%s.%s%s\n", > a["VERSION"], a["PATCHLEVEL"], a["SUBLEVEL"], a["EXTRAVERSION"]) }' > "$kerneldir/Makefile" What if CONFIG_LOCALVERSION is set? > > Or alternatively > > awk '/Linux kernel version/ { print $NF }' "$kerneldir/.config" What about `cat "$kerneldir/include/config/kernel.release"`? -- Eduardo