从SRC RPM编译CentOS内核

xiaoxiao2021-02-28  99

1. 获取源代码包

从 http://vault.centos.org 下载内核源代码RPM包。

2. 安装源代码包

3. Build RPM

# cd /root/rpmbuild # nohup rpmbuild -bb SPECS/kernel.spec &

可以只编译kernel rpm,节省时间:

# rpmbuild -bb --without debug --without debuginfo --without tools --without perf --without doc SPECS/kernel.spec

4. 单独编译Kernel

# cd /root/rpmbuild/BUILD/kernel-3.10.0-327.36.3.el7/linux-3.10.0-327.36.3.el7.x86_64 # make -j4 bzImage

5. 替换kernel进行测试

# cp arch/x86/boot/bzImage /boot # cd /boot # mv bzImage vmlinuz-3.10.0-327.36.3.el7.x86_64 # reboot

转载请注明原文地址: https://www.6miu.com/read-96438.html

最新回复(0)