Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 388525 - Make kernel source auto discovered
Summary: Make kernel source auto discovered
Status: CLOSED FIXED
Alias: None
Product: Linux Tools
Classification: Tools
Component: Systemtap (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 2.0   Edit
Assignee: Otavio Pontes CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-31 09:20 EDT by Alexander Kurtakov CLA
Modified: 2013-05-08 14:45 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kurtakov CLA 2012-08-31 09:20:46 EDT
The preference initializer should look for e.g. /usr/src/kernels and if it founds sources and the preference is not set to remote and path is missing to auto setup it.
Comment 1 Otavio Pontes CLA 2012-09-10 09:15:47 EDT
Nice idea. But what should we do if there is more than one kernel source in /usr/src/kernels? choose one of them? Or just point to /usr/src/kernels to display all kernel sources?
Comment 2 Alexander Kurtakov CLA 2012-09-10 09:19:26 EDT
What about pointing to the current running one ? uname -r gives the exact version name as present in /usr/src/kernels on Fedora, isn't it the same on other distros?
Comment 3 Otavio Pontes CLA 2012-09-10 09:35:42 EDT
(In reply to comment #2)
> What about pointing to the current running one ? uname -r gives the exact
> version name as present in /usr/src/kernels on Fedora, isn't it the same on
> other distros?

Not everyone follows this. There are distros that adds the kernel source directly in /usr/src (not in /usr/src/kernels), named linux-{VERSION_NUMBER}. Sles does this as far as I know. Gentoo and arch too. Some distros use to create a symlink in /usr/src/linux pointing to newest linux kernel src installed.

We could look for /usr/src/linux, /usr/src/kernels/$(uname -r), /usr/src/linux-$(uname -r). Is there any other place we can look for kernel sources?
Comment 4 Alexander Kurtakov CLA 2012-09-10 09:41:03 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > What about pointing to the current running one ? uname -r gives the exact
> > version name as present in /usr/src/kernels on Fedora, isn't it the same on
> > other distros?
> 
> Not everyone follows this. There are distros that adds the kernel source
> directly in /usr/src (not in /usr/src/kernels), named
> linux-{VERSION_NUMBER}. Sles does this as far as I know. Gentoo and arch
> too. Some distros use to create a symlink in /usr/src/linux pointing to
> newest linux kernel src installed.
> 
> We could look for /usr/src/linux, /usr/src/kernels/$(uname -r),
> /usr/src/linux-$(uname -r). Is there any other place we can look for kernel
> sources?

From previous experience I have different view on the problem. We look for the places where distros supported by current contributors put things and let the rest contribute their fix. We can never support every possible odd combination.
Comment 5 Otavio Pontes CLA 2012-09-10 09:53:30 EDT
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > What about pointing to the current running one ? uname -r gives the exact
> > > version name as present in /usr/src/kernels on Fedora, isn't it the same on
> > > other distros?
> > 
> > Not everyone follows this. There are distros that adds the kernel source
> > directly in /usr/src (not in /usr/src/kernels), named
> > linux-{VERSION_NUMBER}. Sles does this as far as I know. Gentoo and arch
> > too. Some distros use to create a symlink in /usr/src/linux pointing to
> > newest linux kernel src installed.
> > 
> > We could look for /usr/src/linux, /usr/src/kernels/$(uname -r),
> > /usr/src/linux-$(uname -r). Is there any other place we can look for kernel
> > sources?
> 
> From previous experience I have different view on the problem. We look for
> the places where distros supported by current contributors put things and
> let the rest contribute their fix. We can never support every possible odd
> combination.

I see. It is nice for us to have this working for rhel and sles. And the solution I mentioned solve both distros. I commented about gentoo and arch because I know about them, but I am really not worried about gentoo/arch users. They should know what they are doing. :)
Comment 6 Sami Wagiaalla CLA 2013-01-23 10:06:52 EST
Fixed here: https://git.eclipse.org/r/#/c/9849/