LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable to compile loadable module for FC5 (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-compile-loadable-module-for-fc5-602393/)

pathak_ashish 11-26-2007 02:11 AM

Unable to compile loadable module for FC5
 
Hi,

I am facing problem while compiling loadable module for FC5 kernel 2.6.15.1_2054FC5. I am not able to get files named "hello.o" & "hello.ko" after compiling module "hello.c".
This is how my Makefile looks like:

obj -m += hello.o

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

This is the error which I am getting when do make:

make -C /lib/modules/2.6.15-1.2054_FC5/build M=/root modules
make[1]: Entering directory `/usr/src/redhat/BUILD/kernel-2.6.15/linux-2.6.15.i686'

WARNING: Symbol version dump /usr/src/redhat/BUILD/kernel-2.6.15/linux-2.6.15.i686/Module.symvers
is missing; modules will have no dependencies and modversions.

Building modules, stage 2.

MODPOST

make[1]: Leaving directory `/usr/src/redhat/BUILD/kernel-2.6.15/linux-2.6.15.i686'

How I will be able to get file Module.symers?

colucix 11-27-2007 11:11 AM

Module.symers is installed by the kernel-devel package in
Code:

/usr/src/kernels/$(uname -r)-i686/

pathak_ashish 12-01-2007 02:26 AM

now what should I do compile module
 
Thanks for replying colucix...

So what can I do get that file(Module.symers)to proceed further with lodable module compilation.

colucix 12-01-2007 08:17 AM

Well... it looks like there is a problem with the path of the kernel headers. Please can you post the output of the following commands?
Code:

uname -a
rpm -q kernel kernel-devel
rpm -ql kernel-devel | grep Module.symvers
ls -ld /lib/modules/$(uname -r)/build

The latter should be a link to the directory containing the kernel headers, the ones provided by the kernel-devel packages. I suspect there is something wrong here.

pathak_ashish 12-03-2007 04:13 AM

how to install kernel-dlevel package ?
 
Hi colucix,

Thanks for replying. As you told I executed following commands:

1. uname -a

Linux localhost.localdomain 2.6.15-1.2054_FC5 #1 Tue Mar 14 15:48:33 EST 2006 i686 i686 i386 GNU/Linux

2. rpm -q kernel kernel-dlevel

kernel-2.6.15-1.2054_FC5
package kernel-dlevel is not installed

3. rpm -ql kernel-dlevel | grep Module.symvers
gave no output

4. ls -ld /lib/modules/$(uname -r)/build

lrwxrwxrwx 1 root root 53 Nov 21 19:32 /lib/modules/2.6.15-1.2054_FC5/build -> /usr/src/redhat/BUILD/kernel-2.6.15/linux-2.6.15.i686

You were spoton with the answer. Now how should I install Kernel-dlevel package?

colucix 12-03-2007 04:41 AM

It is kernel-devel (you made a typo). You can re-try the correct one
Code:

rpm -ql kernel-devel | grep Module.symvers
if you find that the kernel-devel package is actually not installed, first of all you have to install it by your usual package manager, being sure to match exactly the version of the current kernel
Code:

kernel-devel-2.6.15-1.2054_FC5
Then, please retry commands 3 and 4 from my previous post.

Aquarius_Girl 10-03-2009 02:16 AM

I m too facing the problem stated by 'pathak_ashish'.

As per 'colucix's advice i tried to install kernel-devel through yast on suse 10.3. Yast is unable to find the stated package !!

kindly help !


All times are GMT -5. The time now is 04:58 PM.