From bbb40c4e6f45dd0929c59e719310239b11edc040 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 15 Feb 2023 22:06:26 +0000 Subject: mkosi: configure multiarch libdir in debian/ubuntu builds Debian/Ubuntu use /usr/lib/ 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. --- mkosi.build | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mkosi.build') 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//. + # 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 \ -- cgit v1.2.1