[CentOS] Building a new 2.6 kernel

Fri Jul 21 23:25:44 UTC 2006
Jim Perrin <jperrin at gmail.com>

On 7/21/06, Matt Hyclak <hyclak at math.ohiou.edu> wrote:
> On Fri, Jul 21, 2006 at 03:12:49PM -0700, John Warren enlightened us:
> > You also said something about keeping my own release numbers. I think the line
> > is:
> >
> > %define release 34.0.2.EL
> >
> > So I should change it to something like:
> >
> > %define release 34.0.2.EL.PRX.01
> >
>
> You can do that, yes. I think by default, it also appends some information
> like the user building the RPM to the name. You can check out the spec file
> for that.
>
> > PS: Build just finished and got these errors. I was in the following directory
> > when I started the build.
> >
> > /home/buildcentos/rpmbuild/BUILD/kernel-2.6.9/linux-2.6.9
> >
>
> And the first thing that the RPM does is remove that directory to start from
> scratch :-)
>
> > And used the command:
> >
> > rpmbuild --rebuild --target=i686
> > /home/buildcentos/rpmbuild/SRPMS/kernel-2.6.9-34.0.2.EL.src.rpm
> >
>
> If you're making changes to the spec file, you probably want
> rpmbuild -ba --target=i686 kernel.spec instead.

This works as well, assuming you copied your config back to the
original name. That's really the only catch unless you're applying
patches (next week's lesson :-P).


> Ahh, I bet your changes didn't make it in if you just make them in the
> BUILD/kernel... directory. The first thing rebuilding the src rpm does is
> wipe that directory out and unpack a fresh copy. You're best off making
> changes to the files in the SOURCES directory, and rebuilding from the .spec
> file. I think there's also a way to skip parts of the build process, so you
> could -bp to prep, make changes in BUILD, then skip the prep part of the
> build process so that it doesn't overwrite your changes. man rpmbuild for
> that.

You can, but if you start off with a -bp, then move to -bc and the
rest there's no way to tell rpm to finish the whole thing off and
actually make the packages. It'll build, and test, but it will not
produce an rpm. Initially I thought this was a bug/design flaw, then
after talking with jbj I released it was intentional to keep lazy
packagers from tweaking mid-build and other such lazy/bad habits.

This is why I wanted him to repackage everything back into his own
src.rpm and --rebuild from it. -ba works just as well though.




-- 
During times of universal deceit, telling the truth becomes a revolutionary act.
George Orwell