I need to start somewhere on a fairly mysterious and complex topic.
#1. I just need to recompile a single kernel module for Linux.
#2. I have all the source files I need and there is a Makefile and KConfig files in the directory.
#3. If I go to that directory and type the command: make thefile.ko, I get an error:
make: *** No rule to make target 'thefile.ko'. Stop.
So then there is no real recipes in there to convert .c/.asm files into their .o or .ko counterparts. Firstly, why? And secondly, what needs to be done to get those rules in there?
If there is a document or readme that describes this, please point me to it. But numerous Linux distros have this style of make and the files are quite similar.
Any help appreciated.
How to compile a kernel module?
-
- Posts: 409
- Joined: Sat 01 Oct 2016, 00:27
I'm starting to understand
I have now found the build flags in the directory a few above my drivers, in the 3.10.0-327.el7.x86_64 direcdtory.
It starts with VERSION = 3
PATCHLEVE = 10, etc..
So perhaps I just need to navigate to that directory and run the make.
It starts with VERSION = 3
PATCHLEVE = 10, etc..
So perhaps I just need to navigate to that directory and run the make.
-
- Posts: 409
- Joined: Sat 01 Oct 2016, 00:27
I am geting some info from the make help command
I'll try to descend into the directory by specifying it.
If I run the command make help, it gives a recipe for how to navigate to a directory in the make, as in make dir/....
If I run the command make help, it gives a recipe for how to navigate to a directory in the make, as in make dir/....
-
- Posts: 409
- Joined: Sat 01 Oct 2016, 00:27
It doesn't work
make /pathtomydrive/mydriver.ko, I get an error
make[1]: *** NO rule to make target /usr/src/kernels/3.10.0-327.el7.x86_64/arch/x86/syscalls/syscall_32.tbl', needed by etc..
It doesn't behave the way the help file makes it seem.
make[1]: *** NO rule to make target /usr/src/kernels/3.10.0-327.el7.x86_64/arch/x86/syscalls/syscall_32.tbl', needed by etc..
It doesn't behave the way the help file makes it seem.
-
- Posts: 409
- Joined: Sat 01 Oct 2016, 00:27
Someone posted Hans Reenickec's rpm file
Let's hope
-
- Posts: 409
- Joined: Sat 01 Oct 2016, 00:27
I have the rpm files installed now
So far no matter what I type, it errors out on arch/x86 directory. I have only one direcxtory populated iwth source code, the aic7xxx. All others are empty, othe than having the source files. But for now, I'll use the driver someone found for me. It seems to be working. I just cannot find a way to get power to the tape drive. I can't find any cables that reach and I don't have connectors so I'm scrounging right now.
Keef wrote:You just need to type 'make' on its own. It will be (should be) in the right place to find the source files.
-
- Posts: 409
- Joined: Sat 01 Oct 2016, 00:27
I scrounged up some power from an old PC/coffee table
So I can delay any driver work now that my machine has detected the tape drive.
-
- Posts: 1543
- Joined: Mon 22 Feb 2016, 19:43
Since this seems to be a general "how do you compile a kernel module" thread, here is how peebee compiled the broadcom_wl driver:
http://www.murga-linux.com/puppy/viewto ... 946#884946
http://www.murga-linux.com/puppy/viewto ... 946#884946