I just recompiled the Ubuntu Jammy HWE kernel 6.8.0-45 using these steps:
# 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
I was wondering on how can I just recompile the single 'iwlwifi.ko' module without re-compile the whole kernel.
I tried to perform standard recompilation from the root of kernel sources by running:
make -j$(nproc) M=drivers/net/wireless/intel/iwlwifi modules
But when tying to insert this I get:
> sudo insmod drivers/net/wireless/intel/iwlwifi/iwlwifi.ko
insmod: ERROR: could not insert module drivers/net/wireless/intel/iwlwifi/iwlwifi.ko: Invalid parameters
And dmesg
says:
[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
I guess there must be a way to exploit the fakeroot debian/rules
mechanism for just re-compile a single module without clean everything all and build the whole kernel again.
Thank you for support.