From 5e9bb903c574ae015ef05e72c92cd8e697acb4db Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Aug 02 2024 15:50:18 +0000 Subject: [PATCH 1/2] docs/contributing: Add documentation for contributing to the RHEL kernel This is useful for being able to enable capabilities in the base platform for Hyperscale content designed to also work with stock systems. --- diff --git a/docs/contributing/kernel-rhel.md b/docs/contributing/kernel-rhel.md new file mode 100644 index 0000000..dd212a3 --- /dev/null +++ b/docs/contributing/kernel-rhel.md @@ -0,0 +1,49 @@ +# Contributing to the CentOS Stream / Red Hat Enterprise Linux kernel + +It may be necessary to contribute to the upstream RHEL kernel sources as part of enabling capabilities in CentOS Stream for Hyperscale usage. For situations like this, this guide documents how to contribute to the RHEL kernel. +A benefit in doing so is that 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. + +The kernel for CentOS Stream/RHEL 9 is hosted at [redhat/centos-stream/src/kernel/centos-stream-9](https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9), which is the GitLab repo where the RHEL kernel is developed and maintained. + +This guide follows the practices [documented by the RHEL kernel team](https://redhat.gitlab.io/centos-stream/src/kernel/documentation/). + +# Contributing to the RHEL 9 kernel sources + +* Get a Fedora account if you don't have one already. + * Make sure to follow [this part](https://docs.fedoraproject.org/en-US/package-maintainers/Joining_the_Package_Maintainers/#install_the_developer_client_tools) + and set up your `~/.fedora.upn` to tell our tooling your FAS username if it differs from your Unix name. +* 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`](https://gitlab.com/redhat/centos-stream/src/kernel/tools/-/raw/main/git-backport) into `~/.local/bin`. +* Fork [redhat/centos-stream/src/kernel/centos-stream-9](https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9). +* In your local clone of your fork, add [redhat/centos-stream/src/kernel/centos-stream-9](https://gitlab.com/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](https://github.com/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 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` +* [Create a bug for the RHEL kernel for your backport](https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%209&version=CentOS%20Stream&component=kernel). + * 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](http://bugzilla.redhat.com/2034834). +* Use `git-backport` to generate the patch set to apply as commits: `git-backport -a -b -d $PWD/backport-stage-diffs/ -f ` +* 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](https://gitlab.com/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](https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/292). + +# 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](https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-8) and use it as your `upstream` +* you will want to [file a bug](https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%208&version=CentOS%20Stream&component=kernel) against the kernel component for RHEL 8 +* to build the kernel locally, the easiest way is to use [Packit](https://packit.dev) + * 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 + +Note that changes contributed to the stock RHEL kernel do not directly impact Hyperscale images, as they use our own kernel. They are however relevant for packages built in our [main repository](/hyperscale/repositories/main), as those are designed to run on a stock system. diff --git a/mkdocs.yml b/mkdocs.yml index e70b89b..3e578cd 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -21,7 +21,9 @@ nav: - ELN Extras: content/eln_extras.md - Contributing: - Packaging: contributing/packaging.md - - Kernel: contributing/kernel.md + - Kernel: + - Hyperscale kernel: contributing/kernel.md + - Stock kernel: contributing/kernel-rhel.md - Documentation: contributing/documentation.md - Communication: - Channels: communication/channels.md From 8a8cb806d01092ee8d8430524fecd4ba419ede26 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Aug 02 2024 15:51:20 +0000 Subject: [PATCH 2/2] gitignore: Ignore editor staging/swap files --- diff --git a/.gitignore b/.gitignore index 1320f90..9430854 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ site +*.swp