You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. The kernel source that you will download from the Internet is a file that has been compressed and tarred. Therefore, you need to decompress and untar the source file to use the source.
@@ -186,7 +186,7 @@ But before beginning the actual kernel configuration, you should clean (prepare)
186
186
187
187
Next, we will step through the process of configuring a Linux 5.* series kernel. To explore some of the innards of this process, we will enable the support of a specific feature that we’ll pretend is a MUST have feature on the system. Once you understand how this works, you can apply the same procedure to add support for any new kernel feature you want. Specifically, we’ll enable support for the NTFS file system into our custom kernel.
188
188
189
-
Most modern Linux distros ship with a kernel configuration file for the running kernel available on the local file system as a compressed or regular file. On our sample Rocky system, this file resides in the /boot directory and is usually named something like config-4.*.
189
+
Most modern Linux distros ship with a kernel configuration file for the running kernel available on the local file system as a compressed or regular file. On our sample Rocky system, this file resides in the /boot directory and is usually named something like config-*.
190
190
191
191
The configuration file contains a list of the options and features that were enabled for the particular kernel it represents. A config file similar to this one is what we aim to create through the process of configuring the kernel. The only difference between the file we’ll create and the ready-made one is that we will add further minor customization to ours.
192
192
@@ -242,7 +242,7 @@ The following steps cover how to configure the kernel. We will be using a text-b
242
242
243
243
For each of the configurable options, in the kernel configuration utility, empty angle parentheses, <>, indicates that the feature in question is disabled. The letter M in angle parentheses, <M>, indicates that the feature is to be compiled as a module.
244
244
245
-
And the asterisk symbol in angle parentheses, <*>, indicates that support for the feature will be directly built into the kernel. You can usually toggle through all the possible options using the spacebar on your keyboard.
245
+
And the asterisk symbol in angle parentheses, <*>, indicates that support for the feature will be directly built into the kernel. You can usually toggle through all the possible options using the spacebar on your keyboard.
246
246
247
247
5. Navigate back to the parent File Systems screen by pressing the esc key twice on your keyboard in the DOS/FAT/NT Filesystems screen. Return to the main kernel configuration screen by pressing esc twice again on your keyboard.
248
248
@@ -267,6 +267,7 @@ The following steps cover how to configure the kernel. We will be using a text-b
267
267
CONFIG_NTFS_DEBUG=y
268
268
CONFIG_NTFS_RW=y
269
269
```
270
+
270
271
!!! NOTE "A Quick Note on Kernel Modules"
271
272
272
273
Loadable module support is a Linux kernel feature that allows kernel modules' dynamic loading (or removal).
@@ -316,19 +317,19 @@ We want to change the line in the file that looks like this:
316
317
317
318
You can take advantage of all that extra processing power (CPUs, cores and so on) on most modern systems and greatly speed up CPU-intensive operations like compiling the kernel. To do this, you can pass a parameter to the make command that specifies the number of jobs to run simultaneously. The specified number of jobs are then distributed and executed simultaneously on each CPU core. The syntax for the command is:
318
319
319
-
```
320
-
> make -j N
321
-
```
322
-
where N is the number of jobs to run simultaneously. For example, if you have a octa (8) core–capable CPU, you can type:
320
+
```
321
+
> make -j N
322
+
```
323
+
where N is the number of jobs to run simultaneously. For example, if you have a octa (8) core–capable CPU, you can type:
323
324
324
-
```
325
-
> make -j 8
326
-
```
325
+
```
326
+
> make -j 8
327
+
```
327
328
328
329
3. The only command that is needed here to compile the kernel is the make command:
@@ -355,11 +356,11 @@ We want to change the line in the file that looks like this:
355
356
> sudo make O=~/build/kernel modules_install
356
357
```
357
358
358
-
On our Rocky system, this command will install all the compiled kernel modules into the /lib/modules/<new_kernel-version> directory. In this example, this path will translate to /lib/modules/5.16.9-custom/. This is the path from which the kernel will load all loadable modules, as needed.
359
+
On our Rocky system, this command will install all the compiled kernel modules into the /lib/modules/<new_kernel-version> directory. In this example, this path will translate to /lib/modules/6.5.7-custom/. This is the path from which the kernel will load all loadable modules, as needed.
359
360
360
361
!!! TIP
361
362
362
-
The footprint (size) of the kernel modules installed via “make modules_install” can end up getting pretty large because the modules include debugging symbols. As a result, you could easily end up with a `/lib/modules/5.16.9-custom/` directory that is close to 5GB in size!
363
+
The footprint (size) of the kernel modules installed via “make modules_install” can end up getting pretty large because the modules include debugging symbols. As a result, you could easily end up with a `/lib/modules/6.5.7-custom/` directory that is close to 5GB in size!
363
364
364
365
For this guide we avoid this large size by including the INSTALL_MOD_STRIP=1 option in our make modules_install invocation. You can reduce the total size by orders of magnitude (For example - less than 200 MB!!) by stripping away these debugging symbols.
365
366
@@ -382,26 +383,26 @@ Let’s go through the steps required to install the new kernel image.
382
383
1. While in the root of your kernel build directory, copy and rename the bzImage file into the /boot directory:
Here, kernel-version is the version number of the kernel. For the sample kernel we are using in this guide, the filename would be vmlinuz-5.16.9-custom. So here’s the exact command for this example:
390
+
Here, kernel-version is the version number of the kernel. For the sample kernel we are using in this guide, the filename would be vmlinuz-6.5.7-custom. So here’s the exact command for this example:
390
391
391
392
```
392
393
> sudo cp ~/build/kernel/arch/x86/boot/bzImage \
393
-
/boot/vmlinuz-5.16.9-custom
394
+
/boot/vmlinuz-6.5.7-custom
394
395
```
395
396
396
397
!!! Note
397
398
398
-
The decision to name the kernel image vmlinuz-5.16.9-custom is somewhat arbitrary. It’s convenient, because kernel images are commonly referred to as vmlinuz, and the suffix of the version number is useful when you have multiple kernels available or kernels that provide specific functionality (For example vmlinuz-6.50.0-ws).
399
+
The decision to name the kernel image vmlinuz-6.5.7-custom is somewhat arbitrary. It’s convenient, because kernel images are commonly referred to as vmlinuz, and the suffix of the version number is useful when you have multiple kernels available or kernels that provide specific functionality (For example vmlinuz-6.50.0-ws).
399
400
400
401
2. Now that the kernel image is in place, copy over and rename the corresponding System.map file into the /boot directory using the same naming convention:
401
402
402
403
```
403
404
> sudo cp -v ~/build/kernel/System.map \
404
-
/boot/System.map-5.16.9-custom
405
+
/boot/System.map-6.5.7-custom
405
406
```
406
407
407
408
3. With the kernel in place, the System.map file in place, and the modules in place, we are now ready for the final step. The syntax for the command needed is:
@@ -416,7 +417,7 @@ Let’s go through the steps required to install the new kernel image.
416
417
417
418
```
418
419
> sudo kernel-install \
419
-
add 5.16.9-custom /boot/vmlinuz-5.16.9-custom
420
+
add 6.5.7-custom /boot/vmlinuz-6.5.7-custom
420
421
```
421
422
422
423
The kernel-install command used here is a nifty little shell script. It might not be available in every Linux distribution, but it is available in newer Fedora, RHEL, CentOS distros. This tool automates a lot of the final manual things we’d ordinarily have to do to set up the system to boot the new kernel we just built.
@@ -432,16 +433,16 @@ For systems running the newer versions of GRUB2, the file will be `/boot/grub2/g
432
433
433
434
And for systems running the legacy versions of GRUB, this will be the /boot/grub/grub.conf or /boot/grub/menu.lst file. And for very new distros that have implemented the new Boot Loader Specification (BLS) a new boot loader entry will be added to the /boot/loader/entries/ directory, or any directory pointed to by the variable named "blsdir".
434
435
435
-
On our demo EFI based Rocky server running GRUB 2 using BLS, a new boot entry is created in the boot loader file located here: `/boot/loader/entries/6fa25ca775f64accb0d3e53f0e4e6e92-5.16.9-custom.conf`
436
+
On our demo EFI based Rocky server running GRUB 2 using BLS, a new boot entry is created in the boot loader file located here: `/boot/loader/entries/6fa25ca775f64accb0d3e53f0e4e6e92-6.5.7-custom.conf`
title Rocky Linux (6.5.7-custom) 8.5 (Green Obsidian)
441
+
version 6.5.7-custom
442
+
linux /vmlinuz-6.5.7-custom
443
+
initrd /initramfs-6.5.7-custom.img $tuned_initrd
443
444
options $kernelopts $tuned_params
444
-
id rocky-20220212013135-5.16.9-custom
445
+
id rocky-20220212013135-6.5.7-custom
445
446
grub_users $grub_users
446
447
grub_arg --unrestricted
447
448
grub_class kernel
@@ -464,14 +465,14 @@ The next stage is to test the kernel to ensure the system can boot with it.
464
465
465
466
```
466
467
> uname -r
467
-
5.16.9-custom
468
+
6.5.7-custom
468
469
```
469
470
470
471
3. You will recall that one of the features that we added to our new kernel is the ability to support the NTFS file system. Make sure that the new kernel does indeed have support for NTFS by displaying information about the NTFS module:
0 commit comments