This is quite the old topic…
Unfortunately there’s no “step by step process” to doing a rebuild of RHEL. It unfortunately is not that simple nor cut and dry as there are too many variables and just too many moving parts. Ultimately what it comes down to for a project to make a rebuild is identifying what has to be done at a minimum and then building the foundation around it to do so, to allow the team to figure out what was missed or what can be done to improve the process. We generally know these to be true but not limited to:
- Specific branded packages must be made (release, repos, gpg-keys, logos at a minimum)
- Some packages have to be debranded
- Some packages have to be changed to support Rocky (example, opa-ff, dotnet, osbuild, anaconda, grub2, kernel, and so on)
- Red Hat specific logos and assets have to be swapped (eg stuff that does not show up in a logos package)
- Packages must be built (usually in a bootstrap), and likely rebuilt to ensure consistency
- Packages have a specific build order usually, and this is especially true during beta/minor release updates
- UEFI/Secure Boot should be supported
- All sources come from git.centos.org, as red hat uploads their sources there
- dnf groups require “comps” and a general pungi config setup
With a general baseline, it is then that the plan of action is set forth. It has to be determined, what build system will be used, or in the case of already having one, how will we automate the process? Let’s look at Rocky 8 for example. We followed most of what we could from our upstreams, CentOS Stream, Fedora, and RHEL and used koji. So we essentially needed at a minimum:
- Koji, koji hub, koji builders
- Sigul (key signing)
- Module Build Service (for modularity builds, it’s an outside service)
- An SCM (git) that holds all the spec and source files
- Source tarballs will need a “look aside” or some sort of storage we can pull from
Our koji setup is done via ansible and the playbooks are available in our (soon to be deprecated) monorepo. The roles are also in our organization.
We then built automation around it with a tool called srpmproc
to do imports, patching, and the like, as well as integrated it into koji as a wrapper to pull package sources. distrobuild
was made as the automation around this though it is semi automated. pungi
is then used to “compose” the repositories and images, to which we send off to our mirrors.
For Rocky 9, we took what we learned and decided to do things a bit differently. The premise is the same with git and srpmproc, but now the build system, peridot, does all the building and composes for us, including assisting in image generation (like iso’s). It is then just a matter of doing a reposync to pull everything down and transfer to our mirrors.
Most of what we do day to day, at a high and medium level is documented throughout our wiki. It’s not perfect. One of our engineers did have a blog series in the past that explained some of what was done and some know how of how we got to where we here here.
In summary, there isn’t really a true step by step. There are guidelines and requirements laid out, and then the “plan” is built around those, starting from basic and usually ending up complex.