You are not logged in.

#1 2014-06-27 02:30:44

Name Taken
Banned
Registered: 2014-04-09
Posts: 113

Custom kernel headers

I very recently started experimenting with custom kernels using different add-on patches and configurations. I think my question can best be summarized from the Arch Wiki Virtualbox page

As the virtualbox-host-dkms package requires compilation, make sure you have the kernel headers corresponding to your custom kernel version to prevent this error from happening

Your kernel headers for kernel your custom kernel version cannot be found at /usr/lib/modules/your custom kernel version/build or /usr/lib/modules/your custom kernel version/source.

If you use a self-compiled kernel and have used make modules_install to install its modules, folders /usr/lib/modules/your custom kernel version/build and (...)/source will be symlinked to your kernel sources. These will act as the kernel headers you need. If you have not removed these kernel sources yet, you have nothing to do.

How can I get new modules to build if I delete the original make folder?

Offline

#2 2014-06-27 07:49:48

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,732
Website

Re: Custom kernel headers

You PKGBUILD for the custom kernel should also provide the custom heads, just install them.  You will need a corresponding custom virtualbox-modules package that depends on the custom headers/kernel.

Offline

#3 2014-06-27 08:18:50

Name Taken
Banned
Registered: 2014-04-09
Posts: 113

Re: Custom kernel headers

graysky wrote:

You PKGBUILD for the custom kernel should also provide the custom heads, just install them.  You will need a corresponding custom virtualbox-modules package that depends on the custom headers/kernel.

I'm not familiar with PKGBUILD. Assuming I followed step by step everything in the Kernels/Compilation/Traditional wiki guide, what are the next commands I should execute? I know I will need a corresponding custom virtualbox-modules package which DKMS builds if I have the kernel sources folder so I'm asking about if I delete that.

Offline

#4 2014-06-27 08:56:48

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,732
Website

Re: Custom kernel headers

Don't build via the traditional method.  Use a PKGBUILD which is superior on so many levels.

Offline

#5 2014-06-27 09:14:00

Name Taken
Banned
Registered: 2014-04-09
Posts: 113

Re: Custom kernel headers

graysky wrote:

Don't build via the traditional method.  Use a PKGBUILD which is superior on so many levels.

Every guide and video and documentation on kernel.org I saw showed building from the kernel sources folder so naturally that is what I followed. Is my question not possible?

Last edited by Name Taken (2014-06-27 09:14:20)

Offline

#6 2014-06-27 11:36:41

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,732
Website

Re: Custom kernel headers

I don't have time to explain.  Your life will be much easier if you do as I suggested.  Perhaps someone else can help you.

Offline

#7 2014-06-27 12:48:51

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Custom kernel headers

Name Taken wrote:

Is my question not possible?

Yes, it's possible.

But we're trying to persuade you to use your distro's package manager, to greatly lessen the probability that you mess up your system.

Offline

#8 2014-06-27 12:49:00

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Custom kernel headers

Build your kernel any way you want, just don't delete the build directory like you did the first time. Have a look at the contents of the official kernel headers package, and use the equivalent files from your custom build.

Offline

#9 2014-06-27 12:55:47

Name Taken
Banned
Registered: 2014-04-09
Posts: 113

Re: Custom kernel headers

tomk wrote:

Build your kernel any way you want, just don't delete the build directory like you did the first time. Have a look at the contents of the official kernel headers package, and use the equivalent files from your custom build.

I didn't delete it the first time and I was testing in a VM. My laptop boots off a 4GB USB Drive so having a persistent 1.8GB folder is not feasible.

Last edited by Name Taken (2014-06-27 12:58:07)

Offline

#10 2014-06-27 13:27:30

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Custom kernel headers

You referred to deleting "the original make folder", which was vague - further explanation would be useful to anyone else who tries to help you.

Offline

#11 2014-06-27 13:32:15

Name Taken
Banned
Registered: 2014-04-09
Posts: 113

Re: Custom kernel headers

tomk wrote:

You referred to deleting "the original make folder", which was vague - further explanation would be useful to anyone else who tries to help you.

I said "if" as in not past tense. In my second post I decided to be more accurate by referring it as the "kernel sources" as in the Arch Wiki Virtualbox page I quoted.

Offline

#12 2014-06-27 14:02:33

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Custom kernel headers

What exactly is your issue then?

Offline

#13 2014-06-27 14:05:25

Name Taken
Banned
Registered: 2014-04-09
Posts: 113

Re: Custom kernel headers

tomk wrote:

What exactly is your issue then?

My laptop boots off a 4GB USB Drive so having a persistent 1.8GB folder is not feasible. How can I get new modules to build if I delete the original kernel sources folder?

Offline

#14 2014-06-27 14:12:20

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Custom kernel headers

OK. Re-read my post #8 above, but this time substitute the word 'keep' instead of the word 'use'.


Beyond that, I would join with others above and strongly recommend that you package your kernel and its headers correctly.

Offline

Board footer

Powered by FluxBB