LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-06-2005, 05:44 PM   #1
justintime32
Member
 
Registered: Sep 2004
Distribution: SimplyMepis 3.3 (Debian testing/unstable)
Posts: 123

Rep: Reputation: 15
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)
 
Old 05-06-2005, 05:48 PM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
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
 
Old 05-06-2005, 05:50 PM   #3
justintime32
Member
 
Registered: Sep 2004
Distribution: SimplyMepis 3.3 (Debian testing/unstable)
Posts: 123

Original Poster
Rep: Reputation: 15
Ok, I'll try that.
 
Old 05-06-2005, 05:59 PM   #4
justintime32
Member
 
Registered: Sep 2004
Distribution: SimplyMepis 3.3 (Debian testing/unstable)
Posts: 123

Original Poster
Rep: Reputation: 15
I did that and got this output:
Code:
root@5[linux-2.6.10]# make mrproper cloneconfig modules all
make[1]: Nothing to be done for `Makefile'.
  CLEAN   scripts/basic
  CLEAN   .config
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/split-include
  HOSTCC  scripts/basic/docproc
make[2]: *** No rule to make target `cloneconfig'.  Stop.
make[1]: *** [cloneconfig] Error 2
make: *** [cloneconfig] Error 2
 
Old 05-06-2005, 06:17 PM   #5
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
Do you have a file /proc/config.gz? If so, run:
Code:
zcat /proc/config.gz > .config && make modules all

Last edited by rjlee; 05-07-2005 at 06:18 PM.
 
Old 05-06-2005, 06:26 PM   #6
justintime32
Member
 
Registered: Sep 2004
Distribution: SimplyMepis 3.3 (Debian testing/unstable)
Posts: 123

Original Poster
Rep: Reputation: 15
It says "gzcat: command not found"
 
Old 05-06-2005, 06:33 PM   #7
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Re: Want to compile a driver, but keep having problems

Quote:
Originally posted by justintime32
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)
Why do you not compile and install the kernel source you have. Just copy the config for the running kernel then.

Code:
fakeroot make-kpkg clean
fakeroot make-kpkg --append-to-version=.050506 kernel_image
Then install the .deb kernel package and reboot then should have no complaints about missing anything from the module compile.
 
Old 05-06-2005, 06:41 PM   #8
justintime32
Member
 
Registered: Sep 2004
Distribution: SimplyMepis 3.3 (Debian testing/unstable)
Posts: 123

Original Poster
Rep: Reputation: 15
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.
 
Old 05-07-2005, 06:19 PM   #9
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
Quote:
Originally posted by justintime32
It says "gzcat: command not found"
Sorry! That was a typo; you should use zcat not gzcat. I've edited the post with the correct command-line.
 
Old 05-08-2005, 11:30 AM   #10
justintime32
Member
 
Registered: Sep 2004
Distribution: SimplyMepis 3.3 (Debian testing/unstable)
Posts: 123

Original Poster
Rep: Reputation: 15
Code:
zcat: /proc/config.gz: No such file or directory
Will anything else work?
 
Old 05-08-2005, 04:44 PM   #11
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
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.
 
Old 05-09-2005, 02:02 PM   #12
justintime32
Member
 
Registered: Sep 2004
Distribution: SimplyMepis 3.3 (Debian testing/unstable)
Posts: 123

Original Poster
Rep: Reputation: 15
Umm... My configuration should be in /boot/config-2.6.10, at least I think.
 
Old 05-09-2005, 03:58 PM   #13
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
OK; do this:
Code:
cp /boot/config-2.6.10 /usr/src/linux
cd /usr/src/linux
make oldconfig modules all
This will give you a compiled (but not installed) kernel matching your current system's settings (or those in /boot/config-2.6.10 at least).

Last edited by rjlee; 05-14-2005 at 03:42 PM.
 
Old 05-14-2005, 10:15 AM   #14
justintime32
Member
 
Registered: Sep 2004
Distribution: SimplyMepis 3.3 (Debian testing/unstable)
Posts: 123

Original Poster
Rep: Reputation: 15
Code:
make: *** No rule to make target `olddeps'.  Stop.
Would it work if I just typed in "make"?
 
Old 05-14-2005, 03:44 PM   #15
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Scull Device Driver (problems to compile) manuzinhac Linux - Hardware 0 05-19-2005 09:00 AM
How compile a new driver GregLille Linux - Networking 3 01-05-2005 05:42 AM
ivtv driver compile problems Pcghost Linux - Hardware 9 12-13-2004 10:39 AM
How to compile a driver Kuki Linux - Newbie 2 03-04-2004 04:21 PM
Problems trying to compile custom ATI binary driver guerilla fighta Linux - Software 0 02-13-2003 04:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 10:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration