LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Core 3 Kernel Sources (https://www.linuxquestions.org/questions/fedora-35/core-3-kernel-sources-253261/)

sfwalter 11-10-2004 11:37 AM

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.

flysideways 11-10-2004 12:18 PM

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/)

adkenc 11-10-2004 09:53 PM

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

benjithegreat98 11-11-2004 11:15 AM

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

adkenc 11-14-2004 11:58 PM

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.

benjithegreat98 11-15-2004 08:14 AM

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.

julian_sun 11-28-2004 12:19 PM

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...
########################################

julian_sun 11-28-2004 12:37 PM

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

benjithegreat98 11-28-2004 12:57 PM

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.

fairbanksak 11-28-2004 01:31 PM

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.

crowmobe 12-02-2004 04:21 PM

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?

benjithegreat98 12-02-2004 04:24 PM

Sounds like corruption in the package.... Delete it and try again.

crowmobe 12-02-2004 04:51 PM

Yeah, I did that a few times.
Thanks

cozen 12-02-2004 06:52 PM

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.

crowmobe 12-04-2004 07:46 PM

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


All times are GMT -5. The time now is 09:43 PM.