Skip to content

Instantly share code, notes, and snippets.

@aalemayhu
Last active September 9, 2017 13:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aalemayhu/7efbbc4efe1f8724f9ddb5cdb294eaec to your computer and use it in GitHub Desktop.
Save aalemayhu/7efbbc4efe1f8724f9ddb5cdb294eaec to your computer and use it in GitHub Desktop.
Install net-next kernel on Ubuntu 17.X or Fedora 25
#!/bin/bash
# Copied from http://docs.cilium.io/en/latest/bpf/#ubuntu
if [ -f /etc/fedora-release ]; then
time sudo dnf update
time sudo dnf install -y git gcc ncurses-devel elfutils-libelf-devel bc \
openssl-devel libcap-devel clang llvm
elif [ -f /etc/debian-release ]; then
time sudo apt-get update
time sudo apt-get install -y make gcc libssl-dev bc libelf-dev libcap-dev \
clang gcc-multilib llvm libncurses5-dev git
fi
time git clone --depth 1 git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
cd net-next
cp /boot/config-`uname -r` .config
make clean
./scripts/config --disable CONFIG_DEBUG_INFO
./scripts/config --disable CONFIG_DEBUG_KERNEL
./scripts/config --enable CONFIG_BPF
./scripts/config --enable CONFIG_BPF_SYSCALL
./scripts/config --module CONFIG_NETFILTER_XT_MATCH_BPF
./scripts/config --module CONFIG_NET_CLS_BPF
./scripts/config --module CONFIG_NET_ACT_BPF
./scripts/config --enable CONFIG_BPF_JIT
./scripts/config --enable CONFIG_HAVE_BPF_JIT
./scripts/config --enable CONFIG_BPF_EVENTS
./scripts/config --module CONFIG_TEST_BPF
./scripts/config --disable CONFIG_LUSTRE_FS
./scripts/config --enable CONFIG_IPV6_OPTIMISTIC_DAD
./scripts/config --enable CONFIG_TCP_CONG_BBR
./scripts/config --enable CONFIG_DEFAULT_BBR
make olddefconfig
grep BPF .config
time make -j`grep -Pc '^processor\t' /proc/cpuinfo`
echo
time make modules
time sudo make modules_install
time sudo make install
time make headers_install
time sudo update-grub
# TODO: check for fedora grub files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment