Compiling Kernel Drivers for SUSE 10 By Example
Novell Cool Solutions: Feature
By Peter Van den Wildenbergh
Digg This -
Posted: 3 Nov 2005
Getting a Logitech Quickam (Zoom) working under SUSE Linux 10
License and DisclaimerSee 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.
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.
SUSE Linux 10 with kernel 220.127.116.11
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).
PreparationFirst 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:
It should come back with something like:
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:
rpm -qa kernel*
On my system this returns:
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:
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.
cd /usr/src/linux make cloneconfig make modules_prepare
That last statement should comeback with something like:
CHK /usr/src/linux-2.6.13-15/include/linux/version.h make: `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:
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
/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.
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_prepareWhatever 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
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)
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.
AppendixAdditional Documentation Sources:
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com