I’m having trouble figuring out how to build the binary kernel rpm packages with recent kernel releases.
This older post is a pretty good summary of the process I’ve been using to build some patched kernel rpm packages: How to rebuild kernel RPM from SRPM with custom patches
Here are the steps I’ve used for the past few years on previous kernel versins:
Extract the Source rpm:
Add “%_topdir /tmp/rpmbuild” into ~/.rpmmacros
rpm -ivh kernel-source…rpm # extracted to /tmp/rpmbuild
cd /tmp/rpmbuild/SOURCES
cd /tmp/rpmbuild and add any patches to ./SOURCES/kernel-sources.spec.in
Update ./SOURCES/series.conf with the patches to apply.
Update the Vendor field in the spec.in file.
Call SOURCES/mkspec toi generate uptdated spec files:
./mkspec --release <kernel_version>.Patched
cp kernel-default.spec kernel-source.spec kernel-debug.spec …/SPECS
And finally build the RPM packages:
rpmbuild -ba ./SPECS/kernel-default.spec
rpmbuild -ba ./SPECS/kernel-source.spec
rpmbuild -ba ./SPECS/kernel-debug.spec
This results in kernel-default, kernel-default-devel, kernel-default-extra, kernel-default-livepatch, kernel-devel, kernel-source, … etc rpm packages.
I have to do this for SLES12 SP5, SLES15 SP4, and SLES15 SP7 and in all three of them in the recent kernel source packages, 4.12.14-122.296.1, 5.14.21-150400.24.197.1, 6.4.0-150700.53.34.1, are changed such that:
- kernel-source.spec.in, kernel-debug.spec.in are no longer included in the SOURCES dir.
- there’s now only one 200k line SPECS/kernel-source.spec
- the mkspec tool is gone.
I can edit this new spec file directly to add patches, I believe, but running rpmbuild with it only builds kernel-devel, kernel-macros, kernel-source, kernel-source-vanilla. NO binary packages.
Does anyone know what needs to be done differently now to get a complete set of kernel rpm packages? I’m more of script writing monkey than a kernel dev so this process is totally foreign to me. Thanks for any advice!