View Full Version : Fedora Core 3 Installing Kernel Source from RPM
sdrinkwater
10th December 2004, 03:36 PM
Hello.
I have a AMD 64 Box running Fedora Core 3. I am trying to unpack the kernel source from RPM. The rpm file I am using is kernel-2.6.9-1.667.src.rpm I have tried the CDROM version and the download file from the main fedora site.
First I will do a rpm -qa | grep kernel and I get
[root@csqrouter sdrinkwater]# rpm -qa | grep kernel
kernel-utils-2.4-13.1.39
kernel-2.6.9-1.667
step 2. Install src rpm
[root@csqrouter sdrinkwater]# rpm -i -h kernel-2.6.9-1.667.src.rpm
########################################### [100%]
[root@csqrouter sdrinkwater]#
step 3. check to see if RPM was installed
[root@csqrouter sdrinkwater]# rpm -qa | grep kernel
kernel-utils-2.4-13.1.39
kernel-2.6.9-1.667
nope no install. Am I doing something wrong??? I checked the /usr/src/redhat
no source...
Any Ideas would be great!!!!
Shane
:confused:
cybrjackle
10th December 2004, 04:52 PM
kernel
*
In the past, the process of updating the kernel did not change the default kernel in the system's boot loader configuration.
Fedora Core 3 changes this behavior to set newly-installed kernels as the default. This behavior applies to all installation methods (including rpm -i).
This behavior is controlled by two lines in the /etc/sysconfig/kernel file:
o
UPGRADEDEFAULT — Controls whether new kernels will be booted by default (default value: yes)
o
DEFAULTKERNEL — kernel RPMs whose names match this value will be booted by default (default value: depends on hardware configuration)
*
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):
1.
Obtain the kernel-<version>.src.rpm file from one of the following sources:
o
The SRPMS directory on the appropriate "SRPMS" CD iso image
o
The FTP site where you got the kernel package
o
By running the following command:
up2date --get-source kernel
2.
Install kernel-<version>.src.rpm (given the default RPM configuration, the files this package contains will be written to /usr/src/redhat/)
3.
Change directory to /usr/src/redhat/SPECS/, and issue the following command:
rpmbuild -bp --target=<arch> kernel.spec
(Where <arch> is the desired target architecture.)
On a default RPM configuration, the kernel tree will be located in /usr/src/redhat/BUILD/.
4.
In resulting tree, the configurations for the specific kernels shipped in Fedora Core 3 are in the /configs/ directory. For example, the i686 SMP configuration file is named /configs/kernel-<version>-i686-smp.config. Issue the following command to place the desired configuration file in the proper place for building:
cp <desired-file> ./.config
5.
Issue the following command:
make oldconfig
You can then proceed as usual.
http://fedora.redhat.com/docs/release-notes/fc3/x86_64/
Now to be honest, i"ve never seen up2date --get-source kernel work for the kernel, everything else it works but for some reason none of my box's work doing that, regardless you already have the .src.rpm and you have installed it. You can follow the rest thought.
cd /usr/src/redhat/SPECS
rpmbuild -bp kernel.spec
-bp Executes the "%prep" stage from the spec file. Normally this
involves unpacking the sources and applying any patches.
You can read "man rpmbuild" for more options.
-ba will build the binary and source package, ie. that is what people use after they create a spec file and build all the rpm/srpm(s) that are built in prereq's of the rpm.
cybrjackle
10th December 2004, 04:55 PM
FYI....
Oh, another thing they don't tell you is that:
up2date --get-source <package>
Drops the srpm in:
/var/spool/up2date/
from there you will need to do:
rpm -i <package>.src.rpm
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.