WSL2默认使用的内核是5.*,这里为WSL2编译最新(编辑时6.6.36.6)版本内核,以支持更多新特性
sudo apt install build-essential flex bison dwarves libssl-dev libelf-dev cpio
安装编译所需依赖
git clone
命令太慢
make KCONFIG_CONFIG=Microsoft/config-wsl
开始编译make KCONFIG_CONFIG=Microsoft/config-wsl -j8
调用多线程加速编译Mitigations for CPU vulnerabilities (CPU_MITIGATIONS) [Y/n/?] (NEW)选Y
Analog Devices Generic AXI ADC IP core driver (ADI_AXI_ADC) [N/m/?] (NEW)选n
编译中:
编译完成后没有提示
编译完成后的文件在arch/x86_64/boot下,文件名为bzImage。
可以用命令mv arch/x86_64/boot/bzImage mnt/c/kernel
把编译完的内核文件移动到C盘根目录下。