Want to compile a driver, but keep having problems
I keep trying to compile the qc-usb driver for my quick cam web camera. It said all I needed was the kernel source, gcc and v4l. I did the "apt-get install kernel-source-2.6.10" and then extracted the file to "/usr/src/linux-2.6.10" and made a symlink to the "/usr/src/linux". However, it kept getting errors. I figured it was because the source had not been compiled, so I got the kernel-source package from the mepis repositories and copied the files into the kernel source directory, overwriting any same files (and also copied the /boot/config-2.6.10 to /usr/src/linux/.config). That almost worked, but it needed the fixdep program... so I went into that direcotry and compiled it with "gcc fixdep.c". It got past that, but now it needs another file, modpost. I tried compiling that the same way as before, but got an error message saying that I didn't have "elfconfig.h". I suspect these programs will leave if I actually compile the kernel, but the last time I did that it was horrendous... Is there a way I can compile it without installing it to my computer?
I'm using Simply Mepis 3.3 (debian testing/unstable) |
Since you have a 2.6 series kernel, you should be able to compile your kernel to the exact currently running settings. This command should do it (run it from the source directory):
Code:
make mrproper cloneconfig modules all |
Ok, I'll try that.
|
I did that and got this output:
Code:
root@5[linux-2.6.10]# make mrproper cloneconfig modules all |
Do you have a file /proc/config.gz? If so, run:
Code:
zcat /proc/config.gz > .config && make modules all |
It says "gzcat: command not found"
|
Re: Want to compile a driver, but keep having problems
Quote:
Code:
fakeroot make-kpkg clean |
The last time I did that, there were all sorts of problems. None of the modules would load, including the NVidia one so I didn't have a graphical environment.
I'd like to do what rjlee suggested and compile an exact version of the kernel I'm running, but without installing it. |
Quote:
|
Code:
zcat: /proc/config.gz: No such file or directory |
If you don't have the /proc/config.gz file, then you will need to find a copy of the .config file for your system and copy it to /usr/src/linux.
There might be one on the install disks for your distro; then again, there might not be — in which case you will probably have to recompile your kernel. You can probably upgrade your kernel to a version that supports /proc/config.gz; in this case the make cloneconfig trick will work. |
Umm... My configuration should be in /boot/config-2.6.10, at least I think.
|
OK; do this:
Code:
cp /boot/config-2.6.10 /usr/src/linux |
Code:
make: *** No rule to make target `olddeps'. Stop. |
Sorry; that was a typo (fixed now in above post); you could probably have figured this out from the README.
Running “make” will only compile the kernel image; it won't set up dependencies, which is the most important step here. It also won't make modules IIRC. |
All times are GMT -5. The time now is 04:37 AM. |