diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2022-10-14 14:53:41 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2022-10-17 08:45:48 +0200 |
commit | 6afeac1dd69bedbdbc8b1364a1002264a2b232f3 (patch) | |
tree | bcefac487d06ede7e25915f9474ce37d8c19d4e9 /mkosi.build | |
parent | afd22e3219457aac21fa4f6073e585994d222280 (diff) | |
download | systemd-6afeac1dd69bedbdbc8b1364a1002264a2b232f3.tar.gz |
mkosi: Make sure bpf-framework works on CentOS Stream 8 as well
Diffstat (limited to 'mkosi.build')
-rwxr-xr-x | mkosi.build | 16 |
1 files changed, 16 insertions, 0 deletions
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 <<EOF +#!/bin/sh +if [ "\$1" = --version ]; then + echo 5.6.0 +else + exec /usr/sbin/bpftool.real \$@ +fi +EOF + chmod +x /usr/sbin/bpftool +fi + if [ ! -f "$BUILDDIR"/build.ninja ] ; then sysvinit_path=$(realpath /etc/init.d) |