0

Does the kernel module need a linux kernel to finish the compilation ?
Can I compile a kernel module without kernel ?

What I mean is: copy the needed kernel header, manually write makefile or manually compile. and without using the kernel building system.

3 Answers 3

2

Lovespring,

You will need a copy of the kernel source or kernel headers for the kernel you are attempting to compile against. The kernel source is generally not installed with the system by default.

Typically, you can pull down a copy of the kernel source through whatever package/repository manager your have.

Sign up to request clarification or add additional context in comments.

2 Comments

Can i manually compile kernel module without the kernel build system. see: linuxforums.org/forum/kernel/…
That forum is discussing make files to build the entire kernel. For your individual kernel module you will have to produce your own Makefile for it. But you don't need to BUILD the entire kernel just to build your single kernel module. The makefiles for an individual kernel module are fairly simple as its usually a single .c source file. Can you give me a better description of exactly what you are trying to accomplish?
0

You may not need an installed kernel, but you will definitely need a copy of the source to be able to compile your module.

Comments

0

Does the kernel module need a linux kernel to finish the compilation ? Can I compile a kernel module without kernel ?

Yes, you can have single Makefile for your module source code. It still needs to find the kernel headers and some basic build tools.

you do not need to have the kernel sources, and you do not need to recompile the kernel.

Page #94 of this chapter may help: http://www.linuxfordevices.com/files/misc/newnes_embedded_linux_ch7.pdf

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.