Page 1 of 1

Some problems on compiling modules

PostPosted: Jan 4th, '16, 10:51
by Tasem
Hi, I'm fairly new and have little knowledge on these sorts of things, so I apologize in advance if I give little to no detail on stuff that's actually relevant to the problem. Anyway, here it goes.
My teacher gave me a premade file which I had to compile. so I compile it from the konsole, using ./mmake kello command. But then, the konsole gives me this error message :
Code: Select all
make -C /lib/modules/4.1.13-desktop-2.mga5/build SUBDIRS=/home/tasem/Desktop/KernMod/kernelmod modules
make[1]: *** /lib/modules/4.1.13-desktop-2.mga5/build: No such file or directory.  Stop.
Makefile:9: recipe for target 'default' failed
make: *** [default] Error 2

What is going wrong ? Do I have to install a packet ?
A help would be appreciated.
Thanks !

Re: Some problems on compiling modules

PostPosted: Jan 4th, '16, 11:25
by doktor5000
Tasem wrote:
Code: Select all
make[1]: *** /lib/modules/4.1.13-desktop-2.mga5/build: No such file or directory.  Stop.

What is going wrong ? Do I have to install a packet ?

Yes, the line above tells you what is missing. /lib/modules/KERNELVERSION/build should be a link to kernel sources or at least to the kernel header files so you can compile additional modules for your running kernel.
Code: Select all
[doktor5000@Mageia5]─[10:21:28]─[~] ll /lib/modules/$(uname -r)/build
lrwxrwxrwx 1 root root 37 Nov 20 11:03 /lib/modules/4.1.13-desktop-2.mga5/build -> /usr/src/kernel-4.1.13-desktop-2.mga5/


Best install kernel-desktop-devel-latest metapackage which installs the kernel-devel package for the running kernel and also takes care of keeping it up-to-date.

If that is not sufficient and you need the full kernel sources (that would be pretty uncommon when building a simple module, but might happen) you may need to install the kernel-source package.

Don't hesitate to ask if you have further questions.