Dev Environment for XDP and eBPF on Debian Sid

1 minute read

sudo apt-get install build-essential
sudo apt-get install bison flex gcc-multilib git pkg-config libssl-dev bc \
                     libelf-dev libcap-dev clang-6.0 llvm-6.0 libncurses5-dev \
                     libmnl0 graphviz kernel-package
sudo update-alternatives --install /usr/bin/llc llc /usr/bin/llc-6.0 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 100
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 100
wget https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/snapshot/net-4.17.tar.gz
tar xaf net-4.17.tar.gz
cd net-4.17 
cp /boot/config* .config
perl -pi -e 's/CONFIG_SYSTEM_TRUSTED_KEYRING/#CONFIG_SYSTEM_TRUSTED_KEYRING/g' .config
perl -pi -e 's/CONFIG_SYSTEM_TRUSTED_KEYS/#CONFIG_SYSTEM_TRUSTED_KEYS/g' .config
fakeroot make-kpkg --append-to-version -net --revision 1 --initrd kernel-image kernel-headers kernel-source
[................................]
sudo dpkg -i linux-headers-4.17.0-net_1_amd64.deb linux-image-4.17.0-net_1_amd64.deb
[...]
sudo reboot
[...]
uname -a
$ Linux sid2 4.17.0-net #1 SMP Wed Jun 20 23:13:07 BST 2018 x86_64 GNU/Linux
cd net-4.17/tools/testing/selftests/bpf/
make
[...]
sudo ./test_verifier
[...]
Summary: 847 PASSED, 0 SKIPPED, 0 FAILED