构建 Linux 内核

内核

准备环境

1
2
3
# apt update
# apt upgrade
# apt install build-essential linux-headers-$(uname -r) libncurses5-dev flex bison libssl-dev bc libelf-dev python3 dwarves

下载内核源码

1
2
3
# wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.8.4.tar.xz
# tar -xvf linux-6.8.4.tar.xz
# cd linux-6.8.4/

编译内核

1
2
3
# cp /boot/config-`uname -r` .config
# make menuconfig
# make -j4 // 多线程编译

安装内核

1
2
# make modules_install
# make install

参考