[ATrpms-users] How to build rpm for kernel that isn't in repo
Craig Huff
huffcslists at gmail.com
Sun May 4 00:03:29 CEST 2008
On Sat, May 3, 2008 at 9:50 AM, Craig Huff <huffcslists at gmail.com> wrote:
>
> On Sat, May 3, 2008 at 8:15 AM, Chris Schanzle <schanzle at nist.gov> wrote:
> > >
> > > 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.
> > >
> >
> > Craig, to directly answer your question, rpmbuild should always install
> > things into a fake root environment, defined in the .spec file as a tag
> > "BuildRoot" (typically defined near the top to be ) and you should note in
> > the %install section, all writes should go to %{buildroot} or
> > $RPM_BUILD_ROOT (those are synonyms).
> >
> > To protect your system, all RPMS should be built as a non-root user (yes,
> > even kernels can be built this way, last I checked). Since the default is
> > /usr/src/redhat (writable by root only), you'll either need to change those
> > permissions or, my preference make your own ~/.rpmmacros that defines a new
> > build tree. Mine is below, note I use lowercase directories for easier
> > typing and a slightly restructured srcrpmdir location.
> >
> > packager: Chris Schanzle
> > %_topdir /home/schanzle/tmp
> > %_specdir %{_topdir}/specs
> > %_sourcedir %{_topdir}/sources
> > %_builddir /local/tmp/build
> > %_rpmdir %{_topdir}/rpms
> > %_srcrpmdir %{_rpmdir}/srpms
> >
> > # this is for redhat9
> > %define debug_package %{nil}
> > # below is for fedora core 1 & later
> > %debug_package %{nil}
> >
> > %_unpackaged_files_terminate_build 0
> >
> > # include arch in all queries
> > %_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}
> >
> >
>
> Thanks! I just got a little leery about putting my working RPM build
> system at risk, especially given the little time I find to work on
> this project (witness the thread start date of over a month ago).
>
> I had already found information on rpmdevtools and planned to use it
> to set up an ~/.rpmmacros (IIRC) file and an alternate build tree as a
> lowly user. It took a little doing to find one for use with CentOS
> 5.1 since it isn't in CentOS repositories nor in ATrpms el5 repos.
> Haven't installed the one I downloaded from Fedora's epel5 collection
> yet, but I am hardpressed to see why that would be inappropriate for
> my environment, especially since I expect it to be (at least the parts
> I plan to use ATM) scripts to operate on (create) files and
> directories.
>
> Craig.
>
I hate to leave all that quoted e-mail thread, but somehow think my
question won't make sense without it. How do I find out what the
option values are that I might include on the rpmbuild command line
using "--with" options? I have tried unpacking a kernel source rpm
and the gzipped tarballs inside it and searching around, but I don't
seem to be getting anywhere.
For example, I know some builders include "--with ntfs". I understand
that causes support for the ntfs file system to be included in the
resulting kernel, but I can't figure out how that translates into
something I see in the .config file, the .spec file, or one of the
Makefiles, much less how to identify other options.
Would someone please get me on track?
Thanks.
Craig.
More information about the atrpms-users
mailing list