我刚刚按照以下步骤重新编译了 Ubuntu Jammy HWE 内核 6.8.0-45:
# Clone Ubuntu stock Kernel repo
git clone git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy
cd jammy
git checkout Ubuntu-hwe-6.8-6.8.0-45.45_22.04.1
# Build deps
sudo apt build-dep linux linux-image-unsigned-`uname -r`
sudo apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev fakeroot libncurses-dev gawk flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf llvm dwarves
# Clean all
fakeroot debian/rules clean && make ARCH=x86 mrproper && git clean -fd && git restore . && git clean -fd && git restore .
# do custom changes
code debian.hwe-6.8/changelog # Append custom version
code include/linux/uts.h # Modify UTS_SYSNAME
# Update Debian configs
chmod a+x debian/rules && chmod a+x debian/scripts/* && chmod a+x debian/scripts/misc/*
fakeroot debian/rules clean
fakeroot debian/rules editconfigs
# Start build
fakeroot debian/rules binary-headers binary-generic
我想知道如何才能重新编译单个“ iwlwifi.ko ”模块而不重新编译整个内核。
我尝试通过运行以下命令从内核源的根目录执行标准重新编译:
make -j$(nproc) M=drivers/net/wireless/intel/iwlwifi modules
但是当我试图插入这个时我得到了:
> sudo insmod drivers/net/wireless/intel/iwlwifi/iwlwifi.ko
insmod: ERROR: could not insert module drivers/net/wireless/intel/iwlwifi/iwlwifi.ko: Invalid parameters
并dmesg
说:
[10754.522405] BPF: [139328] ENUM x509_key_exit
[10754.522410] BPF: size=4 vlen=34
[10754.522410] BPF:
[10754.522411] BPF: Invalid name
[10754.522412] BPF:
[10754.522413] failed to validate module [iwlwifi] BTF: -22
我猜想一定有一种方法可以利用该fakeroot debian/rules
机制,只需重新编译一个模块,而无需清除所有内容并重新构建整个内核。
感谢您的支持。
我想我找到了正确的公式!
就是这个:)