1
votes
$ make 
gcc -Wall -D__KERNEL__ -DLINUX -DMODULE -O -I /lib/modules/`uname -r`/build/include/   -c -o procmon.o procmon.c
In file included from /lib/modules/3.0.0-12-generic/build/include/linux/kernel.h:13:0,
                 from procmon.c:22:
/lib/modules/3.0.0-12-generic/build/include/linux/linkage.h:5:25: fatal error: asm/linkage.h: No such file or directory
compilation terminated.
make: *** [procmon.o] Error 1

Im trying to compile using the make file of procmon system analysis module. I got the above message can any one help me out what is the problem?

1
check you have kernel sources or at least kernel headers installed. You can do it with apt-getOttavio Campana
it was problem with kernel version. the kernel headers are already there.Bala

1 Answers

1
votes

you need to change your makefile like this:

obj-m :=procmon.o

all:

    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

install: all

    rm -rf /dev/procmon
    mknod /dev/procmon c 240 1
    chmod 400 /dev/procmon

clean:

    rm -f *.o
    rm -f *~
    rm -f a.out
    rm -f test*
    rm -f DEADJOE

dist: clean

    cd .. ; tar cvzf procmon.tar.gz procmon

If you get any errors like devfs related, your procmon code will not work on recent kernels, you need to change the code accordingly