lizrice / lb-from-scratch

A very basic eBPF Load Balancer in a few lines of C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

make: bpftool: Command not found

elnemesisdivina opened this issue · comments

commented

Hi there,

I try your steps and when I do the Make in container get the error :

bpftool net detach xdpgeneric dev eth0
make: bpftool: Command not found
make: *** [Makefile:2: xdp] Error 127

also when I clone the repo the only thing different I did was to change in .git and .gitsubmodules to the URL of the git repo of libbpf submodules like this : https://github.com/libbpf/libbpf.git

commented

hello, I manage to clone the repo complete with the submodules without any modification, but still have the make error.

thanks!

In case you're still looking for advice, I had to do the following:

sudo apt install linux-tools-common`

then when I run:

bpftool --help

I received an error message like:

WARNING: bpftool not found for kernel 5.4.0-104

  You may need to install the following packages for this specific kernel:
    linux-tools-5.4.0-104-generic
    linux-cloud-tools-5.4.0-104-generic

  You may also want to install one of the following packages to keep up to date:
    linux-tools-generic
    linux-cloud-tools-generic

So then I installs tools for my kernel via:

sudo apt install linux-tools-5.4.0-104-generic

and then bpftool --help worked.

I'm trying to do the same for linux 6.2.0+ and have also seen:
WARNING: bpftool not found for kernel 6.2.0+
But installing tools for my kernel via:
sudo apt install linux-tools-6.2.0+
doesn't work as it's unable to locate package linux-tools-6.2.0

I tried to install bpftool as a submodule following https://github.com/libbpf/bpftool#dependencies but it still doesn't work...