diff options
author | Luca Boccassi <bluca@debian.org> | 2023-02-15 22:06:26 +0000 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-02-16 11:30:32 +0100 |
commit | bbb40c4e6f45dd0929c59e719310239b11edc040 (patch) | |
tree | 783fda556393ef43057ebeee1f424eb4f7026bc3 /mkosi.build | |
parent | 0d7009d35df2fef494b1df67f5caa55e85dd8970 (diff) | |
download | systemd-bbb40c4e6f45dd0929c59e719310239b11edc040.tar.gz |
mkosi: configure multiarch libdir in debian/ubuntu builds
Debian/Ubuntu use /usr/lib/<triplet> instead of /usr/lib64, so configure it
accordingly. This is especially important for cryptsetup token plugins,
as cryptsetup comes from the distro and is configured to look into those
directories.
Diffstat (limited to 'mkosi.build')
-rwxr-xr-x | mkosi.build | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mkosi.build b/mkosi.build index 4a72dd3ef4..b9ee0f1ae2 100755 --- a/mkosi.build +++ b/mkosi.build @@ -86,7 +86,19 @@ if [ ! -f "$BUILDDIR"/build.ninja ] ; then rootprefix=/${rootprefix#/} fi + # On debian-like systems the library directory is not /usr/lib64 but /usr/lib/<arch-triplet>/. + # It is important to use the right one especially for cryptsetup plugins, otherwise they will be + # installed in the wrong directory and not be found by cryptsetup. Assume native build. + if grep -q -e "ID=debian" -e "ID_LIKE=debian" /etc/os-release && command -v dpkg 2>/dev/null; then + LIBDIR="-Drootlibdir=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)" + PAMDIR="-Dpamlibdir=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/security" + fi + + # Cannot quote $LIBDIR and $PAMDIR, because they may be empty, and meson will fail. + # shellcheck disable=SC2086 meson setup "$BUILDDIR" \ + ${LIBDIR:-} \ + ${PAMDIR:-} \ -D "sysvinit-path=$sysvinit_path" \ -D "rootprefix=$rootprefix" \ -D man=false \ |