Preparations
This document describes how to compile the kernel source code on the default OS openEuler 22.03 LTS (kernel version 5.10.0).
Before the compilation, configure the network environment, software source, and system time of the server for downloading the related compilation dependencies.
During the compilation, use the root user to log in and perform operations.
- Disable the warning "your kernel does not support swap memory limit...".
Open the /etc/default/grub file and change the value of GRUB_CMDLINE_LINUX.
# vim /etc/default/grub GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
If GRUB_CMDLINE_LINUX has other settings, add the preceding setting to the end.
- Disable SELinux.Edit the /etc/selinux/config file. If there is no such a file, create one and then set SELINUX to disabled.
1 2
# vim /etc/selinux/config SELINUX=disabled
- When multiple Kbox containers are started, the file access workload is heavy on the host. In this case, you need to adjust the maximum number of inotify instances that can be created.In the /etc/sysctl.conf file, set the value of fs.inotify.max_user_instances.
1 2
# vim /etc/sysctl.conf fs.inotify.max_user_instances = 8192
- Update boot settings and reboot the OS for the settings to take effect.
1 2
# grub2-mkconfig -o /boot/grub2/grub.cfg # reboot
- Install base dependencies.
# yum install dpkg dpkg-devel openssl openssl-devel # yum install ncurses ncurses-devel bison flex bc libdrm build elfutils-libelf-devel
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 dependence packages.
- 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:
# yum install 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.
- Upgrade linux-firmware. If the firmware has been upgraded, skip this step.
Download linux-firmware-20210919.tar.gz using the link provided in Table 1.
Upload the installation package to the server, for example, to the /root directory of the server, and decompress the package.# 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.# cp -ar linux-firmware-20210919/*gpu /usr/lib/firmware/