坑1:https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel#Building_the_kernel 配置后编译报错,逆向获取源码后编译make install成功,重启黑屏
正确方法:参考https://unix.stackexchange.com/questions/650320/installing-preempt-rt-kernel-on-ubuntu-20-04
1.下载源码,linux-5.18.tar.xz 补丁patch-5.18-rt11.patch.xz,注意格式版本一致
2.uname -r 查看当前内核版本
3.sudo cp /boot/config-5.15.0-41-generic .config//获取当前版本配置到新内核config
4.CONFIG_SYSTEM_TRUSTED_KEYS="debian/canonical-certs.pem"改""
CONFIG_SYSTEM_REVOCATION_KEYS="debian/canonical-revoked-certs.pem"改""
之后sudo make oldconfig修改成实时核配置
5.make -j8 deb-pkg//用make install会报错
6.编译错误过程bug
单线程编译查看错误,安装缺少的依赖
https://gitlab.com/CalcProgrammer1/OpenRGB/-/issues/950
https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel
* BTF: .tmp_vmlinux.btf: pahole (pahole) is not available
https://stackoverflow.com/questions/61657707/btf-tmp-vmlinux-btf-pahole-pahole-is-not-available
* zstd not found
https://linuxconfig.org/how-to-install-and-use-zstd-compression-tool-on-linux
7.sudo dpkg -i ../linux-headers-5.4.143-rt64-rc2_5.4.143-rt64-rc2-1_amd64.deb ../linux-image-5.4.143-rt64-rc2_5.4.143-rt64-rc2-1_amd64.deb ../linux-libc-dev_5.4.143-rt64-rc2-1_amd64.deb