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