Kernel
The Hyperscale SIG maintains a kernel in the experimental repository. This kernel is based on the CentOS Stream 9 kernel and tries to follow it as closely as possible, while enabling additional features such as btrfs and Kernel Live Patching. In turn, the CentOS Stream 9 kernel is based on the upstream RHEL 9 kernel sources, which is where the RHEL 9 kernel is developed and maintained.
The Hyperscale kernel is built for both CentOS Stream 8 and CentOS Stream 9 from the same sources (meaning, we effectively ship a backport of the CentOS Stream 9 kernel for CentOS Stream 8).
Contributing to the Hyperscale kernel¶
In general, the best way to contribute to the Hyperscale kernel build is to contribute to these upstream RHEL kernel sources. As a matter of policy, all of the patches we backport for the Hyperscale build of the kernel are first merged to redhat/centos-stream/src/kernel/centos-stream-9, which is the GitLab repo where the RHEL kernel is developed and maintained. This allows us to leverage the testing and maintenance by the RHEL kernel team and share efforts with the broader CentOS community that also contribute to the kernel.
We try to maintain as few patches as possible for each release, but we are open to including new features or bug fixes that are not yet available. We follow the practices documented by the RHEL kernel team.
Contributing to the RHEL 9 kernel sources¶
- Get a Fedora account if you don't have one already.
- Make sure to follow this part
and set up your
~/.fedora.upn
to tell our tooling your FAS username if it differs from your Unix name.
- Make sure to follow this part
and set up your
- Get a GitLab.com account if you don't have one already.
- Make sure your display name matches your actual name used in Git commits.
- Make sure the email address you use for Git commits is attached to your GitLab.com account.
- Set your GitLab.com account username in your Fedora account.
- Set your Red Hat Bugzilla account and make sure your Fedora account email address matches your Bugzilla account email address.
- Install
git-backport
into~/.local/bin
. - Fork redhat/centos-stream/src/kernel/centos-stream-9.
- In your local clone of your fork, add redhat/centos-stream/src/kernel/centos-stream-9 as a remote by the name
upstream
. - In your local clone of your fork, add torvalds/linux as a remote by the name
mainline
. - Run
git fetch --all
to fetch all the refs from all the remotes. - Create a new branch based on
upstream/main
for the patches to be applied:git checkout --no-track -b <branchname> upstream/main
- Generate a list of commits to backport and save it to a file to use with
git-backport
.- For example, for backporting zstd from v5.16, do:
git log --pretty=oneline v5.14..v5.16 lib/zstd | tac > git-backport-zstd-v5.16-patchset
- For example, for backporting zstd from v5.16, do:
- Create a bug for the RHEL kernel for your backport.
- Note: the link above might not select
kernel
as a component for you automatically. If it doesn't, just do so manually and select the correct subcomponent when the menu shows up. - As an example, here's the one done for the zstd backport from v5.16.
- Note: the link above might not select
- Use
git-backport
to generate the patch set to apply as commits:git-backport -a -b <RHBZ> -d $PWD/backport-stage-diffs/ -f <git-backport-file>
- Use
git am
to apply the patch set:git am $PWD/backport-stage-diffs/
- Push your branch to your fork on GitLab.com
- Open a merge request (MR) against redhat/centos-stream/src/kernel/centos-stream-9 with your change.
- In the MR description, add a
Signed-off-by
statement matching the ones in your commits. - Tag
@Conan_Kudo
and@dcavalca
to notify for reviews. - As an example, here's the MR done for the zstd backport from v5.16.
- In the MR description, add a
- Once merged and the RHEL kernel folks make a release, one of the Hyperscale kernel maintainers will update the RPM spec and publish a new version of the kernel for Hyperscale with the patches included.
Contributing to the RHEL 8 kernel sources¶
The same contribution process applies to the RHEL 8 kernel, with a few differences:
- you will want to fork redhat/centos-stream/src/kernel/centos-stream-8 and use it as your
upstream
- you will want to file a bug against the kernel component for RHEL 8
- to build the kernel locally, the easiest way is to use Packit
- run
packit srpm
to generate a source RPM - run
mock -r centos-stream-8-x86_64 /path/to/the/src.rpm
to build the kernel from the generated source RPM
- run
Note that changes contributed to the stock RHEL 8 kernel do not directly impact the Hyperscale kernel build, as that is based off the RHEL 9 kernel. They are however relevant for packages built in our main repository, as those are designed to run on a stock system.