LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   cannot find linux/module.h (https://www.linuxquestions.org/questions/fedora-35/cannot-find-linux-module-h-611558/)

eerpini 01-06-2008 03:17 PM

cannot find linux/module.h
 
i am using a fedora 8 distribution , when i tried to write a sample module and compile it for loading it dynamically into the kernel , it gave an error saying that there is no header as such : <linux/module.h>
i could not find the reason , .......
i have installed all the required RPMS , the list of kernel related RPMS installed are :

kernel-debug-2.6.23.1-42.fc8
kernel-2.6.23.1-42.fc8
kernel-headers-2.6.23.1-42.fc8
kernel-PAE-2.6.23.1-42.fc8
kernel-xen-devel-2.6.21-2950.fc8
kernel-PAE-devel-2.6.23.1-42.fc8
kernel-debug-devel-2.6.23.1-42.fc8
kernel-xen-2.6.21-2950.fc8


but i am still not able to get the header file /usr/include/linux/module.h .....
can anyone help me out ....?

jailbait 01-06-2008 03:48 PM

You may need a symbolic link. When Fedora 8 installs the header files or kernel source /usr/src/kernels they are usually installed with the version number included in the name. That way you can have more than one version's source installed at the same time. The compile typically looks for a header file or source file with a general name so you need a symbolic link from the general name to the release specific name. For example if you have linux source installed as /usr/src/kernels/linux-2.6.23.1-42.fc8 then you need a symbolic link like:

ln -s /usr/src/kernels/linux-2.6.23.1-42.fc8 /usr/src/linux

so that the compiler can find the correct version of the linux source. I am not sure that I have the symbolic link described correctly for Fedora but it will be similar to what I posted.

---------------------------
Steve Stites

Drakeo 01-06-2008 04:50 PM

Quote:

Originally Posted by jailbait (Post 3013578)
You may need a symbolic link. When Fedora 8 installs the header files or kernel source /usr/src/kernels they are usually installed with the version number included in the name. That way you can have more than one version's source installed at the same time. The compile typically looks for a header file or source file with a general name so you need a symbolic link from the general name to the release specific name. For example if you have linux source installed as /usr/src/kernels/linux-2.6.23.1-42.fc8 then you need a symbolic link like:

ln -s /usr/src/kernels/linux-2.6.23.1-42.fc8 /usr/src/linux

so that the compiler can find the correct version of the linux source. I am not sure that I have the symbolic link described correctly for Fedora but it will be similar to what I posted.

---------------------------
Steve Stites

True but do not for get a lot of this is dont through /lib/module/uname -r/build
or /lib/modules/uname -r/source
I found on a couple distros even if the source was there the symbolic link to the source was not there. build is linked to headers or source and source is linked to source {uname -r.]
mine is /lib/modules/2.6.22.7/build
and also /lib/modules/2.6.22.7/ source
I always make sure both links are the for some scripts are one way only.
the header file you may be missing is from another program that is also need to fulfill the dependences.

Drakeo 01-06-2008 05:00 PM

Quote:

Originally Posted by eerpini (Post 3013556)
i am using a fedora 8 distribution , when i tried to write a sample module and compile it for loading it dynamically into the kernel , it gave an error saying that there is no header as such : <linux/module.h>
i could not find the reason , .......
i have installed all the required RPMS , the list of kernel related RPMS installed are :

kernel-debug-2.6.23.1-42.fc8
kernel-2.6.23.1-42.fc8
kernel-headers-2.6.23.1-42.fc8
kernel-PAE-2.6.23.1-42.fc8
kernel-xen-devel-2.6.21-2950.fc8
kernel-PAE-devel-2.6.23.1-42.fc8
kernel-debug-devel-2.6.23.1-42.fc8
kernel-xen-2.6.21-2950.fc8


but i am still not able to get the header file /usr/include/linux/module.h .....
can anyone help me out ....?

if you cant find the header file in /usr/include/linux that tells me you need to install a program that is missing the name of the header will tell you this program name. then what ever f8 is doing now days for a package manager try to find the program.
when we install programs the header files that are built go to the /usr/include/linux. and from what you told me you do have a /usr/include/linux
if you install the full source it uninstalls the pre built headers and installs the full source witch also becomes the /usr/include/ linux.
all about kernel flavor.

dsouza 07-02-2009 11:44 AM

The one package that you seem to be missing is kernel-devel.
PD'S


All times are GMT -5. The time now is 01:54 AM.