Gentoo Archives: gentoo-user

From: Chuanwen Wu <wcw8410@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] different strange kernel name - 2.6.24-gentoo-r4-g506ab20b-dirty
Date: Wed, 30 Apr 2008 01:31:39
Message-Id: 7797aa370804291831n2c7f1a5m10f1a9fd997865b2@mail.gmail.com
In Reply to: Re: [gentoo-user] different strange kernel name - 2.6.24-gentoo-r4-g506ab20b-dirty by Willie Wong
1 Thank Willie!
2 On Tue, Apr 29, 2008 at 9:59 PM, Willie Wong <wwong@×××××××××.edu> wrote:
3 > On Tue, Apr 29, 2008 at 11:05:07AM +0800, Penguin Lover Chuanwen Wu squawked:
4 >
5 > > 1, Why I got a new kernel image(2.6.24-gentoo-r4-gb921d0de-dirty)
6 > > instead of using the old one (2.6.24-gentoo-r4-g506ab20b-dirty) ? As I
7 > > know if I add/change something as modules, all I need to do is "make
8 > > && make modules_install", and I don't need to install the kernel image
9 > > again and reboot my OS because all the changes are in modules and the
10 > > kernel image is all the same - fixed me please if I'm wrong.
11 > > 2, Why the kernel image including my codes have a very strange name
12 > > - 2.6.24-gentoo-r4-g506ab20b-dirty.
13 > >
14 >
15 > If you are coding for the kernel, I certainly hope you read the docs!
16 I have tried more than two hours.
17 In fact, at last I fixed this problem by READ Makefile in the root of
18 the kernel tree(/usr/src/linux).
19 From this Makefile, I find this section:
20 /*******************************************************************************/
21 # If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called
22 # and if the SCM is know a tag from the SCM is appended.
23 # The appended tag is determined by the SCM used.
24 #
25 # Currently, only git is supported.
26 # Other SCMs can edit scripts/setlocalversion and add the appropriate
27 # checks as needed.
28 ifdef CONFIG_LOCALVERSION_AUTO
29 _localver-auto = $(shell $(CONFIG_SHELL) \
30 $(srctree)/scripts/setlocalversion $(srctree))
31 localver-auto = $(LOCALVERSION)$(_localver-auto)
32 endif
33
34 localver-full = $(localver)$(localver-auto)
35 /************************************************************************/
36 I thought the "localver-auto" may be something like "-gb921d0de-dirty".
37 Then I checked out the file "scripts/setlocalversion", and commend all
38 the git thing. Now my scripts/setlocalversion is:
39
40 $ cat scripts/setlocalversion
41 #!/bin/sh
42 # Print additional version information for non-release trees.
43
44 usage() {
45 echo "Usage: $0 [srctree]" >&2
46 exit 1
47 }
48
49 cd "${1:-.}" || usage
50
51 # Check for git and a git repo.
52 #if head=`git rev-parse --verify HEAD 2>/dev/null`; then
53 # Do we have an untagged version?
54 # if git name-rev --tags HEAD | grep -E
55 '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
56 # printf '%s%s' -g `echo "$head" | cut -c1-8`
57 # fi
58
59 # Are there uncommitted changes?
60 # if git diff-index HEAD | read dummy; then
61 # printf '%s' -dirty
62 # fi
63 #fi
64
65 I am not familiar with Shell script, so maybe my solution is not very
66 good, but it fixed the problem :)
67
68 >
69 > Here's something from the help menu that pops up when you go to
70 > make menuconfig
71 > > General Setup > Automatically append version information to the version string
72 > and hit help for that entry
73 >
74 > "This will try to automatically determine if the current tree is a
75 > release tree by looking for git tags that belong to the current top
76 > of tree revision.
77 >
78 > "A string of the format -gxxxxxxxx will be added to the localversion
79 > if a git based tree is found. The string generated by this will be
80 > appended after any matching localversion files, and after the value
81 > set in CONFIG_LOCALVERSION"
82 >
83 > If you are maintainig a git repository, you'd be dealing with a tree
84 > always in flux (with the same versioning number I think), so it helps
85 > tremendously if there's some way of differentiating between different
86 > kernel images.
87 >
88 > This also means that if you don't want this behaviour, just uncheck
89 > that option in the configs.
90 >
91 > W
92 > --
93 > When a clock is hungry it goes back four seconds.
94 > Sortir en Pantoufles: up 508 days, 12:29
95 > --
96 > gentoo-user@l.g.o mailing list
97 >
98 >
99
100
101
102 --
103 wcw
104 --
105 gentoo-user@l.g.o mailing list