<inputclass="md-option"data-md-color-media="(prefers-color-scheme: light)"data-md-color-scheme="default"data-md-color-primary="teal"data-md-color-accent="teal"aria-label="Switch to dark mode"type="radio"name="__palette"id="__palette_0">
<labelclass="md-header__button md-icon"title="Switch to dark mode"for="__palette_1"hidden>
<inputclass="md-option"data-md-color-media="(prefers-color-scheme: dark)"data-md-color-scheme="slate"data-md-color-primary="teal"data-md-color-accent="teal"aria-label="Switch to light mode"type="radio"name="__palette"id="__palette_1">
<labelclass="md-header__button md-icon"title="Switch to light mode"for="__palette_0"hidden>
<p>The RESF primary purpose is to rebuild and debrand a 1:1 bug replica of RHEL and have built tools that support this process. The SIGs are modifications to that initial purpose while reusing the tooling already developed for the base dist-git process. The SIG dist-gits are controlled by automation that executes the <code>srpmproc</code> command so to modify the dist-git in any manner a developer needs to integrate their changes to the <code>sig/cloud/patch</code> configs related to that SIG. <ahref="https://git.rockylinux.org/sig/cloud/kernel">SIG/CLOUD - SRPMPROC Kernel Patches</a> -><ahref="https://git.rockylinux.org/sig/cloud/rpms/kernel">SIG/CLOUD - Kernel dist-git</a>
<code>srpmproc</code> is designed to only modify the <code>dist-git</code> and if a SIG wants a particular driver branch, that cleanly applies, they need to use another program called <code>sideline</code> to create a monolithic patch against a point in time source code base. That is then added to the <code>SIDELINE/_supporting</code> directory of the <code>sig/cloud/patch/kernel</code> directory. <code>srpmproc</code> knows that these patches are to be included into <code>SOURCES/</code> and added to <code>applypatch</code> directives in the <code>kernel.spec</code> with appropriate config settings for <code>srpmproc</code>.</p>
<p>The general process by the RESF was not initially created with ad-hoc development in mind but rather pulling entire branches from upstream into the current RESF base releases. The following is to provide a general guide on how to develop with <code>srpmproc</code> as the <code>SIG/CLOUD</code> dist-git is not to be modified directly for development support. </p>
<p>The following sections are going to be based off real work that was ultimately abandoned for Rocky8.</p>
<h3id="prep-for-srpmproc-cloning-patchkernel">Prep for SRPMPROC: Cloning patch/kernel<aclass="headerlink"href="#prep-for-srpmproc-cloning-patchkernel"title="Permanent link">¶</a></h3>
<p>This is the general prep of the directories used. Note some directions for <code>srpmproc</code> use a temp directory, that is not used here as depending on how long development can last you could lose important work, specifically around the <code>srpmproc-cache</code></p>
<p>Clone the configuration Directives and Patches repo.
Note: By default this clone will default to the <code>r8</code> branch, to work on other major versions you'll need to change the branch to the corresponding <code>r#</code> branch.
<p>Script example used to manage running <code>srpmproc</code>. Note that the <code>--cdn</code> is not <code>rocky#</code> but rather just <code>rocky</code>.
<p>After <code>srpmproc</code> runs you'll have a a new directory (<code>kernel</code>) in your current path that will have a working copy of the <code>sig/cloud</code><code>dist-git</code> used to build the RPMs for <code>sig/cloud</code></p>
<p>Example:
<divclass="highlight"><pre><span></span><code>$ ls -a kernel/r8/
<h4id="build-local-git-tree-remotes">Build Local Git Tree: Remotes<aclass="headerlink"href="#build-local-git-tree-remotes"title="Permanent link">¶</a></h4>
<p>If you're doing novel development here you can skip this step. However most people are going to be cherry-picking patches from Linus's Mainline at Kernel.org, or another remote, so you'll need to add them here to preform the cherry-picks.</p>
<p>Example is just fro adding the Linus kernel.org mainline.
<h4id="rebuild-local-repo-with-patches-existing-in-the-dist-git-spec-and-sources">Rebuild Local Repo with patches existing in the <code>dist-git</code> SPEC and SOURCES/<aclass="headerlink"href="#rebuild-local-repo-with-patches-existing-in-the-dist-git-spec-and-sources"title="Permanent link">¶</a></h4>
<p>NOTE: You'll want to make sure you're looking at the correct spec file for the major verions you're working with, this will be in the path.</p>
<p>In the below example you'll see that <code>r8</code> is in the patch of dist-git from the <code>srpmproc</code> run.
Note: <code>linux-kernel-test.patch</code> is empty.
Note2: <code>4-backport-changes-from-https-kernel-googlesource-com-pub-scm-linux-kernel-git-torvalds-linux-tag-v6-5.patch</code> is a massive monopatch.</p>
<h3id="backporting-process-cherry-picks-mostly">Backporting process (cherry-picks mostly)<aclass="headerlink"href="#backporting-process-cherry-picks-mostly"title="Permanent link">¶</a></h3>
<p>This is ultimately up to the back porter but due to the massive monolithic patch that is preferred by <code>srpmproc</code> and its current configuration changes its best to leave some markers in the backport commits. In the following example we used these markers to make sure we could reproduce the upstream change log for future cherry-picks
<h4id="local-git-tree-state-after-desired-patches-known-bug-fixes">Local Git Tree state after desired patches + known bug fixes:<aclass="headerlink"href="#local-git-tree-state-after-desired-patches-known-bug-fixes"title="Permanent link">¶</a></h4>
<p>Compile the kernel in place (outside the scope of this document).
You could also export all these patches and manually add them to the <code>dist-git</code> like by many other <code>dist-git</code> builds however they can not be submitted to the SIG from this state. So this would be exclusively for your local testing. If you choose to do this and are not sure how to use <code>mock</code> builds, <ahref="https://skip.linuxdn.org/blog.html#005_Rocky5_BuildLab_Part1">Skip's Blog</a> as a relevant primer tutorial for Rocky</p>
<h3id="prepare-changes-for-srpmproc-integration">Prepare changes for srpmproc integration<aclass="headerlink"href="#prepare-changes-for-srpmproc-integration"title="Permanent link">¶</a></h3>
<p>This is the part deviates pretty drastically from normal developer workflows.</p>
<p>In this case you'll want to take the commit you're branched off to the HEAD of your branch and create a single patch. Using the local commits in the above output we'll want <code>26523a2078fe</code> to be the first sha and <code>c92984ca64bb</code> to be the final</p>
<h4id="generate-cherry-pick-patch-and-changelog-entries-a-basic-method">Generate cherry-pick patch and changelog entries (a basic method)<aclass="headerlink"href="#generate-cherry-pick-patch-and-changelog-entries-a-basic-method"title="Permanent link">¶</a></h4>
<p>This segment is a manual way of producing the needed changelog entries and a nicer patch header than a standard <code>git diff</code>. And is being used to show examples of how and where to contribute.
<divclass="highlight"><pre><span></span><code>echo -e "Backport AmpereOne CPU clocksource and related bug fixes\n\nThis is just a monolithic diff.\nThe Commits backported are in git log order.\n"> ../patch_msg.resf.txt;
message: "af246cc6d0ed - Yang Guo - 2022-09-27 - clocksource/drivers/arm_arch_timer: Fix CNTPCT_LO and CNTVCT_LO value"\n
[19 lines ommited for readability]
message: "4775bc63f880 - Marc Zyngier - 2021-10-17 - clocksource/arm_arch_timer: Add build-time guards for unhandled register accesses"\n
</code></pre></div></p>
<p>Patch File so there is local reference to what was done. Its important to show how the monolithic patch is generated in the event the changes need to be re-played in the event of a code correction:
<p>This requires manual modification of directives file as <code>srpmproc</code> needs to be told what to do with the new file.</p>
<p>Some unique notes about <code>srpmproc</code>
* <code>patch</code> - directive applies a patch to the <code>dist-git</code> files themselves, NOT adding a patch the <code>.spec</code> file
* <code>add: {file: <path>}</code> is what will copy the file from <code>srpmproc</code> directories INTO the <code>dist-git</code><code>SOURCES/</code> location.
* <code>spec_change</code> is where we configure changes to the specfile like would be done to a standard <code>dist-git</code>
* This is processed in order, so <code>search_and_replace</code> will be processed in order for adding patches. Make sure the patches are applied in correct order.
* Since the file is processed in order the changelog items need to be placed in reverse order ie newest item at the top.</p>
<p>Example of a modification, NOTE <code>search_and_replace</code> were below the <code>chagnelog</code> entries. They were moved on this abandoned work such that the <code>file</code> and <code>search_and_replace</code> were located generally in order relation to how they would be modified in a pure <code>dist-git</code> style repo. In a hope to avoid jumping back and forth in the file.
+ message: "af246cc6d0ed - Yang Guo - 2022-09-27 - clocksource/drivers/arm_arch_timer: Fix CNTPCT_LO and CNTVCT_LO value"
+ message: "45ae272a948a - Joe Korty - 2022-12-02 - clocksource/drivers/arm_arch_timer: Fix XGene-1 TVAL register math error"
+ message: "8ec8490a1950 - D Scott Phillips - 2022-11-09 - arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro"
+ message: "1edb7e74a7d3 - Marc Zyngier - 2021-12-10 - clocksource/drivers/arm_arch_timer: Force inlining of erratum_set_next_event_generic()"
+ message: "6c3b62d93e19 - Kunkun Jiang - 2022-09-20 - clocksource/drivers/arm_arch_timer: Fix handling of ARM erratum 858921"
+ message: "e7d65e40ab5a - Walter Chang - 2023-08-18 - clocksource/drivers/arm_arch_timer: Disable timer before programming CVAL"
+ message: "c1153d52c414 - Oliver Upton - 2021-10-18 - clocksource/drivers/arm_arch_timer: Fix masking for high freq counters"
+ message: "ec8f7f3342c8 - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Drop unnecessary ISB on CVAL programming"
+ message: "41f8d02a6a55 - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Remove any trace of the TVAL programming interface"
+ message: "012f18850452 - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Work around broken CVAL implementations"
+ message: "30aa08da35e0 - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Advertise 56bit timer to the core code"
+ message: "8b82c4f883a7 - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Move MMIO timer programming over to CVAL"
+ message: "72f47a3f0ea4 - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Fix MMIO base address vs callback ordering issue"
+ message: "ac9ef4f24cb2 - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Move drop _tval from erratum function names"
+ message: "a38b71b0833e - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Move system register timer programming over to CVAL"
+ message: "1e8d929231cf - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Extend write side of timer register accessors to u64"
+ message: "d72689988d67 - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Drop CNT*_TVAL read accessors"
+ message: "4775bc63f880 - Marc Zyngier - 2021-10-17 - clocksource/arm_arch_timer: Add build-time guards for unhandled register accesses"
<p>NOTE: As of 2024.01.29 <code>srpmproc</code> cannot work off dev branches so this code will need to be on the main <code>r<version></code> branch.</p>
<p><code>srpmproc</code> will only refernce code that is actually in the git repo, a little contrary to how traditional development works.
This requires that both the large monolithic patch and the <code>directives.cfg</code> file changes need to be commited for <code>srpmproc</code> to actually pick them up.</p>
<p>Once this is done re-running <code>srpmproc</code> using the above script or exact same command parameters used when creating the local <code>srpmproc</code> will use the new local HEAD.</p>
<h3id="rebuild-with-local-dist-git">Rebuild with local <code>dist-git</code><aclass="headerlink"href="#rebuild-with-local-dist-git"title="Permanent link">¶</a></h3>
<scriptid="__config"type="application/json">{"base":"../..","features":["navigation.expand","navigation.indexes","navigation.instant","navigation.tabs","navigation.top","navigation.tracking","search.highlight","search.suggest","toc.integrate"],"search":"../../assets/javascripts/workers/search.b8dbb3d2.min.js","translations":{"clipboard.copied":"Copied to clipboard","clipboard.copy":"Copy to clipboard","search.result.more.one":"1 more on this page","search.result.more.other":"# more on this page","search.result.none":"No matching documents","search.result.one":"1 matching document","search.result.other":"# matching documents","search.result.placeholder":"Type to start searching","search.result.term.missing":"Missing","select.version":"Select version"}}</script>