From 6afeac1dd69bedbdbc8b1364a1002264a2b232f3 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 14 Oct 2022 14:53:41 +0200 Subject: mkosi: Make sure bpf-framework works on CentOS Stream 8 as well --- mkosi.build | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mkosi.build') diff --git a/mkosi.build b/mkosi.build index 7a32673bb4..f02a15ad4d 100755 --- a/mkosi.build +++ b/mkosi.build @@ -56,6 +56,22 @@ for bpftool in /usr/lib/linux-tools/*/bpftool; do break done +# CentOS Stream 8 includes bpftool 4.18.0 which is lower than what we need. However, they've backported the +# specific feature we need ("gen skeleton") to this version, so we replace bpftool with a script that reports +# version 5.6.0 to satisfy meson which makes bpf work on CentOS Stream 8 as well. +if [ "$(grep '^ID=' /etc/os-release)" = "ID=\"centos\"" ] && [ "$(grep '^VERSION=' /etc/os-release)" = "VERSION=\"8\"" ]; then + cp /usr/sbin/bpftool /usr/sbin/bpftool.real + cat > /usr/sbin/bpftool <