]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: configure multiarch libdir in debian/ubuntu builds
authorLuca Boccassi <bluca@debian.org>
Wed, 15 Feb 2023 22:06:26 +0000 (22:06 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 16 Feb 2023 10:30:32 +0000 (11:30 +0100)
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.

mkosi.build
mkosi.conf.d/debian/10-debian.conf
mkosi.conf.d/ubuntu/10-ubuntu.conf

index 4a72dd3ef4193d2314532e8654bfd6b75c4ff22f..b9ee0f1ae2d443405bddfdc999d0ac456e2553bc 100755 (executable)
@@ -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 \
index 356b8b06ab5b00eb14ff92dca08f9de4e2735952..905378a9b4a92d567405c37be4d19ec8343ef92f 100644 (file)
@@ -44,6 +44,7 @@ Packages=
 BuildPackages=
         bpftool
         docbook-xsl
+        dpkg-dev
         g++
         gcc-multilib
         libacl1-dev
index 99cffa043d458b9bc2cc8e3513ec5a1cfd1256f7..647a71826c251c9539fe401ee1feaa5b3decbe38 100644 (file)
@@ -45,6 +45,7 @@ Packages=
 
 BuildPackages=
         docbook-xsl
+        dpkg-dev
         g++
         gcc-multilib
         libacl1-dev