Skip to content

Commit

Permalink
respect system's bpftool path
Browse files Browse the repository at this point in the history
Some systems ship with very old versions of `bpftool` and updating using `apt`; although successful, never really brings the up-to-date version.

One way to tackle this is to build from source. Hard-coding the path of the bpftool on those systems results in the use of the older binary.

This change, will give the system a chance to use the intended bpftool.
  • Loading branch information
pouriyajamshidi authored Dec 14, 2023
1 parent 87e32be commit bd0960e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/btfgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ fi

cd ${basedir}

btfgen=/usr/sbin/bpftool
btfgen=$(which bpftool)
if [ -z "${btfgen}" ]; then
btfgen=/usr/sbin/bpftool
fi

if [ ! -x "${btfgen}" ]; then
echo "error: could not find bpftool (w/ btfgen patch) tool"
exit 1
Expand Down

0 comments on commit bd0960e

Please sign in to comment.