1 line
32 KiB
JSON
1 line
32 KiB
JSON
{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Rocky Linux SIG/Cloud Wiki","text":"<p>The Rocky Linux Cloud Special Interest Group is dedicated to the enablement of of Rocky Linux on Cloud Services Providers in private and public clouds.</p> <p>Anyone is welcome to join and participate in the activities and responsibilities of the Cloud SIG.</p> <p>This documentation is a work in progress and we welcome any and all contributions, which can be made on git.resf.org/sig_core/wiki</p>"},{"location":"#links","title":"Links","text":"<ul> <li>Peridot - Rocky Linux 9 - SIG Cloud</li> <li>Peridot - Rocky Linux 8 - SIG Cloud</li> <li>RPMS</li> <li>Patches</li> <li>peridot-config</li> <li>Container images distribution</li> </ul>"},{"location":"#responsibilities","title":"Responsibilities","text":"<p>The Cloud SIG is mainly responsible for two items: Cloud Images and Optimized Kernels for clouds.</p>"},{"location":"#images","title":"Images","text":"<p>A multitude of images are created as part of the Rocky Linux release process, using kickstarts and Rocky Release Engineering's toolkit \"Empanadas\" to compose the images.</p> <p>Currently, the following images are produced by the SIG:</p> <ul> <li>Container rootfs (Base, Minimal, UBI, UBI-init, UBI-micro variants)</li> <li>GenericCloud</li> <li>EC2 (Amazon AWS)</li> <li>Oracle Cloud Platform</li> <li>Google Cloud Platform (Images are generated by GCP)</li> <li>Microsoft Azure</li> <li> <p>Vagrant-compatibile images (Libvirt, Virtualbox, VMware)</p> <ul> <li>NOTE(nhanlon) 2022-10-11: These images are currently a best-effort production until the workflows are automated to create these images.</li> </ul> </li> </ul>"},{"location":"#optimized-kernels","title":"Optimized Kernels","text":"<p>The Cloud SIG also produces a custom kernel artifact for use on various cloud providers. Currently, the major changes in this kernel are the backporting of several changes from stable/mainline kernel branches relating to GVNic drivers for improved performance on Google Cloud Platform. Note that the Kernel is the same version as in any given Rocky Release, but has patches from kernel.org branches backported and applied on top.</p> <p>A full description of the changes the this Kernel has can be found here.</p> <p>Any and all changes which may benefit ease or performance of usage of Rocky on clouds are welcome to be contributed. In order to maintain patches, a tool called Sideline was developed to aid in grabbing and applying patches to the Rocky Linux standard Kernel.</p>"},{"location":"#members","title":"Members","text":"<ul> <li>Neil Hanlon</li> <li>Brian Clemens</li> <li>Mustafa Gezen</li> <li>Zach Marano</li> <li>Gregory Kurtzer</li> <li>Dave Linksey</li> <li>Lukas Magauer</li> <li>Kyle Ishie</li> </ul>"},{"location":"#project-layout","title":"Project layout","text":"<pre><code>mkdocs.yml # The configuration file.\ndocs/\n index.md # The documentation homepage.\n ... # Other markdown pages, images and other files.\n</code></pre>"},{"location":"packages/kernel/","title":"SIG/Cloud Kernel Package","text":""},{"location":"packages/kernel/#requirements","title":"Requirements","text":"<ul> <li>RESF Account: https://accounts.rockylinux.org/</li> <li>srpmproc: https://github.com/rocky-linux/srpmproc</li> <li>sideline: https://github.com/rocky-linux/sideline</li> </ul>"},{"location":"packages/kernel/#general-process","title":"General Process","text":"<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. SIG/CLOUD - SRPMPROC Kernel Patches -> SIG/CLOUD - Kernel dist-git <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>"},{"location":"packages/kernel/#diagram-production","title":"Diagram Production","text":"<pre><code> |--------------------------|\n | : SRPMPRROC : |\n | Pulls RESF dist-git |\n | Alters dist-git files |\n | Injects SIDELINE patches |\n |---Pull---| into soruce/ and .spec |---Automation:--|\n | |--------------------------| Push |\n v v\n|----------| |-----------|\n| : RESF : | | : RESF : |\n| dist-git | | SIG/CLOUD |\n|----------| | dist-git |\n |-----------|\n</code></pre>"},{"location":"packages/kernel/#developer-process","title":"Developer Process","text":"<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>Basic Process:</p> <ol> <li>Clone <code>sig/cloud/patch/kernel</code> repo</li> <li>Run Local <code>srpmproc</code></li> <li>Build local git repo for kernel source</li> <li>Make Changes, local builds and testing (not covered in doc)</li> <li>Source changes from local build to <code>sig/cloud/patch/kernel</code></li> <li>Regenerate <code>dist-git</code> with srpmproc</li> <li>Mock test rpm builds.</li> </ol> <p>The following sections are going to be based off real work that was ultimately abandoned for Rocky8.</p>"},{"location":"packages/kernel/#prep-for-srpmproc-cloning-patchkernel","title":"Prep for SRPMPROC: Cloning patch/kernel","text":"<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>Create Needed Directories <pre><code>mkdir -p SIG/cloud/\ncd SIG/cloud/\nmkdir -p {rpms,patch,src,srpmproc-cache,src-git}\n</code></pre></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. <pre><code>git clone ssh://git@git.rockylinux.org:22220/sig/cloud/patch/kernel.git patch/kernel.git\n</code></pre></p>"},{"location":"packages/kernel/#rocky-8-srpmproc-example","title":"Rocky 8 SRPMPROC Example","text":"<p>Script example used to manage running <code>srpmproc</code> <pre><code>#!/bin/bash\nset -x\n\nMYHOME=`pwd`\n~/bin/srpmproc --cdn rocky8 --version 8 \\\n --upstream-prefix \"file://${MYHOME}/\" \\\n --storage-addr file:///${MYHOME}/srpmproc-cache \\\n --import-branch-prefix 'r' --strict-branch-mode \\\n --rpm-prefix \"https://git.rockylinux.org/staging/rpms\" \\\n --ssh-key-location ~/.ssh/resfgit \\\n --source-rpm kernel --tmpfs-mode kernel\n</code></pre></p>"},{"location":"packages/kernel/#rocky-9-srpmproc-example","title":"Rocky 9 SRPMPROC Example","text":"<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>. <pre><code>#!/bin/bash\nset -x\n\nMYHOME=`pwd`\n~/bin/srpmproc --cdn rocky --version 9 \\\n --upstream-prefix \"file://${MYHOME}/\" \\\n --storage-addr file:///${MYHOME}/srpmproc-cache \\\n --import-branch-prefix 'r' --strict-branch-mode \\\n --rpm-prefix \"https://git.rockylinux.org/staging/rpms\" \\\n --source-rpm kernel --tmpfs-mode kernel\n</code></pre></p>"},{"location":"packages/kernel/#srpmproc-1st-run","title":"<code>srpmproc</code> 1st run","text":"<p>This step will be missing a lot of output just so that we can focus on the results and where we source building a local source git tree.</p> <p>RUN SRPMPROC with script or by hand. <pre><code>./sprmproc.sh\n</code></pre></p> <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: <pre><code>$ ls -a kernel/r8/\n. .. .gitignore .kernel.checksum .kernel.metadata SOURCES SPECS\n</code></pre></p>"},{"location":"packages/kernel/#build-local-git-tree-repo","title":"Build Local git tree repo","text":"<p>At this point the dist-git can extracted and modified for change however the individual wants. Below is how the author did this.</p> <p>Extract the TarBall note this was the original 8.9 change and the exact version has incremented. <pre><code>tar xvf kernel/r8/SOURCES/linux-4.18.0-513.9.1.el8_9.tar.xz -C src-git/\ncd src-git/linux-4.18.0-513.9.1.el8_9/\n</code></pre></p> <p>Commit to a local branch so we have a starting point. <pre><code>git init .\ngit add .\ngit commit\n</code></pre> Results: <pre><code>$ git log\ncommit 4be223b7a767b0d9ac27525ab26fc37ebdea52bb (HEAD -> mainline)\nAuthor: Jonathan Maple <jmaple@ciq.com>\nDate: Tue Jan 2 15:44:17 2024 -0500\n\n Initial Commit from RESF Source\n</code></pre></p>"},{"location":"packages/kernel/#build-local-git-tree-remotes","title":"Build Local Git Tree: Remotes","text":"<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. <pre><code>git remote add Linux-Mainline https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\n</code></pre></p>"},{"location":"packages/kernel/#rebuild-local-repo-with-patches-existing-in-the-dist-git-spec-and-sources","title":"Rebuild Local Repo with patches existing in the <code>dist-git</code> SPEC and SOURCES/","text":"<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. <code>../../kernel/r8/SPECS/kernel.spec</code></p> <p>Find and apply patches from <code>kernel.spec</code> <pre><code>egrep -i \"apply.*\\.patch\" ../../kernel/r8/SPECS/kernel.spec\n</code></pre> Results: <pre><code>ApplyOptionalPatch linux-kernel-test.patch\nApplyPatch 4-backport-changes-from-https-kernel-googlesource-com-pub-scm-linux-kernel-git-torvalds-linux-tag-v6-5.patch\n</code></pre> 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> <p>Apply Patches <pre><code>patch -p1 < ../../patch/kernel.git/SIDELINE/_supporting/4-backport-changes-from-https-kernel-googlesource-com-pub-scm-linux-kernel-git-torvalds-linux-tag-v6-5.patch\n</code></pre> Results: <pre><code>patching file drivers/net/ethernet/google/Kconfig\npatching file drivers/net/ethernet/google/gve/gve.h\npatching file drivers/net/ethernet/google/gve/gve_adminq.c\npatching file drivers/net/ethernet/google/gve/gve_adminq.h\npatching file drivers/net/ethernet/google/gve/gve_desc_dqo.h\npatching file drivers/net/ethernet/google/gve/gve_ethtool.c\npatching file drivers/net/ethernet/google/gve/gve_main.c\npatching file drivers/net/ethernet/google/gve/gve_rx.c\npatching file drivers/net/ethernet/google/gve/gve_rx_dqo.c\npatching file drivers/net/ethernet/google/gve/gve_tx.c\npatching file drivers/net/ethernet/google/gve/gve_tx_dqo.c\npatching file drivers/net/ethernet/google/gve/gve_utils.c\npatching file drivers/net/ethernet/google/gve/gve_utils.h\n</code></pre></p> <p>Commit changes: <pre><code>git commit .\n</code></pre> Results: <pre><code>$ git log\ncommit 26523a2078fe35af623eb7c885be23c9d1078c32 (HEAD -> mainline)\nAuthor: Jonathan Maple <jmaple@ciq.com>\nDate: Tue Jan 2 15:50:54 2024 -0500\n\n Add RESF Google Patch\n\n 4-backport-changes-from-https-kernel-googlesource-com-pub-scm-linux-kernel-git-torvalds-linux-tag-v6-5.patch\n</code></pre></p>"},{"location":"packages/kernel/#backporting-process-cherry-picks-mostly","title":"Backporting process (cherry-picks mostly)","text":"<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 <pre><code><subject unaltered >\n\n<ticket_system> <ticket>\n<opt: CVE> <CVE-NUMBER>\ncommit <sha1 of original commit>\n<opt: upstream-diff> <diff commtent on why it differs from upstream>\n\n<original commit message>\n\\t<original signoffs> (indented as we don't nessicarily want to notify everyone for this)\n(cherry picked from commit: <sha1>)\nSigned-off-by: Author <email>\n</code></pre> Note the last two items are auto added by <code>git cherry-pick -nsx <sha1></code></p> <p>EXAMPLE of <code>cherry-pick</code> with output: <pre><code>$ git cherry-pick -nsx 4775bc63f880\nAuto-merging arch/arm/include/asm/arch_timer.h\nAuto-merging arch/arm64/include/asm/arch_timer.h\nAuto-merging drivers/clocksource/arm_arch_timer.c\n\n$ git status\nOn branch ampereone\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n modified: arch/arm/include/asm/arch_timer.h\n modified: arch/arm64/include/asm/arch_timer.h\n modified: drivers/clocksource/arm_arch_timer.c\n\n$ git add .\n\n$ git commit\n\n[ampereone 8be2a2c2ce27] clocksource/arm_arch_timer: Add build-time guards for unhandled register accesses\n 3 files changed, 32 insertions(+), 1 deletion(-)\n\n$ git log\ncommit 8be2a2c2ce27af0fd99ecc72da1977685021afd1 (HEAD -> ampereone)\nAuthor: Jonathan Maple <jmaple@ciq.com>\nDate: Wed Jan 10 16:10:14 2024 -0500\n\n clocksource/arm_arch_timer: Add build-time guards for unhandled register accesses\n\n jira ROC-2809\n commit 4775bc63f880001ee4fbd6456b12ab04674149e3\n\n As we are about to change the registers that are used by the driver,\n start by adding build-time checks to ensure that we always handle\n all registers and access modes.\n\n Suggested-by: Mark Rutland <mark.rutland@arm.com>\n Signed-off-by: Marc Zyngier <maz@kernel.org>\n Link: https://lore.kernel.org/r/20211017124225.3018098-2-maz@kernel.org\n Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>\n\n (cherry picked from commit 4775bc63f880001ee4fbd6456b12ab04674149e3)\n Signed-off-by: Jonathan Maple <jmaple@ciq.com>\n\nommit 26523a2078fe35af623eb7c885be23c9d1078c32 (mainline)\nAuthor: Jonathan Maple <jmaple@ciq.com>\nDate: Tue Jan 2 15:50:54 2024 -0500\n\n Add RESF Google Patch\n\n 4-backport-changes-from-https-kernel-googlesource-com-pub-scm-linux-kernel-git-torvalds-linux-tag-v6-5.patch\n\ncommit 4be223b7a767b0d9ac27525ab26fc37ebdea52bb\nAuthor: Jonathan Maple <jmaple@ciq.com>\nDate: Tue Jan 2 15:44:17 2024 -0500\n\n Initial Commit from RESF Source\n</code></pre></p>"},{"location":"packages/kernel/#local-git-tree-state-after-desired-patches-known-bug-fixes","title":"Local Git Tree state after desired patches + known bug fixes:","text":"<pre><code> git log --oneline\nc92984ca64bb (HEAD -> ampereone) clocksource/drivers/arm_arch_timer: Remove arch_timer_rate1\n1a4edf30d579 clocksource/drivers/arm_arch_timer: Fix CNTPCT_LO and CNTVCT_LO value\nc50e0c82b622 clocksource/drivers/arm_arch_timer: Fix XGene-1 TVAL register math error\nc4b9ba6322bd arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro\nd6c3b12badb6 clocksource/drivers/arm_arch_timer: Force inlining of erratum_set_next_event_generic()\n612170156e8e clocksource/drivers/arm_arch_timer: Fix handling of ARM erratum 858921\necd5b3bc64e6 clocksource/drivers/arm_arch_timer: Disable timer before programming CVAL\nd0736a304c83 clocksource/drivers/arm_arch_timer: limit XGene-1 workaround\nc44180277750 clocksource/drivers/arch_arm_timer: Move workaround synchronisation around\n4245d37d01b5 clocksource/drivers/arm_arch_timer: Fix masking for high freq counters\nc9a41f6ca50a clocksource/drivers/arm_arch_timer: Drop unnecessary ISB on CVAL programming\n79cbc595435b clocksource/drivers/arm_arch_timer: Remove any trace of the TVAL programming interface\n5ce552b7c335 clocksource/drivers/arm_arch_timer: Work around broken CVAL implementations\ne616b69d5656 clocksource/drivers/arm_arch_timer: Advertise 56bit timer to the core code\n7d8301d23b2d clocksource/drivers/arm_arch_timer: Move MMIO timer programming over to CVAL\n96f3d866ac46 clocksource/drivers/arm_arch_timer: Fix MMIO base address vs callback ordering issue\n405b16cdf7ea clocksource/drivers/arm_arch_timer: Add __ro_after_init and __init\na674842337c0 clocksource/drivers/arm_arch_timer: Move drop _tval from erratum function names\n7362b3b1507d clocksource/drivers/arm_arch_timer: Move system register timer programming over to CVAL\nfa7e8c083474 clocksource/drivers/arm_arch_timer: Extend write side of timer register accessors to u64\n39df82354a3b clocksource/drivers/arm_arch_timer: Drop CNT*_TVAL read accessors\n8be2a2c2ce27 clocksource/arm_arch_timer: Add build-time guards for unhandled register accesses\n26523a2078fe (mainline) Add RESF Google Patch\n4be223b7a767 Initial Commit from RESF Source\n</code></pre>"},{"location":"packages/kernel/#local-kernel-builds","title":"Local Kernel Builds","text":"<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, Skip's Blog as a relevant primer tutorial for Rocky</p>"},{"location":"packages/kernel/#prepare-changes-for-srpmproc-integration","title":"Prepare changes for srpmproc integration","text":"<p>This is the part deviates pretty drastically from normal developer workflows.</p>"},{"location":"packages/kernel/#generate-monolithic-patch","title":"Generate Monolithic Patch","text":"<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> <pre><code>git diff 26523a2078fe c92984ca64bb > ../ampereone.patch\n</code></pre>"},{"location":"packages/kernel/#generate-cherry-pick-patch-and-changelog-entries-a-basic-method","title":"Generate cherry-pick patch and changelog entries (a basic method)","text":"<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. <pre><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;\necho -n \"\" > ../srpmproc_changelog.resf.txt;\n\ngit log --pretty=\"format:%b\" \\\n | grep ^commit | awk '{print $2}' \\\n | sed 's/)$//' | \\\n while read commit; do \\\n git log -1 --pretty=\"format:%h %s\" ${commit} >> ../patch_msg.resf.txt; \\\n echo \"\\n\" >> ../patch_msg.resf.txt; \\\n git log -1 --pretty=\"format:message: \\\"%h - %an - %cs - %s\\\"\" ${commit} >> ../srpmproc_changelog.resf.txt; \\\n echo \"\\n\" >> ../srpmproc_changelog.resf.txt; \\\n done;\n\necho -e \"\\n\\nBackport-By: Jonathan Maple (jmaple@ciq.com)\\n\\n\" >> ../patch_msg.resf.txt;\ncat ../patch_msg.resf.txt > ../ampereone.resf.patch;\ncat ../ampereone.patch >> ../ampereone.resf.patch;\n</code></pre></p>"},{"location":"packages/kernel/#example-results","title":"Example Results","text":"<p>For <code>srpmproc</code> specfile changelog section <pre><code>$ cat ../srpmproc_changelog.resf.txt\nmessage: \"4f9f4f0f6261 - Jisheng Zhang - 2021-06-03 - clocksource/drivers/arm_arch_timer: Remove arch_timer_rate1\"\\n\nmessage: \"af246cc6d0ed - Yang Guo - 2022-09-27 - clocksource/drivers/arm_arch_timer: Fix CNTPCT_LO and CNTVCT_LO value\"\\n\n[19 lines ommited for readability]\nmessage: \"4775bc63f880 - Marc Zyngier - 2021-10-17 - clocksource/arm_arch_timer: Add build-time guards for unhandled register accesses\"\\n\n</code></pre></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: <pre><code>$ cat ../ampereone.resf.patch\nBackport AmpereOne CPU clocksource and related bug fixes\n\nThis is just a monolithic diff.\nThe Commits backported are in git log order.\n\n4f9f4f0f6261 clocksource/drivers/arm_arch_timer: Remove arch_timer_rate1\\n\naf246cc6d0ed clocksource/drivers/arm_arch_timer: Fix CNTPCT_LO and CNTVCT_LO value\\n\n[19 lines ommited for readability]\n4775bc63f880 clocksource/arm_arch_timer: Add build-time guards for unhandled register accesses\\n\n\n\nBackport-By: Jonathan Maple (jmaple@ciq.com)\n\n\ndiff --git a/arch/arm/include/asm/arch_timer.h b/arch/arm/include/asm/arch_timer.h\nindex 4b66ecd6be99..5063cdaad21d 100644\n--- a/arch/arm/include/asm/arch_timer.h\n+++ b/arch/arm/include/asm/arch_timer.h\n</code></pre></p>"},{"location":"packages/kernel/#copy-monolithic-patch","title":"Copy Monolithic Patch","text":"<pre><code>cp ../ampereone.resf.patch ../../patch/kernel.git/SIDELINE/_supporting/\n</code></pre>"},{"location":"packages/kernel/#modify-srpmproc-directives","title":"Modify SRPMPROC directives","text":"<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. <pre><code>$ git diff\ndiff --git a/ROCKY/CFG/directives.cfg b/ROCKY/CFG/directives.cfg\nindex 6c21c18..2889b25 100644\n--- a/ROCKY/CFG/directives.cfg\n+++ b/ROCKY/CFG/directives.cfg\n@@ -1,12 +1,61 @@\n add: {\n file: \"SIDELINE/_supporting/4-backport-changes-from-https-kernel-googlesource-com-pub-scm-linux-kernel-git-torvalds-linux-tag-v6-5.patch\"\n }\n+add: {\n+ file: \"SIDELINE/_supporting/ampereone.patch\n+}\n spec_change: {\n file: {\n name: \"4-backport-changes-from-https-kernel-googlesource-com-pub-scm-linux-kernel-git-torvalds-linux-tag-v6-5.patch\"\n type: Patch\n add: true\n }\n+ search_and_replace: {\n+ any: true\n+ find: \"ApplyOptionalPatch linux-kernel-test.patch\"\n+ replace: \"ApplyOptionalPatch linux-kernel-test.patch\\nApplyPatch 4-backport-changes-from-https-kernel-googlesource-com-pub-scm-linux-kernel-git-torvalds-linux-tag-v6-5.patch\"\n+ n: 1\n+ }\n+\n+ file: {\n+ name: ampereone.patch\n+ type: Patch\n+ add: true\n+ }\n+ search_and_replace: {\n+ any: true\n+ find: \"ApplyPatch 4-backport-changes-from-https-kernel-googlesource-com-pub-scm-linux-kernel-git-torvalds-linux-tag-v6-5.patch\"\n+ replace: \"ApplyPatch 4-backport-changes-from-https-kernel-googlesource-com-pub-scm-linux-kernel-git-torvalds-linux-tag-v6-5.patch\\nApplyPatch google_ampere_clocksource_diff.patch\"\n+ n: 1\n+ }\n+\n+ changelog: {\n+ author_name: \"Jonathan Maple\"\n+ author_email: \"jmaple@ciq.com\"\n+ message: \"4f9f4f0f6261 - Jisheng Zhang - 2021-06-03 - clocksource/drivers/arm_arch_timer: Remove arch_timer_rate1\"\n+ message: \"af246cc6d0ed - Yang Guo - 2022-09-27 - clocksource/drivers/arm_arch_timer: Fix CNTPCT_LO and CNTVCT_LO value\"\n+ message: \"45ae272a948a - Joe Korty - 2022-12-02 - clocksource/drivers/arm_arch_timer: Fix XGene-1 TVAL register math error\"\n+ message: \"8ec8490a1950 - D Scott Phillips - 2022-11-09 - arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro\"\n+ message: \"1edb7e74a7d3 - Marc Zyngier - 2021-12-10 - clocksource/drivers/arm_arch_timer: Force inlining of erratum_set_next_event_generic()\"\n+ message: \"6c3b62d93e19 - Kunkun Jiang - 2022-09-20 - clocksource/drivers/arm_arch_timer: Fix handling of ARM erratum 858921\"\n+ message: \"e7d65e40ab5a - Walter Chang - 2023-08-18 - clocksource/drivers/arm_arch_timer: Disable timer before programming CVAL\"\n+ message: \"851354cbd12b - Andre Przywara - 2023-10-18 - clocksource/drivers/arm_arch_timer: limit XGene-1 workaround\"\n+ message: \"db26f8f2da92 - Marc Zyngier - 2021-10-18 - clocksource/drivers/arch_arm_timer: Move workaround synchronisation around\"\n+ message: \"c1153d52c414 - Oliver Upton - 2021-10-18 - clocksource/drivers/arm_arch_timer: Fix masking for high freq counters\"\n+ message: \"ec8f7f3342c8 - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Drop unnecessary ISB on CVAL programming\"\n+ message: \"41f8d02a6a55 - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Remove any trace of the TVAL programming interface\"\n+ message: \"012f18850452 - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Work around broken CVAL implementations\"\n+ message: \"30aa08da35e0 - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Advertise 56bit timer to the core code\"\n+ message: \"8b82c4f883a7 - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Move MMIO timer programming over to CVAL\"\n+ message: \"72f47a3f0ea4 - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Fix MMIO base address vs callback ordering issue\"\n+ message: \"e2bf384d4329 - Jisheng Zhang - 2021-04-08 - clocksource/drivers/arm_arch_timer: Add __ro_after_init and __init\"\n+ message: \"ac9ef4f24cb2 - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Move drop _tval from erratum function names\"\n+ message: \"a38b71b0833e - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Move system register timer programming over to CVAL\"\n+ message: \"1e8d929231cf - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Extend write side of timer register accessors to u64\"\n+ message: \"d72689988d67 - Marc Zyngier - 2021-10-17 - clocksource/drivers/arm_arch_timer: Drop CNT*_TVAL read accessors\"\n+ message: \"4775bc63f880 - Marc Zyngier - 2021-10-17 - clocksource/arm_arch_timer: Add build-time guards for unhandled register accesses\"\n+ }\n+\n changelog: {\n author_name: \"RESF Sideline (Backporter)\"\n author_email: \"releng+sideline@rockylinux.org\"\n@@ -138,12 +187,6 @@ spec_change: {\n message: \"f5cedc84a30d2d3d0e0a7f3eb53fbd66d9bf5517 - Catherine Sullivan - 2019-07-01 - gve: Add transmit and receive support\"\n message: \"893ce44df56580fb878ca5af9c4a5fd87567da50 - Catherine Sullivan - 2019-07-01 - gve: Add basic driver framework for Compute Engine Virtual NIC\"\n }\n- search_and_replace: {\n- any: true\n- find: \"ApplyOptionalPatch linux-kernel-test.patch\"\n- replace: \"ApplyOptionalPatch linux-kernel-test.patch\\nApplyPatch 4-backport-changes-from-https-kernel-googlesource-com-pub-scm-linux-kernel-git-torvalds-linux-tag-v6-5\n.patch\"\n- n: 1\n- }\n search_and_replace: {\n any: true\n find: \"ApplyOptionalPatch debrand-single-cpu.patch\"\n</code></pre></p>"},{"location":"packages/kernel/#commit-locally-and-rerun-srpmproc","title":"Commit locally and rerun <code>srpmproc</code>","text":"<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> <pre><code>$ git log\ncommit b32760fa1ed8a29145ca05d6bda391256a2aa70c (HEAD -> r8)\nAuthor: Jonathan Maple <jmaple@ciq.com>\nDate: Thu Jan 11 14:54:14 2024 -0500\n\n Add AmpereOne CPU clocksource patches to r8\n\n There is a request in the cloud to support fixes for AmpereOne CPUs with\n clocksource fixes in the Rocky8 kernels. This was a large manual\n backport with cherry-picks and picking up all known bugfixes for pulled\n patches.\n</code></pre> <p>Example using the new commit: <pre><code>[jmaple@devbox cloud]$ ./srpmproc.sh\n2024/01/12 13:25:15 Discovered --cdn distro: rocky8 . Using override CDN URL Pattern: https://rocky-linux-sources-staging.a1.rockylinux.org/{{.Hash}}\n2024/01/12 13:25:15 using tmpfs dir: kernel\n2024/01/12 13:25:29 tag: imports/r8/kernel-4.18.0-513.11.1.el8_9\n2024/01/12 13:25:29 using remote: file:///home/jmaple/workspace/code/r89builder/SIG/cloud//rpms/kernel.git\n2024/01/12 13:25:29 using refspec: +refs/heads/r8:refs/remotes/origin/r8\n2024/01/12 13:25:29 set reference to ref: refs/heads/r8\nFound branchname that does not start w/ refs/heads :: r8\n[SNIP]\n{\"branch_versions\":{\"r8\":{\"version\":\"4.18.0\",\"release\":\"513.11.1.el8_9\"}}}\n\n[jmaple@devbox cloud]$ find kernel/ -type f | xargs grep ampereone; find kernel/ -type f | grep ampereone\nkernel/r8/SPECS/kernel.spec:Patch1002: ampereone.patch\nkernel/r8/SPECS/kernel.spec:ApplyPatch ampereone.patch\nkernel/r8/SOURCES/ampereone.patch\n</code></pre></p>"},{"location":"packages/kernel/#rebuild-with-local-dist-git","title":"Rebuild with local <code>dist-git</code>","text":"<p>Reuse methods above</p>"},{"location":"packages/kernel/#create-pr-to-resfs","title":"CREATE PR to RESFs","text":"<p>Contributor Access Guide: https://wiki.rockylinux.org/contributing/start/#requesting-access-to-groups-in-rocky-account-services</p>"}]} |