What would be an easy way to create sources rpm package for the Linux kernel?

I would like to bundle the mainline linux kernel, create a sources rpm package, and build it using mock.

And for that, how can I easily create a kernel sources rpm? I know there must be a way.

Also, can mock build from a tar file instead?

Thanks falks :slight_smile:

There are many examples of this being done. SIG/Kernel in our project attempts to build and provide main line kernels as does ELRepo.

I encourage you to read the spec file and the accompanying source files to see how it all comes together. You will find there is a spec file plus configuration files that turn drivers or features on or off.

I also encourage you to read the packaging guide.

No. A tarball can be one of many sources for a source RPM package, but you cannot just “build” from a tarball. You would still need an accompanying spec file.