我要评分
获取效率
正确性
完整性
易理解

Modifying the Kernel Module

In the DaoCloud DC1000 hardware environment, the host kernel needs to be adapted for driver installation on the VM. Obtain the kernel source code in advance.

  1. Obtain the kernel source code. See Table 4.
  2. Decompress the kernel source code and go to the root directory.
    unzip kernel-6.6.0-72.0.0.zip
    cd kernel-6.6.0-72.0.0
  3. Suppress the local version number.
    1
    touch .scmversion
    
  4. Obtain the kernel patch file general.patch according to Software Requirements.
  5. Apply the patch in the kernel source code directory kernel-6.6.0-72.0.0.
    patch -p1 < general.patch
  6. Generate a .config file in the source code directory.
    cp /boot/config-`uname -r` .config
    make menuconfig
  7. On the displayed configuration page, select Load.

  8. Select OK in the following page:

  9. On the kernel configuration interface, configure the kernel compilation options listed in Table 1.
    Table 1 Kernel compilation options

    Option

    Required Value

    LOCALVERSION

    -patched-vm

    DEBUG_INFO_BTF

    N

    SYSTEM_TRUSTED_KEYS

    Clear the content.

    The configuration result should be:

    ( ) Additional X.509 keys for default system keyring

    Configuration methods:

    • Press / for search.
    • Press Y to compile the selected item into the kernel. The corresponding item is displayed as [*].
    • Press N to exclude the selected item. The corresponding item is displayed as [].
    • Press M to compile the selected item into a module (in KO format). The corresponding item is displayed as <M>.
    • Press Enter to edit the selected item.
    • Press the corresponding number to select a search result.
    • After the modification is complete, select <Save> to save the modification.
    • After saving the modification, select <Exit> to exit.
  10. Install dependencies and enable the LXCFS service. If you need to divide the command into multiple lines, add a backslash (\) at the end of each line.
    yum install -y dwarves dpkg dpkg-devel openssl openssl-devel ncurses ncurses-devel bison flex bc libdrm build elfutils-libelf-devel docker lxc lxcfs lxcfs-tools git tar patch make gcc
    systemctl start lxcfs
    systemctl enable lxcfs

  11. Compile the kernel code.
    make -j72
  12. Install the new kernel.
    make modules_install 
    make install
  13. Set the boot kernel.
    grub2-set-default 'openEuler (6.6.0-patched-vm) 24.03 (LTS-SP1)'
  14. Reboot the server.
    reboot
  15. After the reboot, confirm that the kernel is switched to 6.6.0-patched-vm.
    uname -r