Skip to content

Commit 704e92b

Browse files
authored
ssh section fixes (#1538)
merge commit kernel lab
1 parent 847ebf9 commit 704e92b

15 files changed

+417
-34
lines changed

docs/guides/custom-linux-kernel.md

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,17 @@ That’s it for the prerequisite packages needed for actual Kernel building!
100100
101101
## Downloading and unpacking the Linux Kernel
102102
103-
The version of the kernel that we are going to build in the following section is version 5.16.9, which is available at:
103+
The version of the kernel that we are going to build in the following section is version 6.5.7, which is available at:
104104
105-
[www.kernel.org/pub/linux/kernel/v5.x/linux-5.16.9.tar.xz](https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.16.9.tar.xz)
105+
[www.kernel.org/pub/linux/kernel/v6.x/linux-6.5.7.tar.xz](https://www.kernel.org/pub/linux/kernel/v6.x/linux-6.5.7.tar.xz)
106106
107107
Let’s begin the process.
108108
109109
1. First, download the kernel source into your current working directory using the following curl command. Type:
110110
111111
```
112-
curl -L -o linux-5.16.9.tar.xz \
113-
https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.16.9.tar.xz
112+
curl -L -o linux-6.5.7.tar.xz \
113+
https://www.kernel.org/pub/linux/kernel/v6.x/linux-6.5.7.tar.xz
114114
```
115115
116116
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)
186186
187187
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.
188188
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-*.
190190
191191
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.
192192
@@ -242,7 +242,7 @@ The following steps cover how to configure the kernel. We will be using a text-b
242242
243243
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.
244244
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.
246246
247247
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.
248248
@@ -267,6 +267,7 @@ The following steps cover how to configure the kernel. We will be using a text-b
267267
CONFIG_NTFS_DEBUG=y
268268
CONFIG_NTFS_RW=y
269269
```
270+
270271
!!! NOTE "A Quick Note on Kernel Modules"
271272
272273
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:
316317
317318
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:
318319
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:
323324
324-
```
325-
> make -j 8
326-
```
325+
```
326+
> make -j 8
327+
```
327328
328329
3. The only command that is needed here to compile the kernel is the make command:
329330
330331
```
331-
> make O=~/build/kernel**
332+
> make O=~/build/kernel
332333
make[1]: Entering directory '/home/super/build/kernel'
333334
SYNC include/config/auto.conf.cmd
334335
GEN Makefile
@@ -355,11 +356,11 @@ We want to change the line in the file that looks like this:
355356
> sudo make O=~/build/kernel modules_install
356357
```
357358
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.
359360
360361
!!! TIP
361362
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!
363364
364365
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.
365366
@@ -382,26 +383,26 @@ Let’s go through the steps required to install the new kernel image.
382383
1. While in the root of your kernel build directory, copy and rename the bzImage file into the /boot directory:
383384
384385
```
385-
> **sudo cp ~/build/kernel/arch/x86/boot/bzImage \
386-
/boot/vmlinuz-<kernel-version>**
386+
> sudo cp ~/build/kernel/arch/x86/boot/bzImage \
387+
/boot/vmlinuz-<kernel-version>
387388
```
388389
389-
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:
390391
391392
```
392393
> sudo cp ~/build/kernel/arch/x86/boot/bzImage \
393-
/boot/vmlinuz-5.16.9-custom
394+
/boot/vmlinuz-6.5.7-custom
394395
```
395396
396397
!!! Note
397398
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).
399400
400401
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:
401402
402403
```
403404
> sudo cp -v ~/build/kernel/System.map \
404-
/boot/System.map-5.16.9-custom
405+
/boot/System.map-6.5.7-custom
405406
```
406407
407408
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.
416417
417418
```
418419
> 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
420421
```
421422
422423
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
432433
433434
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".
434435
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`
436437
437438
```
438-
> sudo cat /boot/loader/entries/6fa25ca775f64accb0d3e53f0e4e6e92-5.16.9-custom.conf
439-
title Rocky Linux (5.16.9-custom) 8.5 (Green Obsidian)
440-
version 5.16.9-custom
441-
linux /vmlinuz-5.16.9-custom
442-
initrd /initramfs-5.16.9-custom.img $tuned_initrd
439+
> sudo cat /boot/loader/entries/6fa25ca775f64accb0d3e53f0e4e6e92-6.5.7-custom.conf
440+
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
443444
options $kernelopts $tuned_params
444-
id rocky-20220212013135-5.16.9-custom
445+
id rocky-20220212013135-6.5.7-custom
445446
grub_users $grub_users
446447
grub_arg --unrestricted
447448
grub_class kernel
@@ -464,14 +465,14 @@ The next stage is to test the kernel to ensure the system can boot with it.
464465
465466
```
466467
> uname -r
467-
5.16.9-custom
468+
6.5.7-custom
468469
```
469470
470471
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:
471472
472473
```
473474
[rockstar ~]$ modinfo ntfs
474-
filename: /lib/modules/5.16.9-custom/kernel/fs/ntfs/ntfs.ko
475+
filename: /lib/modules/6.5.7-custom/kernel/fs/ntfs/ntfs.ko
475476
license: GPL
476477
version: 2.1.32
477478
description: NTFS 1.2/3.x driver - Copyright …..

docs/labs/.pages

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
nav:
33
- ... | index*.md
4-
- System Administration I Labs: sys_admin_1
5-
- System Administration II Labs: sys_admin_II
4+
- System Administration I Labs: system_administration_I
5+
- System Administration II Labs: system_administration_II
66
- Security Labs: security
77

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)