You are not logged in.

#1 2008-06-30 08:21:52

dyscoria
Member
Registered: 2008-01-10
Posts: 1,007

Kernel headers and /usr/src/linux

I could do with a little (edit: a lot of) clarification for these things.

As i understand at the moment, kernel headers (in /usr/include) are required for compiling software, allowing them to build to the correct kernel version? These headers don't necessarily have to be built from the same kernel version as you are using, but preferably should be. (also, what are the effects if they aren't the same version?)

The /usr/src/linux-${pkgver} folder also contains kernel headers? except this time it's used for compiling the kernel? something to do with a symlink too? I'm confused tongue

Thanks!


flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)

Offline

#2 2008-06-30 09:28:33

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: Kernel headers and /usr/src/linux

see if this makes sense...

(first link in google kernel headers symlink, btw)


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

#3 2008-06-30 09:41:10

dyscoria
Member
Registered: 2008-01-10
Posts: 1,007

Re: Kernel headers and /usr/src/linux

Yeah already tried google (and if you read that article it really doesn't provide a clear explanation). I was hoping for some further clarification from someone who might be know their stuff? I don't understand why there has to be headers in both /usr/src/linux and /usr/include.


flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)

Offline

#4 2008-06-30 10:03:44

JGC
Developer
Registered: 2003-12-03
Posts: 1,664

Re: Kernel headers and /usr/src/linux

The ones in /usr/include are headers to make userspace applications interact with kernel API.  The headers in /usr/src/linux-${kernelver} are installed so you can build kernel modules against your running kernel. These modules won't build against the headers in /usr/include.

The headers in /usr/include have to match the headers where glibc was built against. In older versions of glibc the kernel headers in /usr/include used to be included in the glibc package.

Offline

#5 2008-06-30 10:51:16

dyscoria
Member
Registered: 2008-01-10
Posts: 1,007

Re: Kernel headers and /usr/src/linux

Thanks. That clears it up!

/usr/src/linux = for building kernel modules (e.g. nvidia)
/usr/include = for accomodating the userspace <--> kernel space link


flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)

Offline

#6 2008-07-14 14:45:56

dyscoria
Member
Registered: 2008-01-10
Posts: 1,007

Re: Kernel headers and /usr/src/linux

Another question!

Once you've built the kernel modules you want (e.g. nvidia), is there actually any need for /usr/src/linux anymore?
In other words, are there any consequences (other than not being able to build another kernel module) from deleting that folder?

Thanks.


flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)

Offline

#7 2008-07-14 14:48:39

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Kernel headers and /usr/src/linux

No, they are not required for operating the kernel, only for building additional modules.

Further... the correct way to refer to the kernel source is /lib/modules/$kernel/build - which is a symlink to the correct source location - it doesnt have to live in /usr/src/linux.

Offline

#8 2008-07-14 14:56:58

dyscoria
Member
Registered: 2008-01-10
Posts: 1,007

Re: Kernel headers and /usr/src/linux

Awesome thanks!

Now I can safely delete the rather large 400MB folder big_smile


flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)

Offline

Board footer

Powered by FluxBB