文章来源:官方文档
准备工作
下载Linux Kernel源码包
前往Linux官方网站,下载你想要编译的内核版本
https://www.kernel.org
网络不佳可以切换清华大学镜像站
https://mirrors.tuna.tsinghua.edu.cn/kernel/
安装编译Linux内核所需要的工具
创建内核编译目录并解压源码包
1 2 3 4
| mkdir Kernel-bulid tar -zxvf [Linux源码包] -C kernel-bulid/ cd kernel-bulid/ cd linux-*/
|
编译内核
make设置
部分设置翻译
General setup 常规设置
Processor type and features 处理器类型和功能
Power management and ACPI options 电源管理和ACPI选项
Bus options (PCI etc.) 总线选项(PCI etc.)
Binary Emulations 二进制仿真
Virtualization 虚拟化
General architecture-dependent options 启用可加载模块支持
Enable the block layer 启用块层
Executable file formats 可执行文件格式
Memory Management options 内存管理选项
Networking support 网络支持
Device Drivers 设备驱动程序
File systems 文件系统
Security options 安全选项
Cryptographic API 加密API
Library routines 库例程
Kernel hacking 内核调试
编译
1 2
| make bzImage make modules
|
安装编译后内核
1 2
| sudo make modules-install sudo make install
|