LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 11-10-2004, 11:37 AM   #1
sfwalter
LQ Newbie
 
Registered: Oct 2004
Posts: 12

Rep: Reputation: 0
Core 3 Kernel Sources


I just installed Fedora Core 3 and wanted to put my laptop to sleep, but I got an error message stating "No APM support in kernel". So I figure I would just rebuild the kernel.

However, when I went to the /usr/src directory I could not find the kernel sources. I even looked in /usr/local/src. The funny thing is I had Fedora install all packages and still no luck. Under /usr/src I see:

/usr/src/redhat/BUILD (no files)
/usr/src/redhat/RPMS (no files)
/usr/src/redhat/SOURCES (no files)
/usr/src/redhat/SPECS (no files)
/usr/src/redhat/SRPMS (no files)

Where in the heck is the kernel source code?
Do I need to get the Source RPM discs and install those?

cheers,

scott.
 
Old 11-10-2004, 12:18 PM   #2
flysideways
Member
 
Registered: Jul 2003
Posts: 151

Rep: Reputation: 30
From file:/usr/share/doc/HTML/index.html







Quote:
In order to eliminate the redundancy inherent in providing a separate package for the kernel source code when that source code already exists in the kernel's .src.rpm file, Fedora Core 3 no longer includes the kernel-source package. Users that require access to the kernel sources can find them in the kernel .src.rpm file. To create an exploded source tree from this file, perform the following steps (note that <version> refers to the version specification for your currently-running kernel):


Obtain the kernel-<version>.src.rpm file from one of the following sources:


The SRPMS directory on the appropriate "SRPMS" CD iso image


The FTP site where you got the kernel package


By running the following command:


up2date --get-source kernel


Install kernel-<version>.src.rpm (given the default RPM configuration, the files this package contains will be written to /usr/src/redhat/)
 
Old 11-10-2004, 09:53 PM   #3
adkenc
LQ Newbie
 
Registered: Oct 2004
Location: howdy from texas
Distribution: fedora core 2 (for now)
Posts: 12

Rep: Reputation: 0
when you run
up2date --get-source kernel

where does it download it to?
i ran "up2date --get-source kernel" and it looked like it downloaded it but then i typed
"Install kernel-2.6.9-1.667.src.rpm" and also just rpm -
and here is what i get

[root@linuxbox ]# Install kernel-2.6.9-1.667.src.rpm
bash: Install: command not found
[root@linuxbox ]# rpm -i kernel-2.6.9-1.667.src.rpm
error: open of kernel-2.6.9-1.667.src.rpm failed: No such file or directory

sorry if this is a silly question
 
Old 11-11-2004, 11:15 AM   #4
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
No it's not a silly question. I don't understand why it has to be this involved

After you did the up2date and downloaded it,
Code:
cd /var/spool/up2date
rpm -ihv kernel-2.6.9-1.667.src.rpm

cd /usr/src/redhat/SOURCES
cp linux-2.6.9.tar.bz2 /usr/src
cd /usr/src
tar xfj linux-2.6.9.tar.bz2
There are some kernel config files inside /usr/src/redhat/SOURCES
just copy the appropriate config file into the /usr/src/linux-2.6.9 folder and rename it to .config

Last edited by benjithegreat98; 11-14-2004 at 07:17 PM.
 
Old 11-14-2004, 11:58 PM   #5
adkenc
LQ Newbie
 
Registered: Oct 2004
Location: howdy from texas
Distribution: fedora core 2 (for now)
Posts: 12

Rep: Reputation: 0
THANKS! I (think) i'm set now...
I just wanted to write something in case anyone else reads this.
Quote:
----
There are some kernel config files inside /usr/src/redhat/SOURCES
just copy the appropriate config file into the /usr/src/linux-2.6.9 folder and rename it to .config
-----
I thought the commands given included this but i was wrong. so to anyone out there who didn't get it (i.e. me)
if you type
Code:
cd /usr/src/redhat/SOURCES
and then type ls to list your files you will see several files ending in .config for different architectures. i had no idea what architecture i had so i found on the web that in terminal you can type
Code:
uname -a
and listed in there you will see something like

Code:
Linux yourcomputername 2.6.9-1.667 #1 Tue Nov 2 14:41:25 EST 2004 i686 i686 i386 GNU/Linux
and so all those i686's meant the approprite file for me was kernel-2.6.9-i686.config . to copy you type
Code:
cp kernel-2.6.9-i686.config /usr/src/linux-2.6.9
and then rename it to .config i didn't find how to do in terminal so in the graphical browser i went to /usr/src/linux-2.6.9 and right clicked on the file and renamed it that way.

anyway hope that helps someone along the way.
 
Old 11-15-2004, 08:14 AM   #6
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
Looks like you're getting it all figured out. Just a tip: To rename a file on the command line type
mv kernel-2.6.9-i686.config .config

To rename a file you must use the same command you would to move a file. When you are putting the destination to move to you just put the new name of your file.
 
Old 11-28-2004, 12:19 PM   #7
julian_sun
LQ Newbie
 
Registered: Nov 2004
Posts: 2

Rep: Reputation: 0
I tired the "up2date --get-source kernel" method, and found it is not working correctly. My kernel was already updated. up2date gives an outdated kernel srpm. See below. Anybody knows how to correct this?

[root@gateway up2date]# uname -a
Linux gateway 2.6.9-1.681_FC3smp #1 SMP Thu Nov 18 15:19:10 EST 2004 i686 i686 i386 GNU/Linux

[root@gateway up2date]# up2date-nox --get-source kernel
http://fedora.redhat.com/download/up.../fedora-core-3
using mirror: http://redhat.secsup.org/fedora/core/3/i386/os
http://fedora.redhat.com/download/up...s-released-fc3
using mirror: http://ftp.ussg.iu.edu/linux/fedora/...pdates/3/i386/

Fetching all package list for channel: fedora-core-3...
########################################

Fetching all package list for channel: updates-released-fc3...
########################################

Fetching package list for channel: fedora-core-3...

Fetching http://redhat.secsup.org/fedora/core...header.info...
########################################

Fetching package list for channel: updates-released-fc3...

Fetching http://ftp.ussg.iu.edu/linux/fedora/...i386//headers/
header.info...
########################################

kernel-2.6.9-1.667.src.rpm...
########################################
 
Old 11-28-2004, 12:37 PM   #8
julian_sun
LQ Newbie
 
Registered: Nov 2004
Posts: 2

Rep: Reputation: 0
BTW, the right way to obtain a pristine kernel source that was used to build your kernel is the following:

[root@gateway jsun]# rpmbuild -v -v --target=i686 -bp /usr/src/redhat/SPECS/kernel-2.6.spec

Obviously, substitue --target part properly. You will have a kernel tree patched under /usr/src/redhat/BUILD/kernel-2.6.9.

Jun
 
Old 11-28-2004, 12:57 PM   #9
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
Just try the command again until you get the correct source. Whenever you use up2date it picks a random mirror. If the mirror is updated too late then you'll get the old source. If you try it a few more times you'll get the correct one eventually. If you wait a few hours your chance of getting the correct source increases.
 
Old 11-28-2004, 01:31 PM   #10
fairbanksak
LQ Newbie
 
Registered: Sep 2004
Location: Fairbanks AK
Distribution: Fedora Core 3
Posts: 11

Rep: Reputation: 0
Quote:
Originally posted by julian_sun
BTW, the right way to obtain a pristine kernel source that was used to build your kernel is the following:

[root@gateway jsun]# rpmbuild -v -v --target=i686 -bp /usr/src/redhat/SPECS/kernel-2.6.spec

Obviously, substitue --target part properly. You will have a kernel tree patched under /usr/src/redhat/BUILD/kernel-2.6.9.

Jun
Thanks julian
I was wondering what to do with all those patch files. that rpmbuild command is sweet.
now I have something to work with.
 
Old 12-02-2004, 04:21 PM   #11
crowmobe
LQ Newbie
 
Registered: Nov 2004
Location: Huntsville, AL
Distribution: Fedora Core 3
Posts: 13

Rep: Reputation: 0
I can't even get the sources correctly! WTF
I did a

# up2date --get-source kernel

and it downloaded. But when I try

# rpm -ihv kernel-2.6.9-1.681_FC3.src.rpm
kernel-2.6.9-1.681_FC3.src.rpm: not an rpm package (or package manifest):

The file is there, what is wrong?
 
Old 12-02-2004, 04:24 PM   #12
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
Sounds like corruption in the package.... Delete it and try again.
 
Old 12-02-2004, 04:51 PM   #13
crowmobe
LQ Newbie
 
Registered: Nov 2004
Location: Huntsville, AL
Distribution: Fedora Core 3
Posts: 13

Rep: Reputation: 0
Yeah, I did that a few times.
Thanks
 
Old 12-02-2004, 06:52 PM   #14
cozen
LQ Newbie
 
Registered: Dec 2004
Location: Kansas
Distribution: Fedora Core 3
Posts: 1

Rep: Reputation: 0
To get the kernel online I actually used the following command:

# wget http://limestone.uoregon.edu/ftp/fedora/updates/3/SRPMS/kernel-2.6.9-1.681_FC3.src.rpm

It then downloaded the code directly to the current dir. Then worked from there.

Last edited by cozen; 12-03-2004 at 11:52 AM.
 
Old 12-04-2004, 07:46 PM   #15
crowmobe
LQ Newbie
 
Registered: Nov 2004
Location: Huntsville, AL
Distribution: Fedora Core 3
Posts: 13

Rep: Reputation: 0
'Thanks! That worked for some reason, while the other way didn't.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Kernel Sources PC Junior Linux - Newbie 12 06-28-2005 05:07 PM
APT sources for Fedora Core 3. excidy Linux - Software 3 04-27-2005 02:03 PM
Kernel sources in Fedora Core 2 mbourne Fedora 8 10-04-2004 09:35 AM
CAVEAT: /boot/kernel.h & how not to clobber your kernel sources (Conectiva, Red Hat) JCCyC LinuxQuestions.org Member Success Stories 0 08-07-2003 07:49 AM

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

All times are GMT -5. The time now is 07:52 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration