FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 04-29-2008, 03:05 AM
"Chuanwen Wu"
 
Default different strange kernel name - 2.6.24-gentoo-r4-g506ab20b-dirty

Hi,
I want to add my codes to the kernel source( I use gentoo-source ) and
compile it as modules.
All my codes are under the directory /usr/src/linu/fs/dnfs/.
The problem is why everytime after I changed my codes and re-complied
the kernel, I got a different strange kernel image.

Here is the details:
linux # make && make modules_install
CHK include/linux/version.h
[...]
LD kernel/built-in.o
CC [M] fs/dnfs/dnfs.o
################ my codes
fs/dnfs/dnfs.c: In function 'init_once':
fs/dnfs/dnfs.c:22: warning: ISO C90 forbids mixed declarations and code
fs/dnfs/dnfs.c: In function 'init_dnfs_fs':
fs/dnfs/dnfs.c:51: warning: ISO C90 forbids mixed declarations and code
GEN .version
CHK include/linux/compile.h
UPD include/linux/compile.h
CC init/version.o
LD init/built-in.o
LD .tmp_vmlinux1
KSYM .tmp_kallsyms1.S
AS .tmp_kallsyms1.o
LD .tmp_vmlinux2
KSYM .tmp_kallsyms2.S
AS .tmp_kallsyms2.o
LD vmlinux.o
MODPOST vmlinux.o
LD vmlinux
SYSMAP System.map
SYSMAP .tmp_System.map
AS arch/x86/boot/header.o
CC arch/x86/boot/version.o
LD arch/x86/boot/setup.elf
OBJCOPY arch/x86/boot/setup.bin
OBJCOPY arch/x86/boot/compressed/vmlinux.bin
GZIP arch/x86/boot/compressed/vmlinux.bin.gz
LD arch/x86/boot/compressed/piggy.o
LD arch/x86/boot/compressed/vmlinux
OBJCOPY arch/x86/boot/vmlinux.bin
BUILD arch/x86/boot/bzImage
Root device is (8, 38)
Setup is 10904 bytes (padded to 11264 bytes).
System is 2763 kB
Kernel: arch/x86/boot/bzImage is ready (#22)
Building modules, stage 2.
MODPOST 12 modules
[...]
CC fs/dnfs/dnfs.mod.o ######### build modules
LD [M] fs/dnfs/dnfs.ko
[...]
INSTALL fs/dnfs/dnfs.ko ######### install modules
[...]
DEPMOD 2.6.24-gentoo-r4-gb921d0de-dirty ############### a
different strange kernel image name

then, the kernel image I am using now is:
# uname -r
2.6.24-gentoo-r4-g506ab20b-dirty

From the above, I get two questions:
1, Why I got a new kernel image(2.6.24-gentoo-r4-gb921d0de-dirty)
instead of using the old one (2.6.24-gentoo-r4-g506ab20b-dirty) ? As I
know if I add/change something as modules, all I need to do is "make
&& make modules_install", and I don't need to install the kernel image
again and reboot my OS because all the changes are in modules and the
kernel image is all the same - fixed me please if I'm wrong.
2, Why the kernel image including my codes have a very strange name
- 2.6.24-gentoo-r4-g506ab20b-dirty.

Any help will be appreciated!
--
wcw
--
gentoo-user@lists.gentoo.org mailing list
 
Old 04-29-2008, 01:59 PM
Willie Wong
 
Default different strange kernel name - 2.6.24-gentoo-r4-g506ab20b-dirty

On Tue, Apr 29, 2008 at 11:05:07AM +0800, Penguin Lover Chuanwen Wu squawked:
> 1, Why I got a new kernel image(2.6.24-gentoo-r4-gb921d0de-dirty)
> instead of using the old one (2.6.24-gentoo-r4-g506ab20b-dirty) ? As I
> know if I add/change something as modules, all I need to do is "make
> && make modules_install", and I don't need to install the kernel image
> again and reboot my OS because all the changes are in modules and the
> kernel image is all the same - fixed me please if I'm wrong.
> 2, Why the kernel image including my codes have a very strange name
> - 2.6.24-gentoo-r4-g506ab20b-dirty.
>

If you are coding for the kernel, I certainly hope you read the docs!

Here's something from the help menu that pops up when you go to
make menuconfig
> General Setup > Automatically append version information to the version string
and hit help for that entry

"This will try to automatically determine if the current tree is a
release tree by looking for git tags that belong to the current top
of tree revision.

"A string of the format -gxxxxxxxx will be added to the localversion
if a git based tree is found. The string generated by this will be
appended after any matching localversion files, and after the value
set in CONFIG_LOCALVERSION"

If you are maintainig a git repository, you'd be dealing with a tree
always in flux (with the same versioning number I think), so it helps
tremendously if there's some way of differentiating between different
kernel images.

This also means that if you don't want this behaviour, just uncheck
that option in the configs.

W
--
When a clock is hungry it goes back four seconds.
Sortir en Pantoufles: up 508 days, 12:29
--
gentoo-user@lists.gentoo.org mailing list
 
Old 04-30-2008, 01:31 AM
"Chuanwen Wu"
 
Default different strange kernel name - 2.6.24-gentoo-r4-g506ab20b-dirty

Thank Willie!
On Tue, Apr 29, 2008 at 9:59 PM, Willie Wong <wwong@princeton.edu> wrote:
> On Tue, Apr 29, 2008 at 11:05:07AM +0800, Penguin Lover Chuanwen Wu squawked:
>
> > 1, Why I got a new kernel image(2.6.24-gentoo-r4-gb921d0de-dirty)
> > instead of using the old one (2.6.24-gentoo-r4-g506ab20b-dirty) ? As I
> > know if I add/change something as modules, all I need to do is "make
> > && make modules_install", and I don't need to install the kernel image
> > again and reboot my OS because all the changes are in modules and the
> > kernel image is all the same - fixed me please if I'm wrong.
> > 2, Why the kernel image including my codes have a very strange name
> > - 2.6.24-gentoo-r4-g506ab20b-dirty.
> >
>
> If you are coding for the kernel, I certainly hope you read the docs!
I have tried more than two hours.
In fact, at last I fixed this problem by READ Makefile in the root of
the kernel tree(/usr/src/linux).
From this Makefile, I find this section:
/************************************************** *****************************/
# If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called
# and if the SCM is know a tag from the SCM is appended.
# The appended tag is determined by the SCM used.
#
# Currently, only git is supported.
# Other SCMs can edit scripts/setlocalversion and add the appropriate
# checks as needed.
ifdef CONFIG_LOCALVERSION_AUTO
_localver-auto = $(shell $(CONFIG_SHELL)
$(srctree)/scripts/setlocalversion $(srctree))
localver-auto = $(LOCALVERSION)$(_localver-auto)
endif

localver-full = $(localver)$(localver-auto)
/************************************************** **********************/
I thought the "localver-auto" may be something like "-gb921d0de-dirty".
Then I checked out the file "scripts/setlocalversion", and commend all
the git thing. Now my scripts/setlocalversion is:

$ cat scripts/setlocalversion
#!/bin/sh
# Print additional version information for non-release trees.

usage() {
echo "Usage: $0 [srctree]" >&2
exit 1
}

cd "${1:-.}" || usage

# Check for git and a git repo.
#if 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`
# fi

# Are there uncommitted changes?
# if git diff-index HEAD | read dummy; then
# printf '%s' -dirty
# fi
#fi

I am not familiar with Shell script, so maybe my solution is not very
good, but it fixed the problem

>
> Here's something from the help menu that pops up when you go to
> make menuconfig
> > General Setup > Automatically append version information to the version string
> and hit help for that entry
>
> "This will try to automatically determine if the current tree is a
> release tree by looking for git tags that belong to the current top
> of tree revision.
>
> "A string of the format -gxxxxxxxx will be added to the localversion
> if a git based tree is found. The string generated by this will be
> appended after any matching localversion files, and after the value
> set in CONFIG_LOCALVERSION"
>
> If you are maintainig a git repository, you'd be dealing with a tree
> always in flux (with the same versioning number I think), so it helps
> tremendously if there's some way of differentiating between different
> kernel images.
>
> This also means that if you don't want this behaviour, just uncheck
> that option in the configs.
>
> W
> --
> When a clock is hungry it goes back four seconds.
> Sortir en Pantoufles: up 508 days, 12:29
> --
> gentoo-user@lists.gentoo.org mailing list
>
>



--
wcw
--
gentoo-user@lists.gentoo.org mailing list
 

Thread Tools




All times are GMT. The time now is 06:57 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org