笔者尝试的方法有三种:
附:kernel-2.6.32-279.9.1.tb1.el5.nosrc.zip
二、用Redhat/CentOS提供的内核源码包,进行定制、编译、安装。
附:kernel-2.6.32-358.6.4.el6.nosrc.rpm.zip
三、用原生linux内核进行定制、编译、安装。
附:kernel-ml-3.9.7-1.el6.nosrc.rpm.zip
千言万语,不如直接装上附的源码包看吧。以CentOS的源码包编译为例(nosrc.rpm需要自己去下载内核源码):
# 安装编译所依赖的工具包
yum -y install @development-tools fedora-packager kernel-devel rpm-build redhat-rpm-config asciidoc hmaccalc binutils-devel elfutils-libelf-devel newt-devel zlib-devel xmlto python-devel perl-ExtUtils-Embed
# 生成目录:~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} 和文件 ~/.rpmmacros
rpmdev-setuptree
# CentOS 6 对应源码目录: http://ftp.redhat.com/redhat/linux/enterprise/6Server/en/os/SRPMS
cd ~/rpmbuild/SRPMS/
# CentOS 6 当下最新,以下以此为例
wget http://ftp.redhat.com/redhat/linux/enterprise/6Server/en/os/SRPMS/kernel-2.6.32-279.19.1.el6.src.rpm
# 安装内核源码包
rpm -ivh ~/rpmbuild/SRPMS/kernel-2.6.32-279.19.1.el6.src.rpm
# 使用rpmbuild就可以一键编出你的内核到 ~/rpmbuild/RPMS/ 目录中了
rpmbuild -bb --with baseonly --with firmware --without debuginfo ~/rpmbuild/SPECS/kernel.spec
来源:oschina
链接:https://my.oschina.net/u/1245193/blog/152182