Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling and Installing the Kernel

  1. Compile the kernel.
    # cd /usr/src/kernels/kernel-5.10.0-60.18.0
    # sudo make ARCH=arm64 -j64

    If the following information is displayed during the compilation, ensure that the server system time is the latest time:

    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
    # sudo cp -f /usr/share/zoneinfo/Asia/Beijing /etc/localtime
    
  2. Check whether the kernel is compiled successfully.

    Check whether a vmlinux file is generated in the compilation path. If a vmlinux file is 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
    2
    3
    4
    # ll vmlinux*
    -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. Compile kernel modules.
    1
    # sudo make ARCH=arm64 modules -j64
    
  4. Install the kernel modules.
    1
    # sudo make ARCH=arm64 modules_install
    
  5. Install the kernel.
    1
    # sudo make ARCH=arm64 install
    

    After sudo make ARCH=arm64 install is executed, an error may be reported, as shown in the following figure. In this case, you need to run sudo make ARCH=arm64 install again.

  6. Update the boot items.
    # sudo grub2-mkconfig -o /boot/grub2/grub.cfg

    Restart the OS for the new kernel to take effect.

    1
    # sudo reboot
    
  7. Check the version of the new kernel. If the version is 5.10.0, the correct kernel is imported.
    # uname -a
    Linux localhost.localdomain 5.10.0 #15 SMP Thu Nov 17 20:00:25 CST 2022 aarch64 aarch64 aarch64 GNU/Linux

    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.