From 3f5225d7f301f70c9418122cf1e1989ccb33ea76 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 14 Oct 2022 14:21:43 +0200 Subject: [PATCH 1/5] qrcode-util: Add support for libqrencode 3.0 They didn't actually change API between major versions, so let's support the previous version as well so we can add CentOS 8 Stream back to CI. --- meson.build | 2 +- src/shared/qrcode-util.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 2c6a061a90..dfe18f7e7b 100644 --- a/meson.build +++ b/meson.build @@ -1388,7 +1388,7 @@ conf.set10('HAVE_LIBIPTC', have) want_qrencode = get_option('qrencode') if want_qrencode != 'false' and not skip_deps libqrencode = dependency('libqrencode', - version : '>= 4', + version : '>= 3', required : want_qrencode == 'true') have = libqrencode.found() else diff --git a/src/shared/qrcode-util.c b/src/shared/qrcode-util.c index 1ad3474b3f..4a33c28bf2 100644 --- a/src/shared/qrcode-util.c +++ b/src/shared/qrcode-util.c @@ -8,6 +8,7 @@ #include "dlfcn-util.h" #include "locale-util.h" #include "log.h" +#include "strv.h" #include "terminal-util.h" #define ANSI_WHITE_ON_BLACK "\033[40;37;1m" @@ -21,10 +22,18 @@ static QRcode* (*sym_QRcode_encodeString)(const char *string, int version, QRecL static void (*sym_QRcode_free)(QRcode *qrcode) = NULL; int dlopen_qrencode(void) { - return dlopen_many_sym_or_warn( - &qrcode_dl, "libqrencode.so.4", LOG_DEBUG, + int r; + + FOREACH_STRING(s, "libqrencode.so.4", "libqrencode.so.3") { + r = dlopen_many_sym_or_warn( + &qrcode_dl, s, LOG_DEBUG, DLSYM_ARG(QRcode_encodeString), DLSYM_ARG(QRcode_free)); + if (r >= 0) + break; + } + + return r; } static void print_border(FILE *output, unsigned width) { From 3632e90c85332e08c464972f613b09bb3a77a026 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 14 Oct 2022 14:26:50 +0200 Subject: [PATCH 2/5] mkosi: Reenable bpf-framework This got changed by mistake by #24511. Since we still support the same libbpf version, we can keep this enabled everywhere. --- mkosi.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkosi.build b/mkosi.build index 4f7b67d7e5..7a32673bb4 100755 --- a/mkosi.build +++ b/mkosi.build @@ -149,7 +149,7 @@ if [ ! -f "$BUILDDIR"/build.ninja ] ; then -D gnu-efi=true \ -D kernel-install=true \ -D analyze=true \ - -D bpf-framework=auto + -D bpf-framework=true fi cd "$BUILDDIR" From afd22e3219457aac21fa4f6073e585994d222280 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 14 Oct 2022 14:27:48 +0200 Subject: [PATCH 3/5] README: Fix libbpf minimum version This didn't get properly updated as part of #24511 --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index fa5d3aca1b..92e3ca0f48 100644 --- a/README +++ b/README @@ -181,7 +181,7 @@ REQUIREMENTS: libcryptsetup (optional), >= 2.3.0 required for signed Verity images support libaudit (optional) libacl (optional) - libbpf >= 0.7.0 (optional) + libbpf >= 0.1.0 (optional) libfdisk >= 2.32 (from util-linux) (optional) libselinux (optional) liblzma (optional) From 6afeac1dd69bedbdbc8b1364a1002264a2b232f3 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 14 Oct 2022 14:53:41 +0200 Subject: [PATCH 4/5] mkosi: Make sure bpf-framework works on CentOS Stream 8 as well --- mkosi.build | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 < Date: Fri, 14 Oct 2022 14:30:12 +0200 Subject: [PATCH 5/5] mkosi: Add Centos Stream 8 back to CI We can build all of systemd's features again on CentOS Stream 8, so let's add it back to CI. --- .github/workflows/mkosi.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index de00078b2a..47716541dd 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -47,6 +47,8 @@ jobs: release: tumbleweed - distro: centos_epel release: 9-stream + - distro: centos_epel + release: 8-stream steps: - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b