Compile and install the driver module in Debian

Source: Internet
Author: User
Debian: Compile and install the driver module-Debian, the Linux release technology. For more information, see the following. In Linux, we often need to compile and install the driver module by ourselves. For example, to install a video card driver or a wireless driver, sometimes you need to install the corresponding driver module for the installation of a program. In Debian Linux, the life cycle is very simple, and apt can be used to handle everything. We will discuss the driver installation. In general, the compiled driver is also available in the source. However, in general, the driver module has a strong dependency with the kernel version used. If the source does not have a driver that matches the kernel version we use, we need to manually compile and install the driver module. In this case, the driver module compilation and Installation Tool m-a In Debian is ready for use. Next we will briefly introduce how to use m-a to manually compile and install the driver module.

1 install m-

# Apt-get install module-assistant

2. install required software

# Apt-get install build-essential

This is a required software package for compiling the kernel and modules. Of course, if we do not install it explicitly, we can also use the following command to install it:

# M-a prepare

As shown in its name, this will install the required software packages for the compilation and installation of the driver module, so that you can install build-essential.

3. Install the kernel source code and corresponding header files

To compile and install the driver module, we must first install the corresponding kernel source code and the corresponding kernel header file. Of course, if we compile and install the kernel by ourselves and have the source code used for compiling and installing the kernel under the/usr/src directory, skip this step. If this is not the case, install the source code and header file first.

We can use the following command to determine the kernel version information we use. The kernel source code and header file we will install must match the kernel version we are using:

# Uname-

Install the kernel source code:

# Apt-get install linux-source-'uname-R'

Install the corresponding header file:

# Apt-get install linux-headers-'uname-R'

4. Compile and install the driver module:

In this way, we can go to the/usr/src directory and compile and install the required driver modules. After installation, we can use the following command to drive updates:

# M-a update

If we want to install the fglrx driver module for the video card, we can use the following command to automatically install it:

# M-a-I fglrx

This command can complete the automatic compilation and Installation Process of the corresponding driver module. In fact, this command is composed of three commands: get, build, and install. If we want to see the compilation and installation process in detail, we can call these three commands to complete the installation process:

Get the driver source code:

# M-a get fglrx

This will download the specified driver source code and decompress it to the/usr/src/modules directory.

Compile the driver module:

# M-a build fglrx

After compilation, the corresponding deb installation package will be generated in the/usr/src/directory. We can use m-a for installation:

# M-a install fglrx

Of course, we can also use dpkg to install such a deb package:

# Dpkg-I fglrx-xxx.deb

5. Load the driver module

After installing the driver module, we can load the driver module to determine whether our driver module is successfully installed:

# Modprobe fglrx

If load is successful, the driver module is successfully installed. Otherwise, an error check is required. If the installation is successful, we need to edit the system driver configuration file so that the system can automatically load the driver module at startup:

# Vim/etc/modules

Write the driver module to be loaded when the system starts.

That's all, Enjoy it.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.