LinuxQuestions.org
Review your favorite Linux distribution.
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 02-20-2004, 04:48 PM   #1
weeds84
LQ Newbie
 
Registered: Feb 2004
Location: Wooster, OH
Distribution: SUSE 9.2 FTP
Posts: 19

Rep: Reputation: 0
NVIDIA installer cant find kernel sources


i did this:

apt-get install kernel-source-2.4.24

and i searched my root directory and found that the sources were supposedly in /usr/share/doc/kernel-source-2.4.24 but when i run the NVIDIA installer, specifying that as the location of the sources it tells me something like:

"/usr/share/doc/kernel-source-2.4.24/include/linux/kernel.h does not exist."

the closest thing i have to kernel.h anywhere is kernel.ph in /usr/lib/perl/5.8.2/linux

what do i need to do yet that will get me to the point where i can continue my driver install?
 
Old 02-20-2004, 05:44 PM   #2
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
The source code for the Linux kernel. People usually install it in /usr/src/linux. If it's there the fix may be to make a symbolic link from /lib/modules/`uname -r` pointing at the kernel sources.
Code:
cd /lib/modules/`uname -r`
ln -sf /usr/src/linux build
If your sources are in a folder called something other than linux, like, for example linux-2.4.24 the put that in instead of the word linux there.
 
Old 02-20-2004, 05:57 PM   #3
weeds84
LQ Newbie
 
Registered: Feb 2004
Location: Wooster, OH
Distribution: SUSE 9.2 FTP
Posts: 19

Original Poster
Rep: Reputation: 0
yeah i have /usr/src/kernel-source-2.4.24.tar.bz2

what do i do with that? i just need to have the source files there and the nvidia installer will do the rest.
 
Old 02-20-2004, 06:42 PM   #4
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
You need to uncompress it
Code:
cd /usr/src
tar xjf kernel-source-2.4.24.tar.bz2
 
Old 02-20-2004, 08:42 PM   #5
weeds84
LQ Newbie
 
Registered: Feb 2004
Location: Wooster, OH
Distribution: SUSE 9.2 FTP
Posts: 19

Original Poster
Rep: Reputation: 0
NVIDIA driver install + gcc problems

alright so i uncompressed the source files then ran:

sh NVIDIA-Linux-x86-1.0-5336-pkg1.run --kernel-source-path /usr/src/kernel-source-2.4.24

the installer began and i told it to compile its own modules from my sources but then i got this error:

-------------------------------
gcc-version-check failed:
Could not compile gcc-version-check.c

If you know what you are doing and want to ignore the gcc version check, select "No" to continue installation. Otherwise, select "Yes" to abort installation, set the CC evironment variable to the name of the compiler used to compile your kernel, and restart the installation. Abort now?
--------------------------------

being the adventurous/reckless kinda guy that i am, i chose "No" despite not really knowing what i'm doing, and then it gave me this error:

--------------------------------
ERROR: unable to determine the NVIDIA kernel module filename.



h: line 1: make: command not found
--------------------------------

so i did an apt-get update, apt-get -u upgrade on my system then tried again and got the same behavior. at least i'm learning. what are my problems here? i suspect more than one.
 
Old 02-21-2004, 04:42 AM   #6
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
Well the first one is that the Nvidia module needs to be compiled with the same C compiler as the kernel. Most people use the gnu C compiler. The current version is gcc-3.3.2. It offers better processor specific optimisations which can make programs run faster but can also make them more unstable. The kernel needs to be stable so it is recommended that you build your kernel with gcc2.95. I, for instance, have to do
Code:
export CC=/opt/gcc-2.95.3/bin/gcc
sh NVIDIA-Linux-x86-1.0-5336-pkg1.run
to compile the Nvidia driver as this overrides the default C compiler in my path (gcc-3.3.2) and tells it to use the one in /opt. Actually I don't use those commands. I got fed up of typing all those letters in and renamed it nvidia. So, fix your first problem by installing gcc-2.95. You may find it on your Linux CD's or be able to use apt-get - Is that what those commands are about? I'm not familiar with Debian. When I used to use Mandrake I'd install stuff off the CD's with the Mandrake Control Centre. If I did download an .rpm I'd just click on it to install it. I've still got stuff to learn.
So that's your first problem - get gcc-2.95 and if you've already got it, tell the Nvidia installer to use it.
Can I suggest that you rename /usr/src/kernel-source-2.4.24 /usr/src/linux?
Code:
mv /usr/src/kernel-source-2.4.24 /usr/src/linux
That's just for my convenience In thinking about what commands to tell you. You do what you want. That --kernel-source-path /usr/src/kernel-source-2.4.24 was good work.
The second problem is, I think, because the kernel sources are in their raw state. You need to configure them the same as your current kernel and build the kernel. There should (hopefully) be a copy of your kernel config in /boot
It should be a plain text file called something like config-2.4.24 and if you read it you'll see stuff like this
Code:
#
# Automatically generated make config: don't edit
#
CONFIG_X86=y
CONFIG_MMU=y
CONFIG_UID16=y
CONFIG_GENERIC_ISA_DMA=y

#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
CONFIG_CLEAN_COMPILE=y
and so on. Prepare your kernel sources{code]cd /usr/src/linux
make mrproper[/code]Copy the configuration into your kernel sources
Code:
cp /boot/config-2.4.24 /usr/src/linux/.config
and then compile them
Code:
make CC=/opt/gcc-2.95.3/bin/gcc dep
make CC=/opt/gcc-2.95.3/bin/gcc bzImage
make CC=/opt/gcc-2.95.3/bin/gcc modules
I'll stop there as you don't need to install the kernel but you're close. If you ran the command
Code:
make CC=/opt/gcc-2.95.3/bin/gcc modules_install
It would make the symbolic link that will allow the Nvidia installer to find the kernel sources but it may break something else so it's probably safer to make the link by hand.[cd /lib/modules/2.4.24
ln -sf /usr/src/linux build[/code]Then have another go at the Nvidia installer
Code:
export CC=/opt/gcc-2.95.3/bin/gcc
sh NVIDIA-Linux-x86-1.0-5336-pkg1.run
Good luck.
 
Old 02-22-2004, 10:13 PM   #7
redcane
Member
 
Registered: Aug 2003
Posts: 31

Rep: Reputation: 15
Re: NVIDIA driver install + gcc problems

Quote:
Originally posted by weeds84

-------------------------------
gcc-version-check failed:
Could not compile gcc-version-check.c

Had exactly the same problem. I 'recklessly' selected NO and it told me cannot determine module name. Basically you don't have the developement libraries installed. Particularly the standard C library developement headers. I don't recall excatly the name of the package, but in synaptic it's in "libraries (development)'. Install that, and it'll automagically work (well it did for me).
 
  


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
Ndiswrapper - Cant find kernel sources while installing (Kernel 2.6.11) krayhze Linux - Wireless Networking 6 05-23-2006 06:30 AM
can't find kernel sources Avatar Debian 3 09-12-2005 12:36 PM
kernel nvidia sources chil326 Mandriva 7 08-30-2005 12:57 PM
Where would I find my kernel sources? irvken Linux - General 4 03-28-2004 02:11 PM
Where to find correct Kernel Sources?? jawaking00 Mandriva 2 03-07-2004 12:13 PM

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

All times are GMT -5. The time now is 10:45 AM.

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