Skip to contentSkip to conversation

Make kernel -dirty naming optional

PATCH Frederik Deweerdt 4 participants 7 messages Sep 22, 2006 – Oct 2, 2006

lore
Share & tools
lore
#0 lore raw

Hi Sam,

Could you consider applying this patch (or indicate me a better way to do it). It can be handy to be able to keep the naming independent of git.

Thanks,
Frederik

scripts/setlocalversion +1 -1
index 82e4993..62f2fef 100644
@@ -9,7 +9,7 @@ usage() {
 cd "${1:-.}" || usage
 
 # Check for git and a git repo.
-if head=`git rev-parse --verify HEAD 2>/dev/null`; then
+if [ -z "${IGNORE_GIT}" ] && head=`git rev-parse --verify HEAD 2>/dev/null`; then
 	# Do we have an untagged version?
 	if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
 		printf '%s%s' -g `echo "$head" | cut -c1-8`
#1 lore raw
Quoted 3 lines · Frederik Deweerdt

Could you consider applying this patch (or indicate me a better way to do it). It can be handy to be able to keep the naming independent of git.

FWIW, if I enable git name tagging, every kernel I compile is tagged as "dirty", even if I cloned it directly from kernel.org and didn't make any change to the source. That makes the "dirty" tag useless IMHO.

Erik

Signature · 2 lines
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands
#2 lore raw
Quoted 8 lines · Erik Mouw
Quoted 3 lines · Frederik Deweerdt

Could you consider applying this patch (or indicate me a better way to do it). It can be handy to be able to keep the naming independent of git.

FWIW, if I enable git name tagging, every kernel I compile is tagged as "dirty", even if I cloned it directly from kernel.org and didn't make any change to the source. That makes the "dirty" tag useless IMHO.

make mrproper
make allmodconfig
make prepare
make kernelrelease

	2.6.18-ga5fa393b
vi MAINTAINERS
make prepare
make kernelrelease
	2.6.18-ga5fa393b-dirty

So it wrks for me.
Can you provice a few more details what steps you do when you see it failing.

Sam

#3 lore raw
Quoted 9 lines · Sam Ravnborg
Quoted 3 lines · Erik Mouw

FWIW, if I enable git name tagging, every kernel I compile is tagged as "dirty", even if I cloned it directly from kernel.org and didn't make any change to the source. That makes the "dirty" tag useless IMHO.

make mrproper
make allmodconfig
make prepare
make kernelrelease

Quoted 8 lines
	2.6.18-ga5fa393b
vi MAINTAINERS
make prepare
make kernelrelease
	2.6.18-ga5fa393b-dirty

So it wrks for me.
Can you provice a few more details what steps you do when you see it failing.

make mrproper
cp ../config-2.6 .config
yes no | make oldconfig
fakeroot make targz-pkg
...
Tarball successfully created in /home/erik/git/linux-2.6/linux-2.6.18-g4f5537de-dirty.tar.gz

(I use fakeroot in order to make sure that all files in the tarball are root.root. Otherwise I would have to chown /lib/modules or modprobe would complain.)

Erik

PS: I'm on holiday for a week, so don't expect an immediate reply.

Signature · 3 lines
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands
| Data lost? Stay calm and contact Harddisk-recovery.com
#4 lore raw
Quoted 4 lines · Erik Mouw

make mrproper
cp ../config-2.6 .config
yes no | make oldconfig
fakeroot make targz-pkg

fakeroot makes the working tree files appear to be owned by root.root but does not know git uses the file ownership information recorded in the index and uses it to detect if the working tree is dirty. Because the index says they are owned by you (the one who pulled from the kernel.org and owns the files in the real world not fakeroot world), you get -dirty suffix.

Perhaps "fakeroot -u" would help.

#5 lore raw
Quoted 7 lines · Junio C Hamano
Quoted 4 lines · Erik Mouw

make mrproper
cp ../config-2.6 .config
yes no | make oldconfig
fakeroot make targz-pkg

Quoted 6 lines

fakeroot makes the working tree files appear to be owned by root.root but does not know git uses the file ownership information recorded in the index and uses it to detect if the working tree is dirty. Because the index says they are owned by you (the one who pulled from the kernel.org and owns the files in the real world not fakeroot world), you get -dirty suffix.

Aha, thanks for the explanation.

Quoted 1 line

Perhaps "fakeroot -u" would help.

Yes, that helps, I just build linux-2.6.18-gd834c165.tar.gz. Thanks!

Erik

Signature · 2 lines
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands
#6 lore raw
In reply to Frederik Deweerdt
Quoted 5 lines · Frederik Deweerdt

Hi Sam,

Could you consider applying this patch (or indicate me a better way to do it). It can be handy to be able to keep the naming independent of git.

make menuconfig
General setup |
Automatically append version information ...

is used to control if you append such info or not. That should solve it for your case.

Sam