From patchwork Wed May 4 20:44:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Sharma X-Patchwork-Id: 754972 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p44Kiq31025948 for ; Wed, 4 May 2011 20:44:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752791Ab1EDUow (ORCPT ); Wed, 4 May 2011 16:44:52 -0400 Received: from outmail011.snc4.facebook.com ([66.220.144.143]:48284 "EHLO mx-out.facebook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751559Ab1EDUow (ORCPT ); Wed, 4 May 2011 16:44:52 -0400 Received: from [10.47.65.39] ([10.47.65.39:34653] helo=facebook.com) by mta016.snc4.facebook.com (envelope-from ) (ecelerity 2.2.2.45 r(37388)) with ESMTP id 8B/44-23024-3CAB1CD4; Wed, 04 May 2011 13:44:51 -0700 Received: from dev1756.snc6.facebook.com (localhost.localdomain [127.0.0.1]) by dev1756.snc6.facebook.com (Postfix) with ESMTP id AB5F7918312; Wed, 4 May 2011 13:44:51 -0700 (PDT) Received: (from asharma@localhost) by dev1756.snc6.facebook.com (8.13.8/8.13.8/Submit) id p44KipPW000301; Wed, 4 May 2011 13:44:51 -0700 X-Authentication-Warning: dev1756.snc6.facebook.com: asharma set sender to asharma@fb.com using -f Date: Wed, 4 May 2011 13:44:51 -0700 From: Arun Sharma To: Michal Marek Cc: Arun Sharma , linux-kbuild@vger.kernel.org Subject: Re: make rpm-pkg and version mismatch Message-ID: <20110504204451.GA28259@dev1756.snc6.facebook.com> References: <20110503212706.GA26044@dev1756.snc6.facebook.com> <4DC1B5CF.3070803@suse.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4DC1B5CF.3070803@suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 04 May 2011 20:44:53 +0000 (UTC) On Wed, May 04, 2011 at 10:23:43PM +0200, Michal Marek wrote: > Dne 3.5.2011 23:27, Arun Sharma napsal(a): > > > >make rpm-pkg produces files that look like: kernel-2.6.39rc5-2.x86_64.rpm > >However, uname -r produces 2.6.39rc5 (-2 is missing). > > > >This differs from how some of the distributors are packaging the kernel. > >Their setup includes %{release} in uname -r. > > Distributors have control over the kernel uname -r string. make rpm, > on the other hand, needs to work with both the vanilla version > strings, as well as any crazy suffixes the user comes up with. Hence > it uses the uname -v version number as the rpm release, which is > always defined. Distributors have been doing this traditionally by hacking on the EXTRAVERSION. But with the stable kernel series also using it, EXTRAVERSION seems a bit busy. > > Please don't do that. make rpm has to work with the version string > set by the kernel, not the other way around. Right. Here's an alternative approach: Could we modify the version string provided by the kernel to include the version string (which is derived from scripts/mkversion) -Arun --- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/Makefile +++ b/Makefile @@ -363,11 +363,14 @@ KBUILD_AFLAGS_MODULE := -DMODULE KBUILD_CFLAGS_MODULE := -DMODULE KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds -# Read KERNELRELEASE from include/config/kernel.release (if it exists) -KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) +# Read ___KERNELRELEASE from include/config/kernel.release (if it exists) +___KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) +# Append the release version only once. +# Note: .version could change during the build. +KERNELRELEASE ?= $(___KERNELRELEASE)-$(shell /bin/sh scripts/mkversion) KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) -export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION +export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION ___KERNELRELEASE Since mkspec uses the same string for %{release} we get the same consistency as a distributor built rpm.