Preparations
The Kbox cloud phone container supports kernel source code compilation on openEuler 24.03 LTS SP1 (kernel version 6.6.0-72.0.0). Before the compilation, configure the network environment and software repository of the server, and synchronize the server system time to download compilation dependencies.
- The kernel configurations and modifications in the "Compiling the Kernel" 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. Use of the Kunpeng BoostKit for Cloud Phone demos implies the user's acceptance of all associated security risks.
- For details about how to install openEuler, see the official openEuler document.
During the compilation, use the root user to log in and perform operations.
- Disable the warning "your kernel does not support swap memory limit..." and enable cgroup v2.Modify the /etc/default/grub file by adding parameters cgroup_enable=memory swapaccount=1 systemd.unified_cgroup_hierarchy=1 to the end of the GRUB_CMDLINE_LINUX configuration item.
- Check the current configuration.
1cat /etc/default/grub | grep "cgroup_enable=memory swapaccount=1 systemd.unified_cgroup_hierarchy=1"
- If the command output is empty, run the following command to configure the kernel boot items:
1sed -i '/GRUB_CMDLINE_LINUX/s/\"$//' /etc/default/grub; sed -i '/GRUB_CMDLINE_LINUX/s/$/ cgroup_enable=memory swapaccount=1 systemd.unified_cgroup_hierarchy=1\"/' /etc/default/grub
- Check the modification result.
1cat /etc/default/grub | grep "GRUB_CMDLINE_LINUX"
The following is a command output example. It is normal if there are other fixed parameters.
1GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1 systemd.unified_cgroup_hierarchy=1"
- Update the grub configuration file.
1grub2-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.
- Check the current configuration.
- Disable SELinux.
- Configure SELinux.
1sed -i "s|^SELINUX=.*|SELINUX=disabled|g" /etc/selinux/config
- Check the modification result.
1cat /etc/selinux/config | grep "^SELINUX="
Ensure that the command output is as follows:
1SELINUX=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:
1echo "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.
- Configure SELinux.
- 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.
- Check the current configuration.
1cat /etc/sysctl.conf | grep "fs.inotify.max_user_instances=8192"
- If the command output is empty, run the following command to configure the maximum number of inotify instances:
1echo "fs.inotify.max_user_instances=8192" >> /etc/sysctl.conf
- Check the modification result.
1cat /etc/sysctl.conf | grep "fs.inotify.max_user_instances"
Ensure that the command output is as follows:
1fs.inotify.max_user_instances=8192
- Make the modification take effect.
1sysctl -p
- Check the current configuration.
- Install base dependencies.
1yum install -y make dpkg dpkg-devel openssl openssl-devel ncurses ncurses-devel bison flex bc libdrm build elfutils-libelf-devel patch gcc
If a package fails to be obtained during the installation, manually obtain the package based on the address provided in the message and install it. After the installation is successful, continue to install the remaining dependency packages.
- Install Docker and lxcfs, start the lxcfs service, and set the lxcfs service to automatically start upon system startup. If Docker and lxcfs have been installed, skip this step.
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 Huawei technical support.
- Upgrade Docker to version 24.0.0 if the Docker version installed using yum is earlier than 24.0.0.
Download the docker-24.0.0.tgz package using the link provided in Software Environment. Decompress the package in any directory and copy the files in the binary package to /usr/bin.
1 2 3
tar -xvf docker-24.0.0.tgz cp docker/* /usr/bin systemctl restart docker
- (Optional) (Hardware configuration scheme 2/3) In the case of high container density, the udev-worker process on the host may exhibit periodic spikes in CPU usage due to the handling of loop devices. Run the following commands to disable the udev function if necessary:
1 2 3
sudo systemctl disable systemd-udevd.service sudo systemctl disable systemd-udevd-control.socket sudo systemctl disable systemd-udevd-kernel.socket