Driver Source Code Compilation
The driver source code can be compiled automatically or manually. The automatic compilation is implemented by the DKMS tool. You need to install DKMS first.
Switch to user root before performing the following operations.
Prerequisites
Ubuntu/Debian:
dpkg-query -s dkms (Run this command to query DKMS only when you want to use the automatic compilation mode.)
dpkg-query -s gcc
dpkg-query -s linux-headers-$(uname -r)
- CentOS:
rpm -qa | grep dkms (Run this command to query DKMS only when you want to use the automatic compilation mode.)
rpm -qa | grep gcc
rpm -qa | grep kernel-*-headers-$(uname -r)
rpm -qa | grep kernel-*-devel-$(uname -r)
- EulerOS:
rpm -qa | grep gcc
rpm -qa | grep kernel-headers-$(uname -r)
rpm -qa | grep kernel-devel-$(uname -r)
- Kylin V10 SP1:
rpm -qa | grep gcc
rpm -qa | grep kernel-devel-$(uname -r)
- For Ubuntu or Debian, you need to install the DKMS, GCC, and linux-header software packages. If the software packages are not installed, obtain them from the official website and install them.
- For CentOS, you need to install the DKMS, GCC, kernel-*-headers, and kernel-*-devel software packages. If the software packages are not installed, obtain them from the official website and install them.
- For EulerOS, you need to install the GCC, kernel-headers, and kernel-devel software packages. If the software packages are not installed, obtain them from the official website and install them.
- For Kylin V10 SP1, you need to install the GCC and kernel-devel software packages. If the software packages are not installed, obtain them from the official website and install them.
- You are advised to install the dkms-2.6.1-1.el7.noarch.rpm software package.
If the software packages are not installed, run the following commands to install them:
- The following commands must be run when the host is connected to the Internet. Otherwise, the software packages cannot be obtained. You are advised to install the software packages and related dependencies when the host is connected to the Internet.
- If you need to install software packages such as DKMS, GCC, and linux-header offline, obtain them from the website of the corresponding OS vendor.
Ubuntu-like OS:
apt-get install gcc
apt-get install linux-headers-$(uname -r)
apt-get install dkms (Run this command to install DKMS only when you want to use the automatic compilation mode.)
CentOS-like OS:
yum install gcc
yum install kernel-headers-$(uname -r)
yum install kernel-devel-$(uname -r)
yum install dkms (Run this command to install DKMS only when you want to use the automatic compilation mode.)
Automatic Compilation
During the installation of the .run software package, if the kernel version is inconsistent with the driver image version in the software package, compilation of the driver source code is performed automatically before the software package installation.
For details about how to install the .run software package, see Installing the Driver and Firmware.
Manual Compilation
During the installation, if the kernel version is consistent with that of the driver image in the .run package, automatic compilation of the driver source code will not be triggered. In the subsequent use, however, if the kernel is updated, you need to manually execute the script for compiling the driver source code in the installation path of the .run software package.
- Find the script in RUN Installation Path/driver/script.
- Two scripts are provided:
- run_driver_dkms_install.sh
This script compiles the driver source code and adds the code to the DKMS framework. After the script is executed, the driver image linked to the .run package is automatically updated.
- run_driver_dkms_uninstall.sh
This script uninstalls the driver source code and removes the code from the DKMS framework. The removal does not affect the installed .run package, but automatic compilation is no longer supported after the removal.
- run_driver_dkms_install.sh