I recently stared experimenting with eBPF patches by Alexei Starovoitov which apparently are extending and restructuring the Berkeley Packet Filter infrastructure in the kernel. BPF is used for a lot of tasks like syscall filtering, packets filtering etc. and obviously deserves a separate and grand blog entry. Well, we’ll see what can be done about it later but for now, I’ll just explain how to do the trivial task of installing a custom kernel (possibly patched/upstream) on your Fedora machine. Its nothing grand, just those familiar textbook tasks. I am using the master from Alexei’s repo.
Build the kernel
git clone https://kernel.googlesource.com/pub/scm/linux/kernel/git/ast/bpf cd bpf
I changed the EXTRAVERSION string in the Makefile just to differentiate it as I may have to use multiple versions while testing.
make menuconfig make -j4
Set it up
sudo make modules_install sudo cp arch/x86_64/boot/bzImage "/boot/vmlinuz-"`make kernelrelease` sudo cp System.map "/boot/System.map-"`make kernelrelease` sudo dracut "" `make kernelrelease` sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Restart your machine and enjoy the new kernel. Once you are done with the experiments, boot into the old kernel and remove the initrd, kernel image, and the custom system map. Then update the grub config once more. Thats it! I’ll post more about my experiments with eBPF soon.