Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling and Installing the Kernel

  1. Compile the kernel.
    1
    2
    cd /usr/src/linux-kernel-5.15.98/
    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->China->Beijing Time->YES. After the command is executed, copy the file to /etc/localtime.

    1
    2
    tzselect
    cp /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 42919136 Mar 22 03:31 vmlinux*
    -rw-r--r-- 1 root root 64101280 Mar 22 03:30 vmlinux.o
    -rw-r--r-- 1 root root   678152 Mar 22 03:30 vmlinux.symvers
    
  3. Install the kernel modules.
    1
    make modules_install
    
  4. Install the kernel.
    1
    make install
    
  5. Update the boot items.
    1
    update-grub2
    

    Restart the OS for the new kernel to take effect.

    A reboot is required when installing the encoding card driver. You can reboot the OS and check the kernel version after installing the encoding card driver.

    1
    reboot
    
  6. Check the new kernel version.
    1
    uname -a
    

    If the displayed version is 5.15.98 (as shown in the following output), the installation is successful.

    1
    Linux ubuntu 5.15.98 #2 SMP Wed Mar 22 03:30:54 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux