Makefile: fix missing dash when using make LOCALVERSION=xxx
PATCH 1/2 Makefile: fix missing dash when using make LOCALVERSION=xxx
From: Amerigo Wang <[email protected]>
Date: Mon, 28 Jun 2010 10:42:28 +0800
When I use make LOCALVERSION=local and LOCALVERSION_AUTO is not set, I got "2.6.35-rc3local". It is supposed to be "2.6.35-rc3-local".
--- Makefile | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
Makefile +5 -1
@@ -950,7 +950,11 @@ else endif endif -localver-full = $(localver)$(LOCALVERSION)$(localver-extra) +ifneq ($(LOCALVERSION),) + localver-full = $(localver)-$(LOCALVERSION)$(localver-extra) +else + localver-full = $(localver)$(LOCALVERSION)$(localver-extra) +endif # Store (new) KERNELRELASE string in include/config/kernel.release kernelrelease = $(KERNELVERSION)$(localver-full)
Signature · 1 line
1.6.5.2
PATCH 2/2 Makefile: "make kernelrelease" should show the correct full kernel version
From: Amerigo Wang <[email protected]>
Date: Mon, 28 Jun 2010 10:45:21 +0800
After commit 85a256d8e0116c8f5ad276730830f5d4d473344d, 'make kernelrelease' doesn't show the correct full kernel version. This patch fixes it, 'make kernelrelease' will show the same version name with the one you finally get.
--- Makefile | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
Makefile +2 -3
@@ -414,7 +414,7 @@ endif no-dot-config-targets := clean mrproper distclean \ cscope TAGS tags help %docs check% \ include/linux/version.h headers_% \ - kernelrelease kernelversion + kernelversion config-targets := 0 mixed-targets := 0
@@ -1468,8 +1468,7 @@ checkstack: $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH) kernelrelease: - $(if $(wildcard include/config/kernel.release), $(Q)echo $(KERNELRELEASE), \ - $(error kernelrelease not valid - run 'make prepare' to update it)) + @echo $(kernelrelease) kernelversion: @echo $(KERNELVERSION)
Signature · 1 line
1.6.5.2
Re: [PATCH 2/2] Makefile: "make kernelrelease" should show the correct full kernel version
Quoted 28 lines · Amerigo Wang
From: Amerigo Wang <[email protected]>
Date: Mon, 28 Jun 2010 10:45:21 +0800After commit
85a256d8e0116c8f5ad276730830f5d4d473344d, 'make kernelrelease' doesn't show the correct full kernel version. This patch fixes it, 'make kernelrelease' will show the same version name with the one you finally get.Cc David Rientjes <[email protected]>Cc Michal Marek <[email protected]>Signed-off-by Amerigo Wang <[email protected]>--- Makefile | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)Makefile +1
-1@@ -414,7 +414,7 @@ endif no-dot-config-targets := clean mrproper distclean \ cscope TAGS tags help %docs check% \ include/linux/version.h headers_% \ - kernelrelease kernelversion + kernelversion config-targets := 0 mixed-targets := 0
Makefile checkstack: · line 1473
Quoted 8 lines
Makefile +1
-2@@ -1468,8 +1468,7 @@ checkstack: $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH) kernelrelease: - $(if $(wildcard include/config/kernel.release), $(Q)echo $(KERNELRELEASE), \ - $(error kernelrelease not valid - run 'make prepare' to update it)) + @echo $(kernelrelease) kernelversion: @echo $(KERNELVERSION)
AFAICS it was broken even before 85a256d. Nevertheless, the patch is correct, but conflicts with 0915512 in the kbuild tree. What about this one?
From 01ab17887f4cdcb8bb5a5d1bc3b160d186e6e99b Mon Sep 17 00:00:00 2001
From: Amerigo Wang <[email protected]>
Date: Mon, 28 Jun 2010 10:45:21 +0800
Subject: [PATCH] Makefile: "make kernelrelease" should show the correct full kernel version
After commit 85a256d8e0116c8f5ad276730830f5d4d473344d, 'make kernelrelease' doesn't show the correct full kernel version. This patch fixes it, 'make kernelrelease' will show the same version name with the one you finally get.
[mmarek: merged with 0915512 and added dependency on include/config/kernel.release]
Makefile +4 -4
@@ -414,7 +414,7 @@ endif no-dot-config-targets := clean mrproper distclean \ cscope TAGS tags help %docs check% \ include/linux/version.h headers_% \ - kernelrelease kernelversion + kernelversion config-targets := 0 mixed-targets := 0
@@ -1395,9 +1395,9 @@ checkstack: $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \ $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH) -kernelrelease: - $(if $(wildcard include/config/kernel.release), $(Q)echo $(KERNELRELEASE), \ - $(error kernelrelease not valid - run 'make prepare' to update it)) +kernelrelease: include/config/kernel.release + @echo $(KERNELRELEASE) + kernelversion: @echo $(KERNELVERSION)
Re: [PATCH 2/2] Makefile: "make kernelrelease" should show the correct full kernel version
Quoted 2 lines · Michal Marek
AFAICS it was broken even before 85a256d. Nevertheless, the patch is correct, but conflicts with 0915512 in the kbuild tree.
http://git.kernel.org/?p=linux/kernel/git/mmarek/kbuild-2.6.git;a=commitdiff;h=0915512 . It is also in linux-next.
Michal
Re: [PATCH 2/2] Makefile: "make kernelrelease" should show the correct full kernel version
In reply to Michal MarekQuoted 31 lines · Michal Marek
Quoted 30 lines · Amerigo Wang
From: Amerigo Wang<[email protected]>
Date: Mon, 28 Jun 2010 10:45:21 +0800After commit
85a256d8e0116c8f5ad276730830f5d4d473344d, 'make kernelrelease' doesn't show the correct full kernel version. This patch fixes it, 'make kernelrelease' will show the same version name with the one you finally get.Cc David Rientjes<[email protected]>Cc Michal Marek<[email protected]>Signed-off-by Amerigo Wang<[email protected]>--- Makefile | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)Makefile +1
-1@@ -414,7 +414,7 @@ endif no-dot-config-targets := clean mrproper distclean \ cscope TAGS tags help %docs check% \ include/linux/version.h headers_% \ - kernelrelease kernelversion + kernelversion config-targets := 0 mixed-targets := 0@@ -1468,8 +1468,7 @@ checkstack: $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH)
Quoted 11 lines
Makefile checkstack: · line 1402
Quoted 6 lines
Makefile +1
-2kernelrelease: - $(if $(wildcard include/config/kernel.release), $(Q)echo $(KERNELRELEASE), \ - $(error kernelrelease not valid - run 'make prepare' to update it)) + @echo $(kernelrelease) kernelversion: @echo $(KERNELVERSION)AFAICS it was broken even before 85a256d. Nevertheless, the patch is correct, but conflicts with 0915512 in the kbuild tree. What about this one?
Hmm, I am not sure. IIRC, my first try was also using KERNELRELEASE but it didn't work. Note, I may remember wrongly. :)
Have you tested it? Sorry that currently I don't have time to test it, I am quite busy with other stuffs...
Thanks!
Re: [PATCH 2/2] Makefile: "make kernelrelease" should show the correct full kernel version
In reply to Amerigo WangThis patch (actually 01ab17887 in 2.6.36-rc1) reveals what looks like a problem to me: make kernelrelease always regenerates include/config/kernel.release even if it's already more recent than include/config/auto.conf. Is this the expected behavior? Do we really need include/config/kernel.release to depend on FORCE?
$ make kernelrelease -d
[...]
Considering target file `kernelrelease'.
File `kernelrelease' does not exist.
Considering target file `include/config/kernel.release'.
Pruning file `include/config/auto.conf'.
Considering target file `FORCE'.
File `FORCE' does not exist.
Finished prerequisites of target file `FORCE'.
Must remake target `FORCE'.
Successfully remade target file `FORCE'.
Finished prerequisites of target file `include/config/kernel.release'.
Prerequisite `include/config/auto.conf' is older than target `include/config/kernel.release'.
Prerequisite `FORCE' of target `include/config/kernel.release' does not exist.
Must remake target `include/config/kernel.release'.Thanks,
Brice
Quoted 38 lines · Amerigo Wang
From: Amerigo Wang <[email protected]>
Date: Mon, 28 Jun 2010 10:45:21 +0800After commit
85a256d8e0116c8f5ad276730830f5d4d473344d, 'make kernelrelease' doesn't show the correct full kernel version. This patch fixes it, 'make kernelrelease' will show the same version name with the one you finally get.Cc David Rientjes <[email protected]>Cc Michal Marek <[email protected]>Signed-off-by Amerigo Wang <[email protected]>--- Makefile | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)Makefile +2
-3@@ -414,7 +414,7 @@ endif no-dot-config-targets := clean mrproper distclean \ cscope TAGS tags help %docs check% \ include/linux/version.h headers_% \ - kernelrelease kernelversion + kernelversion config-targets := 0 mixed-targets := 0@@ -1468,8 +1468,7 @@ checkstack: $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH) kernelrelease: - $(if $(wildcard include/config/kernel.release), $(Q)echo $(KERNELRELEASE), \ - $(error kernelrelease not valid - run 'make prepare' to update it)) + @echo $(kernelrelease) kernelversion: @echo $(KERNELVERSION)
Re: [PATCH 2/2] Makefile: "make kernelrelease" should show the correct full kernel version
Quoted 6 lines · Brice Goglin
This patch (actually
01ab17887in 2.6.36-rc1) reveals what looks like a problem to me: make kernelrelease always regeneratesinclude/config/kernel.releaseeven if it's already more recent thaninclude/config/auto.conf. Is this the expected behavior? Do we really needinclude/config/kernel.releaseto depend on FORCE?
I think so, because "LOCALVERSION=" can be given from command line, so we need to regenerate it.
Or am I missing your point here?
Signature · 2 lines
The opposite of love is not hate, it's indifference. - Elie Wiesel
Re: [PATCH 2/2] Makefile: "make kernelrelease" should show the correct full kernel version
Quoted 8 lines · Cong Wang
Quoted 6 lines · Brice Goglin
This patch (actually
01ab17887in 2.6.36-rc1) reveals what looks like a problem to me: make kernelrelease always regeneratesinclude/config/kernel.releaseeven if it's already more recent thaninclude/config/auto.conf. Is this the expected behavior? Do we really needinclude/config/kernel.releaseto depend on FORCE?
Quoted 5 lines
I think so, because "LOCALVERSION=" can be given from command line, so we need to regenerate it.
Or am I missing your point here?
Interesting. I assumed "make kernelrelease" was mainly here to display the release string (which means you would not need write access to the kernel build dir). And indeed make help says:
kernelrelease - Output the release version string
Right now, it looks like "update the version string and by the way display it too" (and you need write access).
Brice
Re: [PATCH 2/2] Makefile: "make kernelrelease" should show the correct full kernel version
Quoted 15 lines · Brice Goglin
Quoted 8 lines · Cong Wang
Quoted 6 lines · Brice Goglin
This patch (actually
01ab17887in 2.6.36-rc1) reveals what looks like a problem to me: make kernelrelease always regeneratesinclude/config/kernel.releaseeven if it's already more recent thaninclude/config/auto.conf. Is this the expected behavior? Do we really needinclude/config/kernel.releaseto depend on FORCE?Quoted 5 lines
I think so, because "LOCALVERSION=" can be given from command line, so we need to regenerate it.
Or am I missing your point here?
Quoted 7 lines
Interesting. I assumed "make kernelrelease" was mainly here to display the release string (which means you would not need write access to the kernel build dir). And indeed make help says:
kernelrelease - Output the release version string
Right now, it looks like "update the version string and by the way display it too" (and you need write access).
I believe you will also need write access even without this patch, if you compile a fresh kernel. So your assumption is not correct.
Signature · 2 lines
The opposite of love is not hate, it's indifference. - Elie Wiesel
Re: [PATCH 2/2] Makefile: "make kernelrelease" should show the correct full kernel version
Quoted 25 lines · Cong Wang
Quoted 16 lines · Brice Goglin
Quoted 9 lines · Cong Wang
Quoted 7 lines · Brice Goglin
This patch (actually
01ab17887in 2.6.36-rc1) reveals what looks like a
problem to me: make kernelrelease always regeneratesinclude/config/kernel.releaseeven if it's already more recent thaninclude/config/auto.conf. Is this the expected behavior? Do we really needinclude/config/kernel.releaseto depend on FORCE?Quoted 5 lines
I think so, because "LOCALVERSION=" can be given from command line, so we need to regenerate it.
Or am I missing your point here?
Quoted 7 lines
Interesting. I assumed "make kernelrelease" was mainly here to display the release string (which means you would not need write access to the kernel build dir). And indeed make help says:
kernelrelease - Output the release version string
Right now, it looks like "update the version string and by the way display it too" (and you need write access).
Quoted 3 lines
I believe you will also need write access even without this patch, if you compile a fresh kernel. So your assumption is not correct.
If I revert 01ab17887f4, I don't need write access. Things always worked fine before 2.6.36 as far I remember.
Brice
Re: [PATCH 2/2] Makefile: "make kernelrelease" should show the correct full kernel version
Quoted 26 lines · Brice Goglin
Quoted 25 lines · Cong Wang
Quoted 23 lines · Brice Goglin
Quoted 9 lines · Cong Wang
Quoted 7 lines · Brice Goglin
This patch (actually
01ab17887in 2.6.36-rc1) reveals what looks like a
problem to me: make kernelrelease always regeneratesinclude/config/kernel.releaseeven if it's already more recent thaninclude/config/auto.conf. Is this the expected behavior? Do we really needinclude/config/kernel.releaseto depend on FORCE?Quoted 5 lines
I think so, because "LOCALVERSION=" can be given from command line, so we need to regenerate it.
Or am I missing your point here?
Interesting. I assumed "make kernelrelease" was mainly here to display the release string (which means you would not need write access to the kernel build dir). And indeed make help says:
kernelrelease - Output the release version string
Right now, it looks like "update the version string and by the way display it too" (and you need write access).
Quoted 7 lines
Quoted 3 lines
I believe you will also need write access even without this patch, if you compile a fresh kernel. So your assumption is not correct.
If I revert
01ab17887f4, I don't need write access. Things always worked fine before 2.6.36 as far I remember.
Ah, I forgot Michal checked in a slightly different patch with mine. :)
Does the attached patch work for you?
---
Makefile +2 -2
@@ -1408,8 +1408,8 @@ checkstack: $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \ $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH) -kernelrelease: include/config/kernel.release - @echo $(KERNELRELEASE) +kernelrelease: + @echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" kernelversion: @echo $(KERNELVERSION)
Brice Goglin
Tested-byRe: [PATCH 2/2] Makefile: "make kernelrelease" should show the correct full kernel version
Quoted 6 lines · Cong Wang
Makefile +0
-0
Makefile checkstack: · line 1415
Quoted 10 lines
Makefile +2
-2@@ -1408,8 +1408,8 @@ checkstack: $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \ $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH) -kernelrelease: include/config/kernel.release - @echo $(KERNELRELEASE) +kernelrelease: + @echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" kernelversion: @echo $(KERNELVERSION)
It works, thanks!
Brice
Quoted 6 lines · Amerigo Wang
From: Amerigo Wang <[email protected]>
Date: Mon, 28 Jun 2010 10:42:28 +0800When I use make LOCALVERSION=local and
LOCALVERSION_AUTOis not set, I got "2.6.35-rc3local". It is supposed to be "2.6.35-rc3-local".
No, a `-' is not implied when using LOCALVERSION=.
Quoted 10 lines · David Rientjes
Quoted 6 lines · Amerigo Wang
From: Amerigo Wang<[email protected]>
Date: Mon, 28 Jun 2010 10:42:28 +0800When I use make LOCALVERSION=local and
LOCALVERSION_AUTOis not set, I got "2.6.35-rc3local". It is supposed to be "2.6.35-rc3-local".No, a `-' is not implied when using LOCALVERSION=.
But in your patch description, you said:
Without CONFIG_LOCALVERSION_AUTO, "make" results in v2.6.32-rc4+ unless the repository is at the Linux v2.6.32-rc4 commit (in which case the version would be v2.6.32-rc4). If "make LOCALVERSION=kbuild" were used, it results in v2.6.32-rc4-kbuild.
So, shouldn't that be "make LOCALVERSION=-kbuild"?
Thanks.
Quoted 9 lines · Cong Wang
But in your patch description, you said:
Without
CONFIG_LOCALVERSION_AUTO, "make" results in v2.6.32-rc4+ unless the repository is at the Linux v2.6.32-rc4 commit (in which case the version would be v2.6.32-rc4). If "make LOCALVERSION=kbuild" were used, it results in v2.6.32-rc4-kbuild.So, shouldn't that be "make LOCALVERSION=-kbuild"?
Yup, that's what it should have said. That doesn't mean that we need to change the long-standing behavior of LOCALVERSION= to add an implied `-', though.
Quoted 9 lines · David Rientjes
Quoted 7 lines · Cong Wang
But in your patch description, you said:
Without
CONFIG_LOCALVERSION_AUTO, "make" results in v2.6.32-rc4+ unless the repository is at the Linux v2.6.32-rc4 commit (in which case the version would be v2.6.32-rc4). If "make LOCALVERSION=kbuild" were used, it results in v2.6.32-rc4-kbuild.
Quoted 6 lines
Quoted 2 lines
So, shouldn't that be "make LOCALVERSION=-kbuild"?
Yup, that's what it should have said. That doesn't mean that we need to change the long-standing behavior of LOCALVERSION= to add an implied `-', though.
Ok, but your patch description is the only doc I found, so... :)
Thanks.
Quoted 9 lines · David Rientjes
Quoted 7 lines · Cong Wang
But in your patch description, you said:
Without
CONFIG_LOCALVERSION_AUTO, "make" results in v2.6.32-rc4+ unless the repository is at the Linux v2.6.32-rc4 commit (in which case the version would be v2.6.32-rc4). If "make LOCALVERSION=kbuild" were used, it results in v2.6.32-rc4-kbuild.
Quoted 6 lines
Quoted 2 lines
So, shouldn't that be "make LOCALVERSION=-kbuild"?
Yup, that's what it should have said. That doesn't mean that we need to change the long-standing behavior of LOCALVERSION= to add an implied `-', though.
Agreed, we should not enforce any new policy here. Someone might wish to use underscores as separators for instance.
Michal