Linux kbuild/kconfig development
 help / color / mirror / Atom feed
* [PATCH 0/4] Fixes for X.Y kernel versions
@ 2011-05-30 14:50 Michal Marek
  2011-05-30 14:50 ` [PATCH 1/4] kbuild: Fix KERNELVERSION for X.Y versions Michal Marek
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Michal Marek @ 2011-05-30 14:50 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kbuild, linux-kernel

Hi Linus,

Here are a couple of fixes to allow to name the kernel 3.0. The depmod
hack is not anything I am proud of, but it worked for me :). The rest
are no-brainers.

Michal

Michal Marek (4):
  kbuild: Fix KERNELVERSION for X.Y versions
  kbuild: Fix <linux/version.h> for X.Y versions
  perf: Use make kernelversion instead of parsing the Makefile
  kbuild: Hack for depmod not handling X.Y versions

 Makefile                         |   16 +++++++++++++---
 tools/perf/util/PERF-VERSION-GEN |    7 +------
 2 files changed, 14 insertions(+), 9 deletions(-)

-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/4] kbuild: Fix KERNELVERSION for X.Y versions
  2011-05-30 14:50 [PATCH 0/4] Fixes for X.Y kernel versions Michal Marek
@ 2011-05-30 14:50 ` Michal Marek
  2011-05-30 14:50 ` [PATCH 2/4] kbuild: Fix <linux/version.h> " Michal Marek
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Michal Marek @ 2011-05-30 14:50 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kbuild, linux-kernel

Omit the second dot for releases without SUBLEVEL.

Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index afb8e0d..c706ae1 100644
--- a/Makefile
+++ b/Makefile
@@ -378,7 +378,7 @@ 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)
-KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+KERNELVERSION = $(VERSION).$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL))$(EXTRAVERSION)
 
 export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
 export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/4] kbuild: Fix <linux/version.h> for X.Y versions
  2011-05-30 14:50 [PATCH 0/4] Fixes for X.Y kernel versions Michal Marek
  2011-05-30 14:50 ` [PATCH 1/4] kbuild: Fix KERNELVERSION for X.Y versions Michal Marek
@ 2011-05-30 14:50 ` Michal Marek
  2011-05-30 15:08   ` Valdis.Kletnieks
  2011-05-31  9:07   ` Américo Wang
  2011-05-30 14:50 ` [PATCH 3/4] perf: Use make kernelversion instead of parsing the Makefile Michal Marek
  2011-05-30 14:50 ` [PATCH 4/4] kbuild: Hack for depmod not handling X.Y versions Michal Marek
  3 siblings, 2 replies; 8+ messages in thread
From: Michal Marek @ 2011-05-30 14:50 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kbuild, linux-kernel

expr treats all numbers as decimals, so prepending a zero is safe. Note
that the KERNEL_VERSION() macro still takes three arguments, 3.0 has to be
written as KERNEL_VERSION(3,0,0).

Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index c706ae1..130e282 100644
--- a/Makefile
+++ b/Makefile
@@ -1005,7 +1005,7 @@ endef
 
 define filechk_version.h
 	(echo \#define LINUX_VERSION_CODE $(shell                             \
-	expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL));     \
+	expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + 0$(SUBLEVEL));    \
 	echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
 endef
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/4] perf: Use make kernelversion instead of parsing the Makefile
  2011-05-30 14:50 [PATCH 0/4] Fixes for X.Y kernel versions Michal Marek
  2011-05-30 14:50 ` [PATCH 1/4] kbuild: Fix KERNELVERSION for X.Y versions Michal Marek
  2011-05-30 14:50 ` [PATCH 2/4] kbuild: Fix <linux/version.h> " Michal Marek
@ 2011-05-30 14:50 ` Michal Marek
  2011-05-30 14:50 ` [PATCH 4/4] kbuild: Hack for depmod not handling X.Y versions Michal Marek
  3 siblings, 0 replies; 8+ messages in thread
From: Michal Marek @ 2011-05-30 14:50 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: linux-kbuild, linux-kernel, Peter Zijlstra, Paul Mackerras,
	Ingo Molnar, Arnaldo Carvalho de Melo

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 tools/perf/util/PERF-VERSION-GEN |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN
index 26d4d3f..9c5fb4d 100755
--- a/tools/perf/util/PERF-VERSION-GEN
+++ b/tools/perf/util/PERF-VERSION-GEN
@@ -23,12 +23,7 @@ if test -d ../../.git -o -f ../../.git &&
 then
 	VN=$(echo "$VN" | sed -e 's/-/./g');
 else
-	eval $(grep '^VERSION[[:space:]]*=' ../../Makefile|tr -d ' ')
-	eval $(grep '^PATCHLEVEL[[:space:]]*=' ../../Makefile|tr -d ' ')
-	eval $(grep '^SUBLEVEL[[:space:]]*=' ../../Makefile|tr -d ' ')
-	eval $(grep '^EXTRAVERSION[[:space:]]*=' ../../Makefile|tr -d ' ')
-
-	VN="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}"
+	VN=$(make -sC ../.. kernelversion)
 fi
 
 VN=$(expr "$VN" : v*'\(.*\)')
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/4] kbuild: Hack for depmod not handling X.Y versions
  2011-05-30 14:50 [PATCH 0/4] Fixes for X.Y kernel versions Michal Marek
                   ` (2 preceding siblings ...)
  2011-05-30 14:50 ` [PATCH 3/4] perf: Use make kernelversion instead of parsing the Makefile Michal Marek
@ 2011-05-30 14:50 ` Michal Marek
  3 siblings, 0 replies; 8+ messages in thread
From: Michal Marek @ 2011-05-30 14:50 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kbuild, linux-kernel

depmod checks if the argument starts with <num>.<num>.<num>. Until
depmod is fixed, we cheat with a symlink.

Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 Makefile |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 130e282..0d8d05e 100644
--- a/Makefile
+++ b/Makefile
@@ -1533,9 +1533,19 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN   $(wildcard $(rm-files))
 quiet_cmd_depmod = DEPMOD  $(KERNELRELEASE)
       cmd_depmod = \
 	if [ -r System.map -a -x $(DEPMOD) ]; then                              \
+		if test -z "$(SUBLEVEL)"; then					\
+			version=99.$(KERNELRELEASE);				\
+			ln -s $(KERNELRELEASE) 					\
+				$(INSTALL_MOD_PATH)/lib/modules/$$version;	\
+		else								\
+			version=$(KERNELRELEASE);				\
+		fi;								\
 		$(DEPMOD) -ae -F System.map                                     \
 		$(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) )     \
-		$(KERNELRELEASE);                                               \
+		$$version;                                               	\
+		ret=$$?;							\
+		rm -f $(INSTALL_MOD_PATH)/lib/modules/99.$(KERNELRELEASE);	\
+		exit $$ret;							\
 	fi
 
 # Create temporary dir for module support files
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/4] kbuild: Fix <linux/version.h> for X.Y versions
  2011-05-30 14:50 ` [PATCH 2/4] kbuild: Fix <linux/version.h> " Michal Marek
@ 2011-05-30 15:08   ` Valdis.Kletnieks
  2011-05-31  9:01     ` Michal Marek
  2011-05-31  9:07   ` Américo Wang
  1 sibling, 1 reply; 8+ messages in thread
From: Valdis.Kletnieks @ 2011-05-30 15:08 UTC (permalink / raw)
  To: Michal Marek; +Cc: Linus Torvalds, linux-kbuild, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 194 bytes --]

On Mon, 30 May 2011 16:50:50 +0200, Michal Marek said:

> +	expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + 0$(SUBLEVEL));    \

expr isn't going to interpret that last field as octal, is it?

[-- Attachment #2: Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/4] kbuild: Fix <linux/version.h> for X.Y versions
  2011-05-30 15:08   ` Valdis.Kletnieks
@ 2011-05-31  9:01     ` Michal Marek
  0 siblings, 0 replies; 8+ messages in thread
From: Michal Marek @ 2011-05-31  9:01 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: Linus Torvalds, linux-kbuild, linux-kernel

On 30.5.2011 17:08, Valdis.Kletnieks@vt.edu wrote:
> On Mon, 30 May 2011 16:50:50 +0200, Michal Marek said:
>
>> +	expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + 0$(SUBLEVEL));    \
>
> expr isn't going to interpret that last field as octal, is it?

As I wrote in the changelog: "expr treats all numbers as decimals, so 
prepending a zero is safe." POSIX requires this, FWIW.

Michal

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/4] kbuild: Fix <linux/version.h> for X.Y versions
  2011-05-30 14:50 ` [PATCH 2/4] kbuild: Fix <linux/version.h> " Michal Marek
  2011-05-30 15:08   ` Valdis.Kletnieks
@ 2011-05-31  9:07   ` Américo Wang
  1 sibling, 0 replies; 8+ messages in thread
From: Américo Wang @ 2011-05-31  9:07 UTC (permalink / raw)
  To: Michal Marek; +Cc: Linus Torvalds, linux-kbuild, linux-kernel

On Mon, May 30, 2011 at 10:50 PM, Michal Marek <mmarek@suse.cz> wrote:
> expr treats all numbers as decimals, so prepending a zero is safe. Note
> that the KERNEL_VERSION() macro still takes three arguments, 3.0 has to be
> written as KERNEL_VERSION(3,0,0).
>
> Signed-off-by: Michal Marek <mmarek@suse.cz>

Acked-by: WANG Cong <xiyou.wangcong@gmail.com>

Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-05-31  9:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-30 14:50 [PATCH 0/4] Fixes for X.Y kernel versions Michal Marek
2011-05-30 14:50 ` [PATCH 1/4] kbuild: Fix KERNELVERSION for X.Y versions Michal Marek
2011-05-30 14:50 ` [PATCH 2/4] kbuild: Fix <linux/version.h> " Michal Marek
2011-05-30 15:08   ` Valdis.Kletnieks
2011-05-31  9:01     ` Michal Marek
2011-05-31  9:07   ` Américo Wang
2011-05-30 14:50 ` [PATCH 3/4] perf: Use make kernelversion instead of parsing the Makefile Michal Marek
2011-05-30 14:50 ` [PATCH 4/4] kbuild: Hack for depmod not handling X.Y versions Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox