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

**URL:** <https://forums.rockylinux.org/t/what-would-be-an-easy-way-to-create-sources-rpm-package-for-the-linux-kernel/14117>\
**Category:** Rocky Linux Help & Support\
**Created:** [May 16, 2024, 9:46pm UTC](https://forums.rockylinux.org/t/what-would-be-an-easy-way-to-create-sources-rpm-package-for-the-linux-kernel/14117 "2024-05-16T21:46:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![I\_am\_not\_sure](https://avatars.discourse-cdn.com/v4/letter/i/59ef9b/32.png) [@I\_am\_not\_sure](https://forums.rockylinux.org/u/I_am_not_sure)\
**Post date:** [May 16, 2024, 9:46pm UTC](https://forums.rockylinux.org/t/what-would-be-an-easy-way-to-create-sources-rpm-package-for-the-linux-kernel/14117/1 "2024-05-16T21:46:34Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![label](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@label](https://forums.rockylinux.org/u/label)\
**Post date:** [May 16, 2024, 9:53pm UTC](https://forums.rockylinux.org/t/what-would-be-an-easy-way-to-create-sources-rpm-package-for-the-linux-kernel/14117/2 "2024-05-16T21:53:44Z")

</div>

> [@I\_am\_not\_sure](#):
>
> And for that, how can I easily create a kernel sources rpm? I know there must be a way.

There are many examples of this being done. SIG/Kernel in our project attempts to build and provide main line kernels as does [ELRepo](https://elrepo.org).

- [SIG/Kernel mainline](https://git.rockylinux.org/sig/kernel/src/kernel-mainline/-/tree/r9) - maintained by @sherif @neil @pgreco
- [ELRepo kernels](https://github.com/elrepo/kernel)
- [Fedora Rawhide](https://src.fedoraproject.org/rpms/kernel/tree/rawhide)

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](https://rpm-packaging-guide.github.io/).

> [@I\_am\_not\_sure](#):
>
> Also, can mock build from a tar file instead?

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [July 15, 2024, 9:53pm UTC](https://forums.rockylinux.org/t/what-would-be-an-easy-way-to-create-sources-rpm-package-for-the-linux-kernel/14117/3 "2024-07-15T21:53:48Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
