PDA

View Full Version : Where is kernel source



MelD
23-Jun-2015, 19:45
Hi,

I am new to SLE and need to install a driver for my network adapter.

The problem is I need the kernel source to compile it.

The source is not at /lib/modules/$(KVER)/build where the makefile expects it.

Where is it? Do I need to download it separately?

Thanks for any help.

Regards,

Mel

ab
23-Jun-2015, 21:13
The actual source is on an alternate (not DVD1) DVD I believe. Are you
sure you need the source, though, and not just the headers? I thought you
could add a kernel-headers package which had the headers precompiled and
ready for you. If so, try this:



zypper se kernel | grep headers


If you find something that sounds good, presumably 'kernel-headers', then
install it:



sudo zypper in 'kernel-headers'


If you really need the source, find the alternate DVD it is on (or search
using zypper for that too perhaps) and then install the kernel-source package.

--
Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below...

MelD
24-Jun-2015, 02:01
Hi AB.

Thanks for your reply. I have to confess I am a rank beginner with linux and don't know what I am doing.

I am just trying to make the makefile for linux that came with my network adapter and it says it can't find the kernel source. I don't care if I use the kernel-headers or kernel-source but don't really know how to do either.

I tried running your first command and it didn't give an error or a result - just went to the next line.

I tried running the second command anyway and it prompted me for media so I quit.

I looked on the second DVD and did find "scr" and "nosrc" directories. There were a bunch of files - mostly .rpm but I wasn't sure which was the kernel-source package.

The most promising one was /nosrc/Kernel-Default-3.12.28-4.6.nosrc.rpm. Is that the source package?

If so how do I install it?

Thanks for your help AB or anyone!

Mel

ab
24-Jun-2015, 02:29
Let's take a step back for a second.

I presume you are on SLES, as in SUSE Linux Enterprise Server (vs.
Desktop, SLED). I also presume you are on SLES 11, probably with some
Service/Support Pack (SP), but it could be version 12 which isn't entirely
new anymore. Could you confirm which version and SP you have? If you
have recently installed, the media probably indicate the version.
Otherwise you can run the following commands and get some output to paste
here:



cat /etc/SuSE-release
cat /etc/os-release


Next, why are you trying to compile something for your network adapter?
Most of the time network things just work out of the box. If yours does
not, what led you to try compiling from source? What
make/model/version/etc. is it?

Is this a server system, or a workstation/laptop? If the latter, you may
want to try SLED (Desktop) or even openSUSE, depending on your end goals.
If you want enterprise distribution support and stability, SLE is for
you; if you want the latest/greatest, openSUSE is a better bet, but it all
depends on your goals.

Finally, I'm guessing you have not setup your system for install channels.
In Linux-land we usually do not bother with download software manually,
instead benefiting from software repositories from our Linux vendors which
have thousands and thousands of packages just for us. 'zypper' is the
command to access those. To search, you use:



zypper se packageNameHere


and to install, the other command posted previously. If you do not get
results back from something like 'zypper se kernel' then chances are your
install media are not in the box, or accessible via the network. If you
built the box with a CD or USB source, put/plug those back in and try
again. If not, setting up a repository is not hard, but it takes a second
or two. Knowing which media you need to download will depend on
version/patch questions above, so let's start there, assuming you really
do need to compile drivers manually at all (I used to do that a fair bit,
but it's been the better part of a decade since I had to).

--
Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below...

MelD
24-Jun-2015, 22:46
AB,

Thanks for your help. I am going to re-post this problem with different wording.

Mel