From patchwork Tue May 17 17:36:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Sharma X-Patchwork-Id: 792102 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4HHcxZG004630 for ; Tue, 17 May 2011 17:39:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755703Ab1EQRhv (ORCPT ); Tue, 17 May 2011 13:37:51 -0400 Received: from outmail013.snc4.facebook.com ([66.220.144.145]:62403 "EHLO mx-out.facebook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755826Ab1EQRhs (ORCPT ); Tue, 17 May 2011 13:37:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; d=fb.com; s=s1024-2011-q2; c=relaxed/simple; q=dns/txt; i=@fb.com; t=1305653868; h=From:Subject:Date:To; bh=epa8WYDKIojUb3JdWQhvhj3PCXJ30Y+NkNlAjtdsmLY=; b=xYehejM9KStkc08fETLcfEVgMK3RTCOIPGZBN4IYHQaEJfoTD9VEs5UzTSKvGgX8 MDXA1fZmWNb3iguCgR5wDrTiFR5ZrW8K6123lInFvOB8wbYtz/QncEg6cxkZi+pj vJc30AwyxWX7LmBogjX0KfKWhUUqCSXlxvXOZo6PGSA=; Received: from [10.34.2.190] ([10.34.2.190:48833] helo=mx-out.facebook.com) by 10.30.170.55 (envelope-from ) (ecelerity 2.2.2.45 r(34222M)) with ESMTP id B5/F5-10251-C62B2DD4; Tue, 17 May 2011 10:37:48 -0700 Received: from [10.47.65.39] ([10.47.65.39:43111] helo=facebook.com) by mta030.snc4.facebook.com (envelope-from ) (ecelerity 2.2.2.45 r(34222M)) with ESMTP id E3/04-25736-C62B2DD4; Tue, 17 May 2011 10:37:48 -0700 Received: from dev1756.snc6.facebook.com (localhost.localdomain [127.0.0.1]) by dev1756.snc6.facebook.com (Postfix) with ESMTP id 6F7B79183CF; Tue, 17 May 2011 10:37:48 -0700 (PDT) Received: (from asharma@localhost) by dev1756.snc6.facebook.com (8.13.8/8.13.8/Submit) id p4HHbmcU003983; Tue, 17 May 2011 10:37:48 -0700 X-Authentication-Warning: dev1756.snc6.facebook.com: asharma set sender to asharma@fb.com using -f From: Arun Sharma To: Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Arun Sharma Subject: [PATCH 5/6] kbuild: Append RPM release to $KERNELRELEASE Date: Tue, 17 May 2011 10:36:18 -0700 Message-Id: <1305653779-3445-5-git-send-email-asharma@fb.com> X-Mailer: git-send-email 1.7.4 In-Reply-To: <1305653779-3445-1-git-send-email-asharma@fb.com> References: <1305653779-3445-1-git-send-email-asharma@fb.com> 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 (demeter1.kernel.org [140.211.167.41]); Tue, 17 May 2011 17:39:04 +0000 (UTC) Provide the same consistency as distributor kernels. uname -r matches RPM name (includes the release) Glossary: KERNELRELEASE = what users see ___KERNELRELEASE = KERNELRELEASE without RPM release __KERNELRELEASE = ___KERNELRELEASE with s/-/_/g Signed-off-by: Arun Sharma --- Makefile | 9 ++++++--- scripts/package/Makefile | 2 +- scripts/package/mkspec | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 28820f7..90d45f4 100644 --- a/Makefile +++ b/Makefile @@ -367,11 +367,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 export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC export CPP AR NM STRIP OBJCOPY OBJDUMP export MAKE AWK GENKSYMS INSTALLKERNEL PERL UTS_MACHINE diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 1b7eaea..0ec687b 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -26,7 +26,7 @@ RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \ else echo rpm; fi) # Remove hyphens since they have special meaning in RPM filenames -KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE)) +KERNELPATH := kernel-$(subst -,_,$(___KERNELRELEASE)) MKSPEC := $(srctree)/scripts/package/mkspec PREV := set -e; cd ..; diff --git a/scripts/package/mkspec b/scripts/package/mkspec index bf215c5..9a8c2fa 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec @@ -22,7 +22,7 @@ if [ "`grep CONFIG_DRM=y .config | cut -f2 -d\=`" = "y" ]; then fi PROVIDES="$PROVIDES kernel-$KERNELRELEASE" -__KERNELRELEASE=`echo $KERNELRELEASE | sed -e "s/-/_/g"` +__KERNELRELEASE=`echo $___KERNELRELEASE | sed -e "s/-/_/g"` echo "Name: kernel" echo "Summary: The Linux Kernel"