Here's a detailed guide on common post-installation procedures for your newly compiled kernel on Red Hat Enterprise Linux (RHEL) 9.4, focusing on ensuring that your modules are correctly accessible through a ramdisk:
Post-Installation Procedures for New Kernel
-
Verify Kernel Installation
-
Check Kernel Version:
uname -r
This should still show the old kernel version since you haven't rebooted yet.
-
List Available Kernels:
ls /boot/vmlinuz*
Confirm your new kernel's vmlinuz file is listed.
-
Module Verification
-
Ramdisk (Initramfs) Generation
-
Grub2 Configuration
-
Boot Loader Setup
-
Pre-Reboot Checks
-
Final Reboot
-
Reboot System:
reboot
This will reboot your system, and it should boot into the new kernel.
-
Post-Reboot Verification
-
Check Kernel and Modules:
Ensure the system is running the new kernel and verify module loading:
lsmod
-
Check Boot Logs:
Review `/var/log/dmesg` or `journalctl -b -k` for any issues during boot.
By following these steps, you ensure that the new kernel, along with its modules, is correctly integrated into the boot process. If there are any specific modules you've compiled, ensure they're included in the `modules.dep` file or explicitly specified during initramfs generation if necessary. If you encounter any errors during boot, you might need to troubleshoot by checking logs or possibly rebuilding the initramfs with specific modules included.
With both the kernel and modules built and installed, you are ready to let the system use the new kernel.
However, until you reboot you are still using the old kernel, so now is the time to make sure you have done everything correctly.
If you implemented certain kernel components as modules, specifically those required at boot time, you will need to provide access to them through a
ramdisk.
[1]
The ramdisk holds an image of the modules, and the kernel loads that image into memory before any other components.
However, ramdisks store their data in random access memory, as opposed to on disk. This is useful during installation.
The
mkinitrd
command will examine a given kernel's module library, intelligently select any modules that might be needed at boot time (usually SCSI drivers or software RAID modules),
create a ramdisk image, and pack the modules into the ramdisk.
The
mkinitrd
command takes two arguments: the first is the ramdisk filename to manufacture and the second is the kernel version for which the ramdisk is relevant.
The ramdisk should be stored in a location accessible at boot, namely the
/boot
directory.
To create a ramdisk, named
initrd-2.2.14.img
and stored in
/boot
, use:
mkinitrd /boot/initrd-2.2.14.img 2.2.14
When the system reboots, the kernel notices you have a ramdisk for the new kernels version.
It then loads the images in that file and continues to boot.
There are no restrictions on what to name the initial ramdisk image, but meticulous naming helps in the long run.
As a precaution, you might want to move your kernel configuration to the
/boot
partition.
Though this is not required, moving your configuration could save you from future configuration problems.
Essentially, you put the kernel configuration in the same location as the kernel, so you can always recreate that kernel from the configuration file.
Simply copy your Linux kernel configuration file into the
/boot
directory and name it appropriately:
The next lesson describes the LILO map installer.
cp /usr/src/linux/.config /boot/config-2.2.14