centos 7 安装源码kernel source(源码树)编译驱动

1,安装源码,编译驱动

https://wiki.centos.org/HowTos/I_need_the_Kernel_Source

2,在这里可以找到你要的kernel 源代码

http://vault.centos.org/7.0.1406/os/Source/SPackages/

3,安装必要的工具

yum install rng-tools 
yum install rpm-build redhat-rpm-config unifdef 

4,安装源码

rpm -i http://vault.centos.org/6.7/updates/Source/SPackages/kernel-2.6.32-573.8.1.el6.src.rpm 2>&1 | grep -v exist

5,编译工具

yum install rpm-build redhat-rpm-config asciidoc bison hmaccalc patchutils perl-ExtUtils-Embed xmlto 

yum install audit-libs-devel binutils-devel elfutils-devel elfutils-libelf-devel

 yum install newt-devel python-devel zlib-devel

yum install gcc bc bison

6,编译

cd ~/rpmbuild/SPECS
rpmbuild -bp --target=$(uname -m) kernel.spec

你可能感兴趣的:(centos 7 安装源码kernel source(源码树)编译驱动)