On Fri, 8 Feb 2002, Shachar Shemesh wrote: > First - this is the first time I am trying to compilea RH kernel. I'll > just give you a quick overview of my findings, I am sorry if this is > nothing new to some (all?) of you. > > RH has two kernel sources. One is the "kernel-source-2.2.500.rpm" > (substitue version for whatever is applicable), which installs the > kernel source into /usr/src/linux-2.2.500, and sets a symlink to it from > /usr/src/linux. This RPM is dependant on "kernel-headers-2.2.500.rpm". > > The second is the "kernel-2.2.500.src.rpm", which comes from the SRPMS > directory. This one installs to /usr/src/redhat/SOURCES.
Actually I'm generally in the opinion that RPMs are not to be built as root (In case the %install script is slightly broken, etc.), but never mind. > > The SRPM is an archive of the vanilla kernel, and a whole bunch of > patches that RH applied to this kernel. This is a HUGE pile, and I have > not found any script to automatically apply them. With this large a pile > of patches, I find it highly unlikely that any apply order will do, and > so it can be regarded as impossible to generate the kernel sources from > this list (but it a useful way of knowing which patches RH applied to > their kernel). The script for applying those patches is geenrally the %prep part of the spec file (/usr/src/redhat/SPECS/kernel.spec , or something similar) This script uses a macro %patch that is basically the patch command To get a kernel source tree (with all of those patches applied) under /usr/src/redhat/BUILD/kernel-<something> , run: rpm -bp /usr/src/redhat/SPECS/kernel.spec > > The kernel-source RPM is the kernel source tree, already extracted, with > all patches already applied. Why bother with the SRPM then, you ask? The > answer is the .config file. I have only found them on the SRPM tree. Is it the case? Strange. (This is not so in the Mandrake source packages, but I have just browsed the files list of som redhat kernel rpms, and I can't find the config file either in the -source, -doc or the image RPM itself) > If > you want to compile a kernle that is identicalto the one arriving with > the kernel-image RPM, you will need them, and I have not been able to > find them in the kernel-source RPM. An rpm is generally a cpio archive, with some additions. To strip those additions, run: rpm2cpio package.rpm | cpio <cpio options> Of course I figure most people here don't use cpio on a daily basis (hint: if you do use, don't forget the option '-d' when extracting). An easier way to extract files from an rpm package is by using mc (midnight commander). HTH -- Tzafrir Cohen mailto:[EMAIL PROTECTED] http://www.technion.ac.il/~tzafrir ---------------------------------------------------------------------------- To unsubscribe, send a message to [EMAIL PROTECTED] Archives available at http://www.mail-archive.com/[email protected]/
