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
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 :)
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... :)
any patches you come up with, feel free to attach :) I always welcome suggestions, if not solutions through patches.
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*
Hi, Any luck with this?
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.
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)"
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})"
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
(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
(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.