Compiling and Installing the Kernel
- Compile the kernel.
1 2
cd /usr/src/kernels/kernel-5.10.0-136.12.0 make -j64
If the following information is displayed during the compilation, ensure that the server system time is the current time.
1make[2]: warning: Clock skew detected. Your build may be incomplete.
Run the tzselect command. Enter the numbers corresponding to your time zone in sequence. After the command is executed, copy the file to /etc/localtime.
1 2
tzselect cp -f /usr/share/zoneinfo/Asia/Beijing /etc/localtime
- Check whether the kernel is compiled successfully.
Check whether vmlinux files are generated in the compilation path. If vmlinux files are generated, the compilation is successful. You can proceed to the next step. If not, check whether an error is reported during compilation, rectify the fault, and perform 1 again.
1ll vmlinux*If information similar to the following is displayed, the compilation is successful:
1 2 3
-rwxr-xr-x 1 root root 363795992 Nov 17 20:00 vmlinux* -rw-r--r-- 1 root root 892957960 Nov 17 20:00 vmlinux.o -rw-r--r-- 1 root root 613485 Nov 17 20:00 vmlinux.symvers
- Install the kernel modules.
1make modules_install - Install the kernel.
1make install
- Before installing the kernel, ensure that dkms is not installed in the system. Otherwise, the error message "Error! Bad return status for module build on kernel: ..." may be displayed during kernel installation. The solution is as follows:
- Check whether dkms is installed in the system.
yum list installed | grep dkms
If a command output is displayed, dkms has been installed.
- Remove dkms.
1yum remove -y dkms
- Reinstall the kernel.
1make install
- Check whether dkms is installed in the system.
- During kernel installation, the following error message may be displayed. In this case, you need to run the make install command again.
1 2
dracut-install: Failed to find module 'uds' /lib/modules/5.10.0/kernel/drivers/block/uds.ko dracut-install: Failed to find module 'kvdo' /lib/modules/5.10.0/kernel/drivers/block/kvdo.ko
- Before installing the kernel, ensure that dkms is not installed in the system. Otherwise, the error message "Error! Bad return status for module build on kernel: ..." may be displayed during kernel installation. The solution is as follows:
- Update the boot items.
1grub2-mkconfig -o /boot/efi/EFI/openEuler/grub.cfg
- For openEuler 22.03 LTS SP1 and kernel 5.10.0-136.12.0, set the kernel boot item to openEuler (5.10.0) 22.03 (LTS-SP1).
- For openEuler 22.03 LTS SP3 and kernel 5.10.0-182.0.0, set the kernel boot item to openEuler (5.10.0) 22.03 (LTS-SP3).
Set the boot kernel, for example, to openEuler (5.10.0) 22.03 (LTS-SP1).
1grub2-set-default 'openEuler (5.10.0) 22.03 (LTS-SP1)'
Reboot the OS for the new kernel to take effect.
1reboot
- Check the version of the new kernel. If the version is 5.10.0, the correct kernel is installed.
1uname -r
If the new kernel cannot be accessed after the reboot, select the new kernel to access the system after the BIOS enters the grub boot mode, or contact technical support.