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

Preparations

The Kbox cloud phone container supports kernel source code compilation on openEuler 22.03 LTS SP4 (kernel version 5.10.0-216.0.0). Before the compilation, configure the network environment, software repository, and system time of the server for downloading the related compilation dependencies.

  • The kernel configurations and modifications in this section are for functional reference only. It is not recommended that the Kunpeng BoostKit for Cloud Phone demos be used in commercial solutions. Customers or ISVs must perform necessary security assessment before commercial use. Using the Kunpeng BoostKit for Cloud Phone demos implies the user's acceptance of all associated security risks.

During the compilation, use the root user to log in and perform operations.

  1. Disable the warning your kernel does not support swap memory limit... and add cgroup_enable=memory swapaccount=1 to the end of the GRUB_CMDLINE_LINUX configuration item in the /etc/default/grub file.
    1. Check the current configuration.
      1
      cat /etc/default/grub | grep "cgroup_enable=memory swapaccount=1"
      
    2. If the command output is empty, run the following command to configure the kernel boot items:
      1
      sed -i '/GRUB_CMDLINE_LINUX/s/\"$//' /etc/default/grub; sed -i '/GRUB_CMDLINE_LINUX/s/$/ cgroup_enable=memory swapaccount=1\"/' /etc/default/grub
      
    3. Check the modification result.
      1
      cat /etc/default/grub | grep "GRUB_CMDLINE_LINUX"
      

      The following is a command output example. It is normal if there are other fixed parameters.

      1
      GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
      
    4. Update the GRUB configuration file.
      1
      grub2-mkconfig -o /boot/efi/EFI/openEuler/grub.cfg
      

    The configuration takes effect after the system is restarted. You can restart the system after operations in Compiling and Installing the Kernel are completed to make all settings take effect.

  2. Disable SELinux.
    1. Configure SELinux.
      1
      sed -i "s|^SELINUX=.*|SELINUX=disabled|g" /etc/selinux/config
      
    2. Check the modification result.
      1
      cat /etc/selinux/config | grep "^SELINUX="
      

      Ensure that the command output is as follows:

      1
      SELINUX=disabled
      
    • If there is no /etc/selinux/config file, run the following command to create a file and write the SELinux rule into the file:
      1
      echo "SELINUX=disabled" > /etc/selinux/config
      
    • The configuration takes effect after the system is restarted. You can restart the system after operations in Compiling and Installing the Kernel are completed to make all settings take effect.
  3. When multiple Kbox containers are started, the file access workload is heavy on the host. In this case, adjust the maximum number of inotify instances that can be created.
    1. Check the current configuration.
      1
      cat /etc/sysctl.conf | grep "fs.inotify.max_user_instances=8192"
      
    2. If the command output is empty, run the following command to configure the maximum number of inotify instances:
      1
      echo "fs.inotify.max_user_instances=8192" >> /etc/sysctl.conf
      
    3. Check the modification result.
      1
      cat /etc/sysctl.conf | grep "fs.inotify.max_user_instances"
      

      Ensure that the command output is as follows:

      1
      fs.inotify.max_user_instances=8192
      
    4. Make the modification take effect.
      1
      sysctl -p
      
  4. Install base dependencies.
    1
    yum install -y make dpkg dpkg-devel openssl openssl-devel ncurses ncurses-devel bison flex bc libdrm build elfutils-libelf-devel patch gcc dwarves
    

    If a package fails to be obtained during the installation, you are advised to manually obtain its installation package based on the address displayed in the message and install it. After the installation is successful, continue to install the remaining dependency packages.

  5. Install Docker and lxcfs. If Docker and lxcfs have been installed, skip this step.

    Run the following commands to install Docker and lxcfs, start the lxcfs service, and set the lxcfs service to automatically start upon system startup:

    1
    2
    yum install -y docker lxc lxcfs lxcfs-tools 
    systemctl start lxcfs && systemctl enable lxcfs
    

    If an error is reported during lxcfs startup, restart the service or contact technical support.

  6. (Hardware configuration scheme 1) Upgrade the Linux firmware if you use configuration scheme 1. If the firmware has been upgraded, skip this step.

    Download the linux-firmware-20210919.tar.gz package using the link provided in Software Environment.

    Upload the installation package to the server, for example, to the /root directory on the server, and decompress the package.
    1
    cd ~ && tar -xvpf linux-firmware-20210919.tar.gz
    
    After the decompression, the linux-firmware-20210919 folder is generated in the root directory. Copy the firmware file to the standard Linux firmware directory.
    1
    cp -ar linux-firmware-20210919/*gpu /usr/lib/firmware/