Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 126013 - linux-info.eclass could handle CONFIG_LOCALVERSION_AUTO better
Summary: linux-info.eclass could handle CONFIG_LOCALVERSION_AUTO better
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: John Mylchreest (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-12 20:49 UTC by Mathis Ahrens
Modified: 2006-07-20 20:32 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mathis Ahrens 2006-03-12 20:49:19 UTC
Hi all,

I stumbled over this when emerging usb-pwc-re for my new
git repository kernel. It installed into a wrong directory.

Problem is: With kernels >=2.6.16 and the above config set,
SCMs like git are allowed to append strings to the kernelversion
("2.6.16-rc6" in this case) and the result will be the
kernelrelease ("2.6.16-rc6-g7cafae52" here). [1]
uname -r will show the latter and modules_install will also use
the latter, but linux-info only provides access to the former plus
localversion via KV_FULL, if I understood correctly.

I think this only makes a difference if you run your own git tree,
(and you do not use a tag -> head undefined)
so I rated this as enhancement, but it would be nice if modules 
like usb-pwc-re were provided with a way to figure the correct 
directory anyway.

Actually, linux-info could use "make kernelrelease" if version is
high enough (>=2.6.16-rc*) or look for KERNEL_DIR/.kernelrelease which
will be created after "make *config" is run.

Cheers,
Mathis 

[1] see KERNEL_DIR/scripts/setlocalversion
Comment 1 John Mylchreest (RETIRED) gentoo-dev 2006-03-14 02:45:34 UTC
I'll actually move this to a minor bug, and I'm sure its a dupe but cant find my original request :)

I will address this shortly, this is becoming a bigger issue but since we dont support git-based sources (except for git-sources) at present, it isn't high priprity.

Many thanks for the informative bug report, it's not too often they come so well written :)
Comment 2 Mathis Ahrens 2006-03-14 22:14:28 UTC
You're very welcome John, thanks for considering this!
I tried to come up with a patch today, but stumbled
over unexpected behaviour in the kernel Makefile. 
Gone hunting the bug there... :)
Comment 3 John Mylchreest (RETIRED) gentoo-dev 2006-03-15 00:57:50 UTC
any patches you come up with, feel free to attach :)
I always welcome suggestions, if not solutions through patches.
Comment 4 Mathis Ahrens 2006-03-19 13:47:58 UTC
I am still interested in this, but Sam Ravnborg has confirmed there is a bug in the Makefile of 2.6.16rc6, and it seems to be too late in release cycle to fix, so .... don't expect anything  until 2.6.17-rc*
Comment 5 John Mylchreest (RETIRED) gentoo-dev 2006-04-01 15:58:33 UTC
Hi,

Any luck with this?
Comment 6 Micheal Marineau (RETIRED) gentoo-dev 2006-05-18 11:02:47 UTC
John, would just tacking this on at the end of the KV_LOCAL calculation be acceptable?

    # For things like git that can append extra stuff:
    [ -e ${KV_DIR}/scripts/setlocalversion ] &&
         KV_LOCAL="${KV_LOCAL}$(sh ${KV_DIR}/scripts/setlocalversion)"

The other option would be to remove all of the the crazy KV_LOCAL calculation and simply set KV_FULL to the contents of .kernelrelease, but that wouldn't work on older kernels.
Comment 7 Micheal Marineau (RETIRED) gentoo-dev 2006-05-18 11:15:16 UTC
Opps, a small mistake in the above comment. the setlocalversion script must be run from within the source tree so the last line should actually look like this:

KV_LOCAL="${KV_LOCAL}$(cd ${KV_DIR} && sh ${KV_DIR}/scripts/setlocalversion)"
Comment 8 Micheal Marineau (RETIRED) gentoo-dev 2006-05-18 11:17:58 UTC
Oh, it can take an argument so this would be better: (shuts up now)

KV_LOCAL="${KV_LOCAL}$(sh ${KV_DIR}/scripts/setlocalversion ${KV_DIR})"
Comment 9 Martin Hierling 2006-06-15 09:27:33 UTC
Hi,

this is no only a hurdle for git based stuff, in my case it is a "U" appended to the kernelversion for xen-U Domains (i dit it manually, not a xen install/make/configure script) . btw everybody can set this variable via "make menuconfig" or similar to build different kernels from the same source. 
Angain in my case open-iscsi failed to put the modules in the right dir because of the missing CONFIG_LOCALVERSION . So a solution in portage is apreciated.

Martin
Comment 10 John Mylchreest (RETIRED) gentoo-dev 2006-06-24 06:58:32 UTC
(In reply to comment #7)
> Opps, a small mistake in the above comment. the setlocalversion script must be
> run from within the source tree so the last line should actually look like
> this:
> 
> KV_LOCAL="${KV_LOCAL}$(cd ${KV_DIR} && sh ${KV_DIR}/scripts/setlocalversion)"


Hey Michael, Yeah this looks good.
If you've performed your own testing, feel free to commit this directly as you suggested. I don't want to delay this further.

Cheers,
John

Comment 11 Micheal Marineau (RETIRED) gentoo-dev 2006-07-20 20:32:18 UTC
(In reply to comment #10)
> Hey Michael, Yeah this looks good.
> If you've performed your own testing, feel free to commit this directly as you
> suggested. I don't want to delay this further.
> 
> Cheers,
> John
> 

I finally commiteed the above changes yesterday and just now added a fix so it only grabs the git version if CONFIG_LOCALVERSION_AUTO is set. Should be all happy now, marking this bug as resolved.

Martin, regarding your comment #9, the eclass has had support for the normal CONFIG_LOCALVERSION for a while now. If it still misbehaves open a new bug and we will try to figgure out what's broken. Thanks.