Compile the Linux driver

Source: Internet
Author: User

Compile the Linux Driver Based on Ubuntu 12.10

1. Prepare the Linux kernel source code

At this time, the driver I want to compile is based on the Ubuntu 12.10 kernel, So I downloaded the corresponding kernel source package:

Linux_3.5.0-17.28.diff.gz

Linux_3.5.0-17.28.dsc

Linux_3.5.0.orig.tar.gz

Run the command dpkg-source-x linux_3.5.0-17.28.dsc to extract the kernel source package and add the patch in the diff package.

2. Set the correct path of the kernel source code

# Linux-3.5.0/CD/root

# Ln-S/root/linux-3.5.0/lib/modules/3.5.0-17-generic/build

3. Compile the driver

# Cd/root/wifidriver

# Make build

You may encounter the following problems:

Make [1]: Entering directory '/root/linux-3.5.0'

Error: Kernel configuration is invalid.
Include/generated/Autoconf. h or include/config/auto. conf are missing.
Run 'make oldconfig & make prepare' on Kernel SRC to fix it.

Warning: Symbol version dump/root/linux-3.5.0/module. symvers
Is missing; modules will have no dependencies and modversions.

Building modules, stage 2.
/Root/linux-3.5.0/scripts/makefile. modpost: 42: Include/config/auto. conf: no such file or directory
Make [2]: *** no rule to make target 'include/config/auto. conf'. Stop.
Make [1]: *** [modules] Error 2
Make [1]: Leaving directory '/root/linux-3.5.0'
Make: *** [Default] Error 2

One of the errors is to execute make oldconfig & make prepare

One of the warning, you need to copy/usr/src/linux-headers-3.5.0-17-generic/module. symvers to/root/linux-3.5.0, then execute make oldconfig & make prepare & make scripts

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.