From 61d92c0d83401b5d3e659fc04105741e19a47ad2 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Mon, 9 Aug 2021 12:47:59 +0100
Subject: [PATCH] pv-runtime: Try to create /sbin/ldconfig.real if using host
 glibc

In Ubuntu and older versions of Debian, /sbin/ldconfig is a shell script
that wraps /sbin/ldconfig.real. To make it possible to run /sbin/ldconfig,
we have to map /sbin/ldconfig.real into the container too.

Resolves: T29764
Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 pressure-vessel/runtime.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pressure-vessel/runtime.c b/pressure-vessel/runtime.c
index ab75c2dd1..53a4d3dcb 100644
--- a/pressure-vessel/runtime.c
+++ b/pressure-vessel/runtime.c
@@ -4454,6 +4454,10 @@ pv_runtime_finish_libc_family (PvRuntime *self,
     { "getent" },
     { "iconv" },
     { "ldconfig", .priority = ESSENTIAL, .target_path = "/sbin/ldconfig" },
+    /* In Ubuntu and old Debian releases (Debian 8 or older), /sbin/ldconfig
+     * is a shell script wrapper around the real binary /sbin/ldconfig.real,
+     * working around lack of dpkg trigger support in old library packages. */
+    { "ldconfig.real", .target_path = "/sbin/ldconfig.real" },
     { "ldd", .priority = IMPORTANT },
     { "locale", .priority = IMPORTANT },
     { "localedef", .priority = IMPORTANT },
-- 
GitLab