Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Notes on building RPMs with an example patching and rebuilding the kernel srpm from SL30x. The SL30x update rpms are available in: ftp://ftp.scientificlinux.org/linux/scientific/30x/SRPMS/vendor/updates/ |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Notes on building RPMs with an example patching and rebuilding the kernel srpm from SL30x. The SL30x update rpms are available in: ftp://ftp.scientificlinux.org/linux/scientific/30x/SRPMS/vendor/updates/ |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Added: | ||||||||
> > | When rebuilding the kernel, don't forget to build the bcm rpm! | |||||||
Install the source rpm, this unpacks the srpm and puts the source code in SOURCE and the spec file in SPECS dir: |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Line: 13 to 13 | ||||||||
The kernel has many patches, and sometimes these may confict; your patch may apply fine to a vanilla kernel, but not to the patched version in the rpm. The order that patches are applied is defined in the spec file. In general, you should add new patches after the existing ones. So, we'll want to apply the existing patches before testing our patch. | ||||||||
Changed: | ||||||||
< < | # rpmbuild -bp SPECS/kernel | |||||||
> > | # rpmbuild -bp SPECS/kernel-2.4.spec | |||||||
You should no be able to find a copy of the file(s) that you wish to patch in BUILD/kernel-2.4.21, you can diff them with the files in the SOURCE tree to see if they have been touched by patches: | ||||||||
Line: 27 to 27 | ||||||||
# diff linux-2.4.21/drivers/usb/hid-core.c ../BUILD/kernel-2.4.21/linux-2.4.21/drivers/usb/hid-core.c | ||||||||
Changed: | ||||||||
< < | differences... | |||||||
> > | {differences...} | |||||||
Changed: | ||||||||
< < | # cp ../BUILD/kernel-2.4.21/linux-2.4.21/drivers/usb/hid-core.c . | |||||||
> > |
# mkdir -p a/drivers/usb
# mkdir -p b/drivers/usb
# cp ../BUILD/kernel-2.4.21/linux-2.4.21/drivers/usb/hid-core.c a/drivers/usb
# cp ../BUILD/kernel-2.4.21/linux-2.4.21/drivers/usb/hid-core.c b/drivers/usb
{edit the b version and get it how it should be...}
# diff -Nur a b > apcupsd.patch
{examine the patch to verify it...}
# cp apcupsd.patch ../SOURCES/
Place the .patch file in the SOURCES dir. Edit the spec file to include the patch. Alter/increment the release variable. Since this is a patch to a driver, will put it in the range 5000 to 7000. You need a statement listing the patch file as something to include in the rpm and a second statement that says to apply it.
%define release 37.EL.%{distribution} Patch6901: apcupsd.patch # fix for usb interface to APC UPS %patch6901 -p1 | |||||||
Added: | ||||||||
> > |
After you have put the patch in place and editted the spec file, build a new srpm and then install it. Then build the binary rpms.
# rpmbuild -bs SPECS/kernel-2.4.spec Wrote: /work/cap/software/rpm/SRPMS/kernel-2.4.21-37.EL.MSUHEP.src.rpm # rpm -i SRPMS/kernel-2.4.21-37.EL.MSUHEP.src.rpm # rpmbuild -bb SPECS/kernel-2.4.spec Wrote: ...RPMS/i386/kernel-source-2.4.21-37.EL.MSUHEP.i386.rpm Wrote: ...RPMS/i386/kernel-doc-2.4.21-37.EL.MSUHEP.i386.rpm Wrote: ...RPMS/i386/kernel-BOOT-2.4.21-37.EL.MSUHEP.i386.rpm Wrote: ...RPMS/i386/kernel-debuginfo-2.4.21-37.EL.MSUHEP.i38 {or...} # rpmbuild -bb --target athlon SPECS/kernel-2.4.spec Wrote: ...RPMS/athlon/kernel-2.4.21-37.EL.MSUHEP.athlon.rpm Wrote: ...RPMS/athlon/kernel-unsupported-2.4.21-37.EL.MSUHEP.athlon.rpm Wrote: ...RPMS/athlon/kernel-smp-unsupported-2.4.21-37.EL.MSUHEP.athlon.rpm Wrote: ...RPMS/athlon/kernel-smp-2.4.21-37.EL.MSUHEP.athlon.rpm Wrote: ...RPMS/athlon/kernel-debuginfo-2.4.21-37.EL.MSUHEP.athlon.rpm # rm -rf BUILD/* # rm -rf tmp/*There is also a switch --without smp you can to build just uniproc kernels. | |||||||
-- TomRockwell - 15 Nov 2005
|