LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 02-23-2004, 09:40 PM   #1
daniel31
LQ Newbie
 
Registered: Feb 2004
Distribution: RedHat 9
Posts: 2

Rep: Reputation: 0
can't find /usr/src/linux/2.4.20-30.9


Im trying to mount my fuji finepix A303 Running Redhat 9.2 With kernel
2.4.20-30.9 I googled and found a How-To . But I can't find kernel source
directory /usr/src/linux get bash: cd: /usr/src/linux No such file or directory
Help please
daniel31
 
Old 02-24-2004, 12:20 AM   #2
jarib
Member
 
Registered: Jun 2003
Location: British Columbia
Distribution: Slackware
Posts: 112

Rep: Reputation: 15
Maybe you don't have the kernel source installed. What do you have in /usr/src?
 
Old 02-24-2004, 09:21 AM   #3
misc
Senior Member
 
Registered: Apr 2003
Distribution: Red Hat + Fedora
Posts: 1,084

Rep: Reputation: 54
up2date kernel-source

then link /usr/src/linux to /usr/src/linux-2.4 which is a link to the top of the source tree. Only old kernel module add-ons look for /usr/src/linux. They should look for /lib/modules/$(uname -r)/build instead.
 
Old 02-24-2004, 11:46 PM   #4
globeTrotter
Member
 
Registered: Feb 2004
Location: Townsville, Queensland, Oz
Distribution: Red Hat 9
Posts: 107

Rep: Reputation: 15
download the files as follows.

Hi


You can get them off the 3rd disk or download them. i've written a little how-to below which may be of assistance.

First you have to find your kernel version so as we can match up the right source code files (as you ahve already done). So type in:
$ uname -r <enter>

This should print on the screen the kernel version number. My system returned
kernel-2.4.20-6

Write this number down somewhere. Next you have to determine if you have the source files installed. Type in:
$ rpm -qa | fgrep kernel <enter>

This should give you amongst other things the following 2 lines:
kernel-source-2.4.20-6
kernel-2.4.20-6

Obviously the numbers should match your kernel, as in the previous section. Beware that some Red Hat 9 distributions come with the ‘kernel-2.4.20-8’. If the "kernel-source-2.4.20-6" is there it means that you don’t need the kernel source package as it’s already installed.

If the kernel-source-2.4.20-6 line isn’t there, it means you’re going to have to download, unpack and install it. You will need the following rpm:
"kernel-source-2.4.20-6.i386.rpm" (again ajust numbers to suit your version)

Which you might find on the 3rd cd if you have it, otherwise you can download it from
http://rpm.pbone.net/index.php3/sta...6.i386.rpm.html

This will probably take a while as its 35mb big. If you have access to a broadband connected computer from a friend or work, use it, otherwise it takes about 3 hours to download over a winModem. I didn’t have access to broadband so had to take the long road. The thing is, this file is crucial. Obviously change the 2.4.20-6 numbers if yours differ. Once downloaded this should give you a file called.
kernel-source-2.4.20-6.i386.rpm

Place this rpm into a new directory/folder in your home directory, then enter the directory and run the following command from the command line, as root:
# rpm –ivh kernel-source-2.4.20-6.i386.rpm <enter>

This may take a while before the command prompt is returned to you depending on your system. Basically it is creating two directories called linux-2.4.20-6 and linux-2.4 in your /usr/src directory. linux-2.4 is a symbolic link to linux-2.4.20-6. Don’t concern yourself with this fact just yet.
Once the command line is returned to you, type in
# cd /usr/src <enter>
# ls <enter>

Several directories should be printed back to the screen. The ones we are concerned with are.
linux-2.4.20-6
linux-2.4

You now need to make a symbolic link to a directory called "linux". Some older software packages need this apparently. To make this link, simply type in :
# ln -s linux-2.4.20-6 linux <enter>
Now type in:
# ls <enter>

You should now see the following files in the list
linux-2.4.20-6
linux-2.4
linux

Don’t be concerned if they appear as different colours, this just means they are links. What is relevant is that the files are there.

You should now have the appropriate kernel source files to re-build your driver.

if you update your kernel down the track, also update the source file.
regards
GT
 
Old 02-26-2004, 07:17 PM   #5
daniel31
LQ Newbie
 
Registered: Feb 2004
Distribution: RedHat 9
Posts: 2

Original Poster
Rep: Reputation: 0
Question

Thanks all for the help, But I am still having problems. My kernel is
2.4.20-30.9.i586 and i can't locate a kernel-source-2.4.2030.9.i586.rpm would it be named something else

Daniel31

dist. redhat 9.2

Last edited by daniel31; 02-26-2004 at 07:31 PM.
 
Old 02-26-2004, 07:28 PM   #6
jarib
Member
 
Registered: Jun 2003
Location: British Columbia
Distribution: Slackware
Posts: 112

Rep: Reputation: 15
It should be called linux-2.4.20 And unless RH puts it in a different spot which I dont think it does you should find it in /usr/src If it's not there you can always dl the kernel and unpack it to /usr/src.

http://kernel.org/

edit: or it might be on one of the install cds

Last edited by jarib; 02-26-2004 at 07:31 PM.
 
Old 02-29-2004, 02:50 AM   #7
globeTrotter
Member
 
Registered: Feb 2004
Location: Townsville, Queensland, Oz
Distribution: Red Hat 9
Posts: 107

Rep: Reputation: 15
scroll down the URL page below for the i386 source file. i've done some digging, but can't find a i586 source file, although i reckon it should work. i used the i386 source file on a i686 system without any dramas.

https://rhn.redhat.com/errata/RHSA-2004-065.html

regards
GT
 
Old 03-01-2004, 05:08 PM   #8
JohnLinx
LQ Newbie
 
Registered: Jan 2004
Posts: 27

Rep: Reputation: 15
Redhat only has the source for i386. I have also used this source on an i686, with no ill effects.

Regards,
John
 
Old 03-02-2004, 02:18 PM   #9
markkreuzz
Member
 
Registered: Feb 2004
Location: Asia
Distribution: rh09, Gentoo,slackware.., still serving BSD
Posts: 35

Rep: Reputation: 15
hello,

i have done compiling and installing my kernel almost a week ago using the 2.4.20-30.9 ive got from redhat mirrors.. here --->(http://www.redhat.com/download/mirror.html), just click the
"updates links", and try to go to red-hat/updates/OS/en/9/srcrpms (or something) and find "(your)kernel-source(newest version)"
after you have got that, run a command prompt/terminal and type
"rpm -Uvh (yourkerne)l.rpm",, all seems well...

but wait!!!you have an error.. like "err:: usr/src/redhat/SOURCE not found" !!!!
well check first if you have a "redhat" folder inside /usr/src/ . if you do'nt have one, make folder/directory named redhat inside /usr/src/. if still not working, try to make SOURCES(case sensitive) directory inside redhat folder... if it doesn't work. try to have "kernel-develepment-tools" installed by using the "add/remove" from the panel. and then try
"rpm -Uvh (yourkerne)l.rpm" again.

if it is successful, try going to /usr/src/redhat/SOURCES/
try to find "linux-4.20-30.9.tar.gz" and gzunzip it.... after that cd into the linux\linux-2.4.20-30.9\, if you see files like "makefiles" and alotta folders (arch,configs), this is were you build the kernel....

well i hope this works, works for me though... gudluck!!!
 
  


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
can't find usr/src/linux folder r00k2oo4 SUSE / openSUSE 2 10-19-2004 01:35 PM
I can't find my usr/src/linux folder r00k2oo4 Linux - Newbie 4 10-19-2004 09:42 AM
where is /usr/src/linux matt_w_lambert Mandriva 5 12-26-2003 12:29 AM
I don't have /usr/src/linux ?!?!? Nikon01 Slackware 9 08-08-2003 12:23 AM
Creating /usr/src/linux-<xx> from kernel.<xx>.src.rpm jmourik Linux - Newbie 2 02-19-2003 03:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 07:09 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