I am new to linux .i have to compile a device driver sample code.
i tried to install linux-source-2.6.38 from the synaptic, then it showed the message quoted below:
This package provides the source code for the Linux kernel version 2.6.38.
This package is mainly meant for other packages to use, in order to build custom flavours.
If you wish to use this package to create a custom Linux kernel, then it is suggested that you investigate the package kernel-package, which has been designed to ease the task of creating kernel image packages.
If you are simply trying to build third-party modules for your kernel, you do not want this package. Install the appropriate linux-headers package instead.
So get confused that:
1) a linux-source needed or not for my device driver code compilation ?
2) if i install the new kernel how can i work with the new kernel ?
2 Answers 2
You probably need packages like linux-headers-2.6-amd64 and linux-kbuild-2.6. Use apt-cache search linux headers and apt-cache search linux kbuild to find exactly the name of the packages.
You could use apt-cache search linux headers and apt-cache search linux kbuild to get the exact name of the package.
If you are making a module (a dynamically loadable kernel module *.ko) you don't need to build a new kernel. Use insmod or modprobe to load it.
Comments
for your first question, source code is not required for compiling your kernel modules and make sure that while inserting your module you must have root privilege
and for your second question if you want to compile the source code refer any kernel compilation links like http://www.cyberciti.biz/tips/compiling-linux-kernel-26.html
Comments
Explore related questions
See similar questions with these tags.