@@ -160,7 +160,7 @@ will be considered the 'good' release and used to prepare the .config file.
160160 this step (e.g. build, install, boot, and test a kernel to then tell Git
161161 the outcome). Do so again and again until Git shows which commit broke
162162 things. If you run short of disk space during this process, check the
163- section 'Supplementary tasks: cleanup during and after the process'
163+ section 'Complementary tasks: cleanup during and after the process'
164164 below.
165165
166166 d) Once your finished the bisection, put a few things away::
@@ -182,7 +182,7 @@ will be considered the 'good' release and used to prepare the .config file.
182182 kernel; just this time skip the first command copying the base .config file
183183 over, as that already has been taken care off.
184184
185- * **Supplementary tasks **: cleanup during and after the process.
185+ * **Complementary tasks **: cleanup during and after the process.
186186
187187 a) To avoid running out of disk space during a bisection, you might need to
188188 remove some kernels you built earlier. You most likely want to keep those
@@ -205,6 +205,18 @@ will be considered the 'good' release and used to prepare the .config file.
205205 the kernels you built earlier and later you might want to keep around for
206206 a week or two.
207207
208+ * **Optional task **: test a debug patch or a proposed fix later::
209+
210+ git fetch mainline
211+ git switch --discard-changes --detach mainline/master
212+ git apply /tmp/foobars-proposed-fix-v1.patch
213+ cp ~/kernel-config-working .config
214+ ./scripts/config --set-str CONFIG_LOCALVERSION '-local-foobars-fix-v1'
215+
216+ Build, install, and boot a kernel as described in *segment 1, section b* --
217+ but this time omit the first command copying the build configuration over,
218+ as that has been taken care of already.
219+
208220.. _introguide_bissbs :
209221
210222Step-by-step guide on how to verify bugs and bisect regressions
@@ -232,7 +244,9 @@ developers are obliged to act upon.
232244
233245 :ref: `Segment 3: perform a bisection and validate the result <introbisect_bissbs >`.
234246
235- :ref: `Supplementary tasks: cleanup during and after following this guide <introclosure_bissbs >`.
247+ :ref: `Complementary tasks: cleanup during and after following this guide <introclosure_bissbs >`.
248+
249+ :ref: `Optional tasks: test reverts, patches, or later versions <introoptional_bissbs >`.
236250
237251The steps in each segment illustrate the important aspects of the process, while
238252a comprehensive reference section holds additional details for almost all of the
@@ -669,7 +683,7 @@ be a waste of time. [:ref:`details <introlatestcheck_bisref>`]
669683Do you follow this guide to verify if a problem is present in the code
670684currently supported by Linux kernel developers? Then you are done at this
671685point. If you later want to remove the kernel you just built, check out
672- :ref: `Supplementary tasks: cleanup during and after following this guide <introclosure_bissbs >`.
686+ :ref: `Complementary tasks: cleanup during and after following this guide <introclosure_bissbs >`.
673687
674688In case you face a regression, move on and execute at least the next segment
675689as well.
@@ -888,7 +902,7 @@ each kernel on commodity x86 machines.
888902
889903.. _introclosure_bissbs :
890904
891- Supplementary tasks: cleanup during and after the bisection
905+ Complementary tasks: cleanup during and after the bisection
892906-----------------------------------------------------------
893907
894908During and after following this guide you might want or need to remove some of
@@ -950,6 +964,81 @@ space might run out.
950964
951965 [:ref: `details <finishingtouch_bisref >`]
952966
967+ .. _introoptional_bissbs :
968+
969+ Optional: test reverts, patches, or later versions
970+ --------------------------------------------------
971+
972+ While or after reporting a bug, you might want or potentially will be asked to
973+ test reverts, debug patches, proposed fixes, or other versions. In that case
974+ follow these instructions.
975+
976+ * Update your Git clone and check out the latest code.
977+
978+ * In case you want to test mainline, fetch its latest changes before checking
979+ its code out::
980+
981+ git fetch mainline
982+ git switch --discard-changes --detach mainline/master
983+
984+ * In case you want to test a stable or longterm kernel, first add the branch
985+ holding the series you are interested in (6.2 in the example), unless you
986+ already did so earlier::
987+
988+ git remote set-branches --add stable linux-6.2.y
989+
990+ Then fetch the latest changes and check out the latest version from the
991+ series::
992+
993+ git fetch stable
994+ git switch --discard-changes --detach stable/linux-6.2.y
995+
996+ * Copy your kernel build configuration over::
997+
998+ cp ~/kernel-config-working .config
999+
1000+ * Your next step depends on what you want to do:
1001+
1002+ * In case you just want to test the latest codebase, head to the next step,
1003+ you are already all set.
1004+
1005+ * In case you want to test if a revert fixes an issue, revert one or multiple
1006+ changes by specifying their commit ids::
1007+
1008+ git revert --no-edit cafec0cacaca0
1009+
1010+ Now give that kernel a special tag to facilitates its identification and
1011+ prevent accidentally overwriting another kernel::
1012+
1013+ ./scripts/config --set-str CONFIG_LOCALVERSION '-local-cafec0cacaca0-reverted'
1014+
1015+ * In case you want to test a patch, store the patch in a file like
1016+ '/tmp/foobars-proposed-fix-v1.patch' and apply it like this::
1017+
1018+ git apply /tmp/foobars-proposed-fix-v1.patch
1019+
1020+ In case of multiple patches, repeat this step with the others.
1021+
1022+ Now give that kernel a special tag to facilitates its identification and
1023+ prevent accidentally overwriting another kernel::
1024+
1025+ ./scripts/config --set-str CONFIG_LOCALVERSION '-local-foobars-fix-v1'
1026+
1027+ * Build a kernel using the familiar commands, just without copying the kernel
1028+ build configuration over, as that has been taken care of already::
1029+
1030+ make olddefconfig &&
1031+ make -j $(nproc --all)
1032+ # * Check if the free space suffices holding another kernel:
1033+ df -h /boot/ /lib/modules/
1034+ sudo make modules_install
1035+ command -v installkernel && sudo make install
1036+ make -s kernelrelease | tee -a ~/kernels-built
1037+ reboot
1038+
1039+ * Now verify you booted the newly built kernel and check it.
1040+
1041+ [:ref: `details <introoptional_bisref >`]
9531042
9541043.. _submit_improvements :
9551044
@@ -1986,20 +2075,33 @@ build artifacts and the Linux sources, but will leave the Git repository
19862075(~/linux/.git/) behind -- a simple ``git reset --hard `` thus will bring the
19872076sources back.
19882077
1989- Removing the repository as well would likely be unwise at this point: there is a
1990- decent chance developers will ask you to build another kernel to perform
1991- additional tests. This is often required to debug an issue or check proposed
1992- fixes. Before doing so you want to run the ``git fetch mainline `` command again
1993- followed by ``git checkout mainline/master `` to bring your clone up to date and
1994- checkout the latest codebase. Then apply the patch using ``git apply
1995- <filename> `` or ``git am <filename> `` and build yet another kernel using the
1996- familiar commands.
2078+ Removing the repository as well would likely be unwise at this point: there
2079+ is a decent chance developers will ask you to build another kernel to
2080+ perform additional tests -- like testing a debug patch or a proposed fix.
2081+ Details on how to perform those can be found in the section :ref: `Optional
2082+ tasks: test reverts, patches, or later versions <introoptional_bissbs>`.
19972083
19982084Additional tests are also the reason why you want to keep the
19992085~/kernel-config-working file around for a few weeks.
20002086
20012087[:ref: `back to step-by-step guide <finishingtouch_bissbs >`]
20022088
2089+ .. _introoptional_bisref :
2090+
2091+ Test reverts, patches, or later versions
2092+ ----------------------------------------
2093+
2094+ *While or after reporting a bug, you might want or potentially will be asked
2095+ to test reverts, patches, proposed fixes, or other versions. *
2096+ [:ref: `... <introoptional_bissbs >`]
2097+
2098+ All the commands used in this section should be pretty straight forward, so
2099+ there is not much to add except one thing: when setting a kernel tag as
2100+ instructed, ensure it is not much longer than the one used in the example, as
2101+ problems will arise if the kernelrelease identifier exceeds 63 characters.
2102+
2103+ [:ref: `back to step-by-step guide <introoptional_bissbs >`].
2104+
20032105
20042106Additional reading material
20052107===========================
0 commit comments