CentOS7下内核源码下载及编译步骤

验证网络情况:
yum install
安装需要的软件:
yum install setools-console
yum install httpd
yum install policycoreutils-python setools-console
yum -y install vsftpd ftp
yum install m4
yum -y install gcc
安装内核编译的软件:
yum install rpm-build xmlto hmaccalc asciidoc newt-devel pesign binutils-devel audit-libs-devel numactl-devel pciutils-devel ncurses-devel perl-ExtUtils-Embed elfutils-devel python-devel ruby-devel libsepol-static swig xz-devel ruby checkpolicy policycoreutils-devel
下载内核源码:
wget http://vault.centos.org/centos/7/os/Source/SPackages/kernel-3.10.0-514.el7.src.rpm
安装内核源码:
rpm -i kernel-3.10.0-514.el7.src.rpm
编译源码: 
cd /root/rpmbuild/SPECS/
rpmbuild -bb kernel.spec
注:安装编译源码报错处理:
    yum install mock
    useradd -s /sbin/nologin mockbuild
    yum install bison 
编译过程中内核的源码会被解压缩,并打好补丁,释放在
/root/rpmbuild/BUILD目录。
编译后的kernel会在/root/rpmbuild/RPMS中

你可能感兴趣的:(CentOS7下内核源码下载及编译步骤)