LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   debian - where is the build directory in /lib/modules? (https://www.linuxquestions.org/questions/programming-9/debian-where-is-the-build-directory-in-lib-modules-4175506152/)

eantoranz 05-26-2014 11:53 PM

debian - where is the build directory in /lib/modules?
 
Hi!

I just installed a debian box (running on qemu... don't have much installed as a matter of fact).

I'm trying to compile the sbull driver but I find there's no build directory inside /lib/mudules:

Code:

root@debian:~/sbull# make
make -C /lib/modules/3.2.0-4-686-pae/build M=/root/sbull modules
make: *** /lib/modules/3.2.0-4-686-pae/build: No such file or directory.  Stop.
make: *** [all] Error 2
root@debian:~/sbull# ls /lib/modules/3.2.0-4-686-pae/build
ls: cannot access /lib/modules/3.2.0-4-686-pae/build: No such file or directory

that makes sense... the directory is missing indeed so... where is it? I bet there's something I have to install (I already instaled linux-sources, just in case).

Thanks in advance.

eantoranz 05-27-2014 12:26 AM

perhaps the problem is my Makefile:

Code:

obj-m := sbull.o

PWD := $(shell pwd)
KDIR := /lib/modules/$(shell uname -r)/build

all:
        make -C $(KDIR) M=$(PWD) modules
clean:
        make -C $(KDIR) M=$(PWD) clean


evo2 05-27-2014 12:30 AM

Hi,

it should be in the linux-headers package that correponds to your kernel. Eg
Code:

apt-get install linux-headers-$(uname -r)
Evo2.

eantoranz 05-27-2014 12:40 AM

Dude, you are right... now I'm getting a ton of error messages from the compilation process. So glad. Thanks!


All times are GMT -5. The time now is 06:00 AM.