Skip to content

Instantly share code, notes, and snippets.

@bave
Last active March 28, 2018 09:15
Show Gist options
  • Save bave/e3abb7ddea9913c58168 to your computer and use it in GitHub Desktop.
Save bave/e3abb7ddea9913c58168 to your computer and use it in GitHub Desktop.
linux netmap patch script
#!/usr/bin/env sh
cd /tmp
apt-get update
apt-get -y install git build-essential
apt-get -y install linux-source linux-headers-generic
tar xvf /usr/src/linux-source-`uname -r | awk 'BEGIN { FS="-" } { print $1 }'`.tar.bz2 -C /usr/src
git clone https://github.com/luigirizzo/netmap.git
cd netmap/LINUX
SRC_VAR=/usr/src/linux-source-`uname -r | awk 'BEGIN { FS="-" } { print $1 }'`
./configure --kernel-sources=${SRC_VAR}
make KSRC=/usr/src/linux-headers-`uname -r`
cd ../sys/net
ln -s netmap.h /usr/include/net/netmap.h
ln -s netmap_user.h /usr/include/net/netmap_user.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment