Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling and Installing the Kernel

  1. Compile the kernel.
    1
    2
    cd /usr/src/kernels/kernel-5.10.0-153.12.0
    make -j64
    

    If the following information is displayed during the compilation, ensure that the server system time is the current time.

    1
    make[2]: warning:  Clock skew detected.  Your build may be incomplete.
    

    Run the tzselect command and enter the numbers corresponding to the following options in sequence: Asia->Beijing->YES. After the command is executed, copy the file to /etc/localtime.

    1
    2
    tzselect
    cp -f /usr/share/zoneinfo/Asia/Beijing /etc/localtime
    
  2. 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.

    1
    ll vmlinux*
    

    If 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
    
  3. Install the kernel modules.
    1
    make modules_install
    
  4. Install the kernel.
    1
    make install
    

    After make install is executed, an error may be reported, as shown in the following figure. In this case, you need to run make install 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
    
  5. Update the boot items.
    1
    grub2-mkconfig -o /boot/efi/EFI/openEuler/grub.cfg
    

    Set the boot kernel to openEuler (5.10.0) 22.03 LTS.

    1
    grub2-set-default 'openEuler (5.10.0) 22.03 LTS'
    

    Restart the OS for the new kernel to take effect.

    1
    reboot
    
  6. Check the version of the new kernel. If the version is 5.10.0, the correct kernel is installed.
    uname -r

    If the new kernel cannot be accessed after the restart, select the new kernel to access the system after the BIOS enters the grub boot mode, or contact technical support.