[ATrpms-users] How to build rpm for kernel that isn't in repo?

xyon xyon at indigorobot.com
Sat May 3 05:40:48 CEST 2008


I just grab sources, patch accordingly, configure, save configuration
(also, I make a backup of the config to an alternate dir
(/usr/src/configs)), then do a 'make rpm'. Works like a champ for me,
creates the spec file automatically and so on. If there are problems, I
correct them one by one, but that works 90% of the time OOB.

You could also tar up the directory containing the kernel source and do
rpmbuild -ta on the resulting tar/gz (or bz2) archive. Once you get your
first kernel or two done, it's pretty easy to do further kernels.

I do all this on a build host that handles compiling of packages for
distribution across my infrastructure members, so the kernel is not
automatically installed, it is built and resides
in /usr/src/redhat/RPMS/i386/.

Please let me know if you run into problems and I should be able to help
out.


On Fri, 2008-05-02 at 19:07 -0500, Craig Huff wrote:
> On Sat, Mar 22, 2008 at 6:34 PM, Axel Thimm <Axel.Thimm at atrpms.net> wrote:
> >
> <snip>
> >
> >  > Is the correct sequence:
> >  >
> >  >  1) Download the appropriate source rpm from the CentOS repository and
> >  > unpack it with rpm -i <downloaded file name>
> >  >  2) Download the closest Suspend2 source rpm from Matthias Hensler's
> >  > repository and unpack it with rpm -i <downloaded file name>
> >  >  3) Make a copy of the Suspend2 spec file installed by step 2 in
> >  > /usr/src/redhat/SPECS renamed to match the kernel version I want to
> >  >  build
> >  >  4) Review and modify as required the new spec file
> >  >  5) Build the new kernel with "rpmbuild -ba --target=i686 <new kernel
> >  > version spec file name>"
> >  >  6) Return to step 4 if there are errors until the build produces no
> >  > error messages
> >
> <snip>
> >
> >  --
> >  Axel.Thimm at ATrpms.net
> >
> 
> Axel,
> 
> Clearly, since it has been over a month since the last post on this
> thread, I don't have a lot of time on my hands this spring ;-(
> 
> I finally had a chance to look more closely at this and was reading
> the man-page (or is it an info-page?) for rpmbuild.  It raised a
> question when it discussed the %install section of the .spec file
> which I was hoping you could clarify.  I want to build from sources
> and create the .rpm and .src.rpm of a kernel that has additional
> patches applied, but I **do not** want to install the kernel on the
> system I am building the .rpm and .src.rpm on.  I get the impression
> that rpmbuild **will** install the kernel on this system.  Is that
> correct?  If so, is there a way (command-line option I overlooked?)
> which will tell rpmbuild to build but not install, or am I
> misunderstanding the function of the %install section in the first
> place?
> 
> Thanks again for your patience and help.
> 
> Craig.
> 
> _______________________________________________
> atrpms-users mailing list
> atrpms-users at atrpms.net
> http://lists.atrpms.net/mailman/listinfo/atrpms-users




More information about the atrpms-users mailing list