Virtual Brain Online Logo

Bookmark: Root \ Linux \ Compiling Kernel Drivers for SUSE 10 By Example

Compiling Kernel Drivers for SUSE 10 By Example


Last Updated: 2005-12-17

Compiling Kernel Drivers for SUSE 10 By Example
Novell Cool Solutions: Feature
By Peter Van den Wildenbergh
Posted: 3 Nov 2005

Getting a Logitech Quickam (Zoom) working under SuSE Linux 10

License and Disclaimer
See http://www.opencontent.org/opl.shtml for the full software and documentation license. Basically, you can copy, redistribute, or modify this "how to," provided that modified versions, if redistributed, are also covered by the OpenContent License. Please e-mail a copy of your modified document to pvdw <@> criticalcontrol <.> com. Use this document at your own risk; it comes with no warranty. See the OpenContent License mentioned above.

Problem

Intermediate Linux users and Linux newbies are often turned away from Linux because they can't get a particular driver to work.
If the driver isn't available in a .rpm, things can get complicated, read compiling from source...
On top of that a standard SUSE 10 install requires some upfront steps before a driver can be compiled without errors.

Environment

SUSE Linux 10 with kernel 2.6.13.15
I did only test the below explained procedure on a SUSE 10, but it should work on SUSE 9.x aswell (if you alter the kernel version numbers).

Preparation
First make sure you have installed the kernel-sources, and the version of the sources is correct.
If you don't know what kernel version is currently installed on your SUSE try:


Command:
cat /proc/version


It should come back with something like:


Command:
Linux version 2.6.13-15-default (geeko@buildhost)
(gcc version 4.0.2 20050901 (prerelease) (SUSE Linux))
#1 Tue Sep 13 14:56:15 UTC 2005


telling you that you are using version 2.6.13-15-default.

To see if sources are installed you can either startup YaST (software management) or just type:


Command:
rpm -qa kernel*


On my system this returns:


Command:
kernel-update-tool-0.9-10
kernel-docs-2.6.13-15
kernel-default-2.6.13-15
kernel-source-2.6.13-15
kernel-default-nongpl-2.6.13-15


Note the line kernel-source.
We also will need make and gcc, test for this the same way:


Command:
rpm -qa make gcc

make-3.80-188
gcc-4.0.2_20050901-3


If any of these packages are missing install them using YaST.

Now log in into a root console (superuser) and configure the compile environment to reflect your actual set up.


Command:
cd /usr/src/linux
make cloneconfig
make modules_prepare


That last statement should comeback with something like:


Command:
CHK /usr/src/linux-2.6.13-15/include/linux/version.h
make[1]: `arch/i386/kernel/asm-offsets.s' is up to date.


As with everything with Linux things can be donme in different ways.
The same as above can be achieved by executing the following as root:


Command:
cp /usr/src/linux-2.6.13-15-obj/i386/default/.config /usr/src/linux/.config
cp /usr/src/linux-2.6.13-15-obj/i386/default/scripts/mod/modpost /usr/src/linux/scripts/modpost
cp /usr/src/linux-2.6.13-15-obj/i386/default/scripts/genksyms/genksyms /usr/src/linux/scripts/genksyms/genksyms
cp /usr/src/linux-2.6.13-15-obj/i386/default/scripts/basic/fixdep /usr/src/linux/scripts/basic/fixdep
cp /usr/src/linux-2.6.13-15-obj/i386/default/scripts/mod/modpost /usr/src/linux/scripts/mod/modpost


If you don't do these steps chances are big you get a


Command:
/bin/sh scripts/basic/fixdep: File not found


error when trying to compile the driver(s) you need.

To make things complete, you also need to put Module.symvers into the right place.


Command:
cp /boot/symvers-2.6.13-15-i386-default.gz /usr/src/linux
mv symvers-2.6.13-15-i386-default.gz Module.symvers.gz
gunzip /usr/src/linux/Module.symvers.gz
make modules_prepare


Whatever approach you use, you are now ready to compile a kernel module.

Note: If you run a YaST update and a new kernel gets installed you might want to download the new kernel sources too, and adjust your compile environment, and recompile the driver(s).

Example: Getting a Logitech Quickam (Zoom) working under SuSE Linux 10


Command:
cd /usr/local/src
wget http://www.saillard.org/linux/pwc/files/pwc-10.0.9-rc1.tar.bz2


(take a peek in http://www.saillard.org/linux/pwc/files to see the current release of this driver)


Command:
tar xjf pwc-10.0.9-rc1.tar.bz2

cd pwc-10.0.9-rc1
make
make install
modprobe pwc


Done! Fire up XawTV and start playing.

Appendix
Additional Documentation Sources:
http://www.saillard.org/linux/pwc
Originally Posted by Skylinux @ 2005-12-17 10:18:56
Last update by Skylinux @ 2005-12-17 10:19:54

 

No Comments yet .....

 

Add Your Comment:

Note: All posts require administrator approval. Please allow 24 hours for message approval.

Name:
E-Mail:
Title
Plain text only, less then 65 000 characters.

Which one of the following words is the name of an animal group: letter milk insects computer chair

Please answer the question above and type the answer into the text box below.