Merge pull request #25003 from DaanDeMeyer/mkosi-fixes

mkosi: Add Centos Stream 8 back to CI
This commit is contained in:
Luca Boccassi 2022-10-17 11:36:55 +02:00 committed by GitHub
commit 6d4f55f3eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 5 deletions

View file

@ -47,6 +47,8 @@ jobs:
release: tumbleweed
- distro: centos_epel
release: 9-stream
- distro: centos_epel
release: 8-stream
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b

2
README
View file

@ -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)

View file

@ -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

View file

@ -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)
@ -149,7 +165,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"

View file

@ -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) {