summaryrefslogtreecommitdiff
path: root/src/nspawn/nspawn-util.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2022-06-01 08:23:02 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-06-07 10:04:43 +0200
commit5fb225615bf751b97644bed7aae44f69ba03cc84 (patch)
tree803ef39853997e64e9e7dd56d73b607efed345bb /src/nspawn/nspawn-util.c
parent3cf63830acdef9d8afdc9ef1cf25aa7e85a5e4d5 (diff)
downloadsystemd-5fb225615bf751b97644bed7aae44f69ba03cc84.tar.gz
meson: install libsystemd-shared into rootpkglibdir
Introduce rootpkglibdir for installing libsystemd-{shared,core}.so. The benefit over using rootlibexecdir is that this path can be multiarch aware, i.e. this path can be architecture qualified. This is something we'd like to make use of in Debian/Ubuntu to make libsystemd-shared co-installable, e.g. for i386 the path would be /usr/lib/i386-linux-gnu/systemd/libsystemd-shared-*.so and for amd64 /usr/lib/x86_64-linux-gnu/systemd/libsystemd-shared-*.so. This will allow for example to install and run systemd-boot/i386 on an amd64 host. It also simplifies/enables cross-building/bootstrapping. For more infos about Multi-Arch see https://wiki.debian.org/Multiarch. See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=990547
Diffstat (limited to 'src/nspawn/nspawn-util.c')
-rw-r--r--src/nspawn/nspawn-util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nspawn/nspawn-util.c b/src/nspawn/nspawn-util.c
index 402554fa38..830ac39e73 100644
--- a/src/nspawn/nspawn-util.c
+++ b/src/nspawn/nspawn-util.c
@@ -20,9 +20,12 @@ int systemd_installation_has_version(const char *root, const char *minimal_versi
/* /lib works for systems without usr-merge, and for systems with a sane
* usr-merge, where /lib is a symlink to /usr/lib. /usr/lib is necessary
* for Gentoo which does a merge without making /lib a symlink.
+ * Also support multiarch paths von Debian/Ubuntu; *-linux-* is a small
+ * optimization based on the naming scheme of existing multiarch tuples.
*/
"/lib/systemd/libsystemd-shared-*.so",
"/lib64/systemd/libsystemd-shared-*.so",
+ "/usr/lib/*-linux-*/systemd/libsystemd-shared-*.so",
"/usr/lib/systemd/libsystemd-shared-*.so",
"/usr/lib64/systemd/libsystemd-shared-*.so") {
@@ -47,7 +50,7 @@ int systemd_installation_has_version(const char *root, const char *minimal_versi
/* This is most likely to run only once, hence let's not optimize anything. */
char *t, *t2;
- t = startswith(*name, path);
+ t = startswith(basename(*name), "libsystemd-shared-");
if (!t)
continue;