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

Craig Huff huffcslists at gmail.com
Sat Mar 22 19:19:14 CET 2008


I am interested in building a patched CentOS 5.1 kernel with TuxOnIce
(formerly Suspend2) support and the associated kmdls I will need to
support MythTV.

This is partly to learn how it's done and partly rather than feeling
like I'm badgering repository managers to build something that doesn't
have many users.

However, I have not had to build anything from sources (thanks to
Axel's excellent repository), much less patch the source and build it,
so I am unclear of the process.

For the current CentOS 5.1 kernel,
(kernel-2.6.18-53.1.14.el5.i686.rpm, or perhaps
kernel-2.6.18-53.1.14.el5.centos.plus.i686.rpm) how would I proceed?
(How does Axel do this when he has the time and a pending request?)
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

 Or, do I need to do other things before I get to the rpmbuild command?
 Or, do I need to add other options to the command line to mimic the
options Matthias (and as a result, Axel) normally builds in, such as:
 --define '_with_ntfs 1'
 --define '_dsdt_initrd 1'
 and so on, in which case, which ones are normally specified on the
command line?

Does the Suspend2 source rpm need to be unpacked each time a new
CentOS kernel is unpacked (i.e. does the CentOS kernel source
overwrite files from the Suspend2 source that are needed)?

 Finally, what is the end result -- a ready to install rpm that could
be copied and used on any system to install the newer (and modified to
support Suspend2) kernel or something that then needs other processing
to produce an rpm?

 Any help would be greatly appreciated.

 TIA,

 Craig.



More information about the atrpms-users mailing list