Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: verify/bisect: fixes, finetuning, and support for Arch

Assorted changes for the recently added document.

Improvements:

* Add instructions for installing required software on Arch Linux.

Fixes:

* Move a 'git remote add -t master stable [...]' from a totally wrong
to the right place.

* Fix two anchors.

* Add two required packages to the openSUSE install instructions.

Fine tuning:

* Improve the reference section about downloading Linux mainline sources
to make it more obvious that those are alternatives.

* Include the full instructions for git bundles to ensure the remote
gets the right name; that way the text also works stand alone.

* Install ncurses and qt headers for use of menuconfig and xconfig by
default, but tell users that they are free to omit them.

* Mention ahead of time which version number are meant as example in
commands used during the step-by-step guide.

* Mention that 'kernel-install remove' might do a incomplete job.

Signed-off-by: Thorsten Leemhuis <linux@leemhuis.info>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <6592c9ef4244faa484b4113f088dbc1beca61015.1709716794.git.linux@leemhuis.info>

authored by

Thorsten Leemhuis and committed by
Jonathan Corbet
0c8e9b53 a304fa1d

+84 -51
+84 -51
Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
··· 192 192 193 193 sudo rm -rf /lib/modules/6.0-rc1-local-gcafec0cacaca0 194 194 sudo kernel-install -v remove 6.0-rc1-local-gcafec0cacaca0 195 - # * Note, if kernel-install is missing, you will have to 196 - # manually remove the kernel image and related files. 195 + # * Note, on some distributions kernel-install is missing 196 + # or does only part of the job. 197 197 198 198 b) If you performed a bisection and successfully validated the result, feel 199 199 free to remove all kernels built during the actual bisection (Segment 3 c); ··· 348 348 one downloads less than 500 MByte, the other works better with unreliable 349 349 internet connections.* 350 350 351 - Execute the following command to retrieve a fresh mainline codebase:: 351 + Execute the following command to retrieve a fresh mainline codebase while 352 + preparing things to add stable/longterm branches later:: 352 353 353 354 git clone -o mainline --no-checkout \ 354 355 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ~/linux/ 355 356 cd ~/linux/ 357 + git remote add -t master stable \ 358 + https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git 356 359 357 360 [:ref:`details<sources_bisref>`] 358 361 ··· 368 365 identifier using ``uname -r``. 369 366 370 367 Afterwards check out the source code for the version earlier established as 371 - 'good' and create a .config file:: 368 + 'good' (in this example this is assumed to be 6.0) and create a .config file:: 372 369 373 370 git checkout --detach v6.0 374 371 make olddefconfig ··· 465 462 466 463 [:ref:`details<configmods_distros_bisref>`]. 467 464 468 - * If you want to influence other aspects of the configuration, do so now 469 - by using make targets like 'menuconfig' or 'xconfig'. 465 + * If you want to influence other aspects of the configuration, do so now using 466 + your preferred tool. Note, to use make targets like 'menuconfig' or 467 + 'nconfig', you will need to install the development files of ncurses; for 468 + 'xconfig' you likewise need the Qt5 or Qt6 headers. 470 469 471 470 [:ref:`details<configmods_individual_bisref>`]. 472 471 ··· 606 601 * Are you facing a problem within a stable/longterm release, but failed to 607 602 reproduce it with the mainline kernel you just built? Then check if the latest 608 603 codebase for the particular series might already fix the problem. To do so, 609 - add the stable series Git branch for your 'good' kernel and check out the 610 - latest version:: 604 + add the stable series Git branch for your 'good' kernel (again, this here is 605 + assumed to be 6.0) and check out the latest version:: 611 606 612 607 cd ~/linux/ 613 608 git remote set-branches --add stable linux-6.0.y ··· 657 652 regressed works as expected with it. 658 653 659 654 Start by checking out the sources for the version earlier established as 660 - 'good':: 655 + 'good' (once again assumed to be 6.0 here):: 661 656 662 657 cd ~/linux/ 663 658 git checkout --detach v6.0 ··· 702 697 stable branch, unless you already did so earlier:: 703 698 704 699 cd ~/linux/ 705 - git remote add -t master stable \ 706 - https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable.git 707 700 git remote set-branches --add stable linux-6.1.y 708 701 git fetch stable 709 702 710 703 .. _bisectstart_bissbs: 711 704 712 705 * Start the bisection and tell Git about the versions earlier established as 713 - 'good' and 'bad':: 706 + 'good' (6.0 in the following example command) and 'bad' (6.1.5):: 714 707 715 708 cd ~/linux/ 716 709 git bisect start ··· 887 884 888 885 On quite a few distributions this will delete all other kernel files installed 889 886 while also removing the kernel's entry from the boot menu. But on some 890 - distributions this command does not exist or will fail; in that case consult 891 - the reference section, as your Linux distribution needs special care. 887 + distributions kernel-install does not exist or leaves boot-loader entries or 888 + kernel image and related files behind; in that case remove them as described 889 + in the reference section. 892 890 893 891 [:ref:`details<makeroom_bisref>`] 894 892 ··· 1019 1015 1020 1016 [:ref:`back to step-by-step guide <bootworking_bissbs>`] 1021 1017 1022 - .. _buildrequires_bisref: 1023 - 1024 1018 .. _diskspace_bisref: 1025 1019 1026 1020 Space requirements ··· 1062 1060 1063 1061 [:ref:`back to step-by-step guide <rangecheck_bissbs>`] 1064 1062 1065 - .. _sources_bisref: 1063 + .. _buildrequires_bisref: 1066 1064 1067 1065 Install build requirements 1068 1066 -------------------------- ··· 1078 1076 Here are a few examples what you typically need on some mainstream 1079 1077 distributions: 1080 1078 1079 + * Arch Linux and derivatives:: 1080 + 1081 + sudo pacman --needed -S bc binutils bison flex gcc git kmod libelf openssl \ 1082 + pahole perl zlib ncurses qt6-base 1083 + 1081 1084 * Debian, Ubuntu, and derivatives:: 1082 1085 1083 - sudo apt install bc binutils bison dwarves flex gcc git make openssl \ 1084 - pahole perl-base libssl-dev libelf-dev 1086 + sudo apt install bc binutils bison dwarves flex gcc git kmod libelf-dev \ 1087 + libssl-dev make openssl pahole perl-base pkg-config zlib1g-dev \ 1088 + libncurses-dev qt6-base-dev g++ 1085 1089 1086 1090 * Fedora and derivatives:: 1087 1091 1088 - sudo dnf install binutils /usr/include/{libelf.h,openssl/pkcs7.h} \ 1089 - /usr/bin/{bc,bison,flex,gcc,git,openssl,make,perl,pahole} 1092 + sudo dnf install binutils \ 1093 + /usr/bin/{bc,bison,flex,gcc,git,openssl,make,perl,pahole,rpmbuild} \ 1094 + /usr/include/{libelf.h,openssl/pkcs7.h,zlib.h,ncurses.h,qt6/QtGui/QAction} 1090 1095 1091 1096 * openSUSE and derivatives:: 1092 1097 1093 - sudo zypper install bc binutils bison dwarves flex gcc git make perl-base \ 1094 - openssl openssl-devel libelf-dev 1098 + sudo zypper install bc binutils bison dwarves flex gcc git \ 1099 + kernel-install-tools libelf-devel make modutils openssl openssl-devel \ 1100 + perl-base zlib-devel rpm-build ncurses-devel qt6-base-devel 1095 1101 1096 - In case you wonder why these lists include openssl and its development headers: 1097 - they are needed for the Secure Boot support, which many distributions enable in 1098 - their kernel configuration for x86 machines. 1099 - 1100 - Sometimes you will need tools for compression formats like bzip2, gzip, lz4, 1101 - lzma, lzo, xz, or zstd as well. 1102 - 1103 - In case you want to adjust the build configuration with make targets like 1104 - 'menuconfig' or 'xconfig' later, ensure to also install development headers for 1105 - ncurses and Qt5. 1102 + These commands install a few packages that are often, but not always needed. You 1103 + for example might want to skip installing the development headers for ncurses, 1104 + which you will only need in case you later might want to adjust the kernel build 1105 + configuration using make the targets 'menuconfig' or 'nconfig'; likewise omit 1106 + the headers of Qt6 is you do not plan to adjust the .config using 'xconfig'. 1106 1107 1107 1108 You furthermore might need additional libraries and their development headers 1108 - for tasks not covered in this guide. For example, zlib will be needed when 1109 - building kernel tools from the tools/ directory;. 1109 + for tasks not covered in this guide -- for example when building utilities from 1110 + the kernel's tools/ directory. 1110 1111 1111 1112 [:ref:`back to step-by-step guide <buildrequires_bissbs>`] 1112 1113 1113 - Download the sources using git 1114 + .. _sources_bisref: 1115 + 1116 + Download the sources using Git 1114 1117 ------------------------------ 1115 1118 1116 1119 *Retrieve the Linux mainline sources.* 1117 1120 [:ref:`...<sources_bissbs>`] 1118 1121 1119 - The step-by-step guide outlines how to retrieve the Linux sources using a full 1120 - Git clone of Linus' mainline repository. If you have an unreliable internet 1121 - connection, you instead might want to use a 'Git bundle' to retrieve the 1122 - sources; if downloading the complete repository would take too long or requires 1123 - too much storage space, use a shallow clone instead. 1122 + The step-by-step guide outlines how to download the Linux sources using a full 1123 + Git clone of Linus' mainline repository. There is nothing more to say about 1124 + that -- but there are two alternatives ways to retrieve the sources that might 1125 + work better for you: 1124 1126 1125 - Downloading Linux mainline using a bundle 1126 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1127 + * If you have an unreliable internet connection, consider 1128 + :ref:`using a 'Git bundle'<sources_bundle_bisref>`. 1127 1129 1128 - Switch to you home directory and follow the instructions `kernel.org provides 1129 - for this case <https://www.kernel.org/cloning-linux-from-a-bundle.html>`_. 1130 + * If downloading the complete repository would take too long or requires too 1131 + much storage space, consider :ref:`using a 'shallow 1132 + clone'<sources_shallow_bisref>`. 1130 1133 1131 - Afterwards add the stable Git repository as remote and all required 1132 - stable/branches as explained in the step-by-step guide. 1134 + .. _sources_bundle_bisref: 1133 1135 1134 - Downloading Linux mainline using a shallow clone 1135 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1136 + Downloading Linux mainline sources using a bundle 1137 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1138 + 1139 + Use the following commands to retrieve the Linux mainline sources using a 1140 + bundle:: 1141 + 1142 + wget -c \ 1143 + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/clone.bundle 1144 + git clone --no-checkout clone.bundle ~/linux/ 1145 + cd ~/linux/ 1146 + git remote remove origin 1147 + git remote add mainline \ 1148 + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1149 + git fetch mainline 1150 + git remote add -t master stable \ 1151 + https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git 1152 + 1153 + In case the 'wget' command fails, just re-execute it, it will pick up where 1154 + it left off. 1155 + 1156 + [:ref:`back to step-by-step guide <sources_bissbs>`] 1157 + [:ref:`back to section intro <sources_bisref>`] 1158 + 1159 + .. _sources_shallow_bisref: 1160 + 1161 + Downloading Linux mainline sources using a shallow clone 1162 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1136 1163 1137 1164 First, execute the following command to retrieve the latest mainline codebase:: 1138 1165 1139 1166 git clone -o mainline --no-checkout --depth 1 -b master \ 1140 1167 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ~/linux/ 1141 1168 cd ~/linux/ 1169 + git remote add -t master stable \ 1170 + https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git 1142 1171 1143 1172 Now deepen your clone's history to the second predecessor of the mainline 1144 1173 release of your 'good' version. In case the latter are 6.0 or 6.0.11, 5.19 would 1145 1174 be the first predecessor and 5.18 the second -- hence deepen the history up to 1146 - the latter:: 1175 + that version:: 1147 1176 1148 1177 git fetch --shallow-exclude=v5.18 mainline 1149 1178 ··· 1183 1150 1184 1151 Note, shallow clones have a few peculiar characteristics: 1185 1152 1186 - * For bisections the history needs to be deepend a few mainline versions 1153 + * For bisections the history needs to be deepened a few mainline versions 1187 1154 farther than it seems necessary, as explained above already. That's because 1188 1155 Git otherwise will be unable to revert or describe most of the commits within 1189 1156 a range (say v6.1..v6.2), as they are internally based on earlier kernels