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