Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 127714 - vanilla-sources ebuild always creates /usr/src/linux symlink
Summary: vanilla-sources ebuild always creates /usr/src/linux symlink
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-26 23:08 UTC by Dirk Heinrichs
Modified: 2006-03-27 06:06 UTC (History)
0 users

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 Dirk Heinrichs 2006-03-26 23:08:24 UTC
It seems the vanilla-sources ebuild doesn't obei "-symlink" in USE. The
/usr/src/linux symlink is (re-)created at every update.

# emerge -pv vanilla-sources

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] sys-kernel/vanilla-sources-2.6.16  USE="doc -build -symlink" 0 kB

# epm -qi vanilla-sources
Name        : vanilla-sources
Version     : 2.6.16
Release     :                                     Slot: 2.6.16
Install date: Mon Mar 27 08:32:36 2006      Build Host: louisa
Group       : sys-kernel                       License: GPL-2
Size        : 223206412
Packager    : brix
URL         : http://www.kernel.org
Summary     : Full sources for the Linux kernel

# ll /usr/src/linux
lrwxrwxrwx 1 root root 12 Mar 27 08:33 /usr/src/linux -> linux-2.6.16/
Comment 1 John Mylchreest (RETIRED) gentoo-dev 2006-03-27 02:40:16 UTC
did /usr/src/linux exist previously?
it creates the symlink regardless if it doesnt exist.
Comment 2 Dirk Heinrichs 2006-03-27 03:19:24 UTC
(In reply to comment #1)
> did /usr/src/linux exist previously?
No.

> it creates the symlink regardless if it doesnt exist.
Yes, that's what the bugreport is about.
Comment 3 John Mylchreest (RETIRED) gentoo-dev 2006-03-27 04:01:13 UTC
Ah, OK now I see where you are coming from.
if /usr/src/linux doesnt exist, then we should always create this symlink to satisfy other ebuilds in the tree which use kernel sources as a base for kernel information.

Perhaps -symlink is a little misleading, considering it still creates the symlink, but this really is desired behaviour. If /usr/src/linux were to already exist, pointing to anything you liek really, then it wouldn't re-write /usr/src/linux.

Does this cause any kind of issues outside of the misleading impression that the useflag gives (when not used)?
Comment 4 Dirk Heinrichs 2006-03-27 04:17:40 UTC
(In reply to comment #3)
> Ah, OK now I see where you are coming from.
> if /usr/src/linux doesnt exist, then we should always create this symlink to
> satisfy other ebuilds in the tree which use kernel sources as a base for kernel
> information.

OK.

> Perhaps -symlink is a little misleading, considering it still creates the
> symlink, but this really is desired behaviour. If /usr/src/linux were to
> already exist, pointing to anything you liek really, then it wouldn't re-write
> /usr/src/linux.

Didn't know that.

> Does this cause any kind of issues outside of the misleading impression that
> the useflag gives (when not used)?

No. Just had that LKML post of Linus about the symlink issue in mind.
Comment 5 Henrik Brix Andersen 2006-03-27 04:33:25 UTC
(In reply to comment #4)
> No. Just had that LKML post of Linus about the symlink issue in mind.

Do you have an URL for that post, please?
Comment 6 Daniel Drake (RETIRED) gentoo-dev 2006-03-27 04:40:30 UTC
If it's the old one that gets referenced a lot, then yes, Linus is right, but that doesn't apply to Gentoo. We have separate kernel headers in /usr/include/ and we recommend rebuilding glibc every time the /usr/include kernel headers change. This was not the case for most distros back then, and may even still be true today.
Comment 7 Dirk Heinrichs 2006-03-27 04:56:27 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > No. Just had that LKML post of Linus about the symlink issue in mind.
> 
> Do you have an URL for that post, please?

http://www.uwsg.iu.edu/hypermail/linux/kernel/0007.3/0587.html
Comment 8 John Mylchreest (RETIRED) gentoo-dev 2006-03-27 06:04:07 UTC
this is the primary reason why os's ship linux/os-headers.
basically, userland *should* use libc, and libc *should* extract the linux kernel headers.

Sometimes however things do need the kernel headers directly, and as such should look in /usr/include[/linux] since anything compiling against /usr/src/linux is broken. (I could point people to mplayer here). The reason we use a /usr/src/linux symlink isnt because of compile-time dependancies for things in userland. Its for a point to reference when we need to obtain kernel information, or build kernel modules (which genuinely need the kernel source).
Many people might say "Why not use `uname -r`?" but the answer here is simple. We dont tie you in to the current running kernel. We allow for cross-compile, compiling for a source your about to boot, etc etc.
Comment 9 John Mylchreest (RETIRED) gentoo-dev 2006-03-27 06:05:05 UTC
assuming everyone is happy, and my waffling made a small degree of sense, I'll close this as wontfix. However, I encourage your active bug reporting and please continue to do so :)

I like people being observant - it keeps us on our toes.
Comment 10 John Mylchreest (RETIRED) gentoo-dev 2006-03-27 06:06:15 UTC
(In reply to comment #8)
> basically, userland *should* use libc, and libc *should* extract the linux
> kernel headers.

s/extract/abstract/