编译centos的源码

首先到到下面这个链接下载内核源代码组件:
http://vault.centos.org/6.9/os/Source/SPackages/
然后再当前的centos机器上安装编译需要用到的依赖包
 yum install rpm-build redhat-rpm-config asciidoc hmaccalc perl-ExtUtils-Embed pesign xmlto
 audit-libs-devel binutils-devel elfutils-devel elfutils-libelf-devel
 ncurses-devel newt-devel numactl-devel pciutils-devel python-devel zlib-devel bc openssl-devel libssl-dev -y

,最后通过rpm 安装下载好的源码包,然后通过下面的命令来生成源码(包含解压kenrel源码和打patch)
cd ~/rpmbuild/SPECS
rpmbuild -bp --target=$(uname -m) kernel.spec

最后生成可以make的linux kernel 源码

你可能感兴趣的:(Linux,源码分析)