2006-09-22 10:03:20

by Frederik Deweerdt

[permalink] [raw]
Subject: Make kernel -dirty naming optional

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



diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 82e4993..62f2fef 100644
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -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`


2006-09-22 10:49:36

by Erik Mouw

[permalink] [raw]
Subject: Re: Make kernel -dirty naming optional

On Fri, Sep 22, 2006 at 12:02:10PM +0000, Frederik Deweerdt wrote:
> 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

--
+-- Erik Mouw -- http://www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands

2006-09-24 08:55:28

by Sam Ravnborg

[permalink] [raw]
Subject: Re: Make kernel -dirty naming optional

On Fri, Sep 22, 2006 at 12:02:10PM +0000, Frederik Deweerdt wrote:
> 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

2006-09-24 09:02:30

by Sam Ravnborg

[permalink] [raw]
Subject: Re: Make kernel -dirty naming optional

On Fri, Sep 22, 2006 at 12:49:34PM +0200, Erik Mouw wrote:
> On Fri, Sep 22, 2006 at 12:02:10PM +0000, Frederik Deweerdt wrote:
> > 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

2006-09-24 10:11:58

by Erik Mouw

[permalink] [raw]
Subject: Re: Make kernel -dirty naming optional

On Sun, Sep 24, 2006 at 11:07:43AM +0200, Sam Ravnborg wrote:
> On Fri, Sep 22, 2006 at 12:49:34PM +0200, Erik Mouw wrote:
> > 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.

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.

--
+-- Erik Mouw -- http://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

2006-09-25 21:44:38

by Junio C Hamano

[permalink] [raw]
Subject: Re: Make kernel -dirty naming optional

Erik Mouw <[email protected]> writes:

> 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.


2006-10-02 10:51:30

by Erik Mouw

[permalink] [raw]
Subject: Re: Make kernel -dirty naming optional

On Mon, Sep 25, 2006 at 02:44:36PM -0700, Junio C Hamano wrote:
> Erik Mouw <[email protected]> writes:
>
> > 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.

Aha, thanks for the explanation.

> Perhaps "fakeroot -u" would help.

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


Erik

--
+-- Erik Mouw -- http://www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands