1bf31c
From 2dbd11b81dae28a5c6291a56175c06665b615d66 Mon Sep 17 00:00:00 2001
1bf31c
From: David Tardon <dtardon@redhat.com>
1bf31c
Date: Thu, 1 Oct 2020 14:08:38 +0200
1bf31c
Subject: [PATCH] dracut-install: ignore bogus preload libs
1bf31c
1bf31c
If there are any nonexistent libraries listed in /etc/ld.so.preload, ldd
1bf31c
prints error messages like:
1bf31c
1bf31c
ERROR: ld.so: object '/usr/lib64/libfoo.so.1' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
1bf31c
1bf31c
This causes resolve_deps() to return error, which leads to symlinks
1bf31c
(like usr/bin/awk) not being copied into the initrd.
1bf31c
1bf31c
(cherry picked from commit 4916dfc2b94dca0e84eb7dc58a9266d02c416b4a)
1bf31c
1bf31c
Resolves: #1884149
1bf31c
---
1bf31c
 install/dracut-install.c | 3 +++
1bf31c
 1 file changed, 3 insertions(+)
1bf31c
1bf31c
diff --git a/install/dracut-install.c b/install/dracut-install.c
1bf31c
index f8ec9a59..baf6dcff 100644
1bf31c
--- a/install/dracut-install.c
1bf31c
+++ b/install/dracut-install.c
1bf31c
@@ -481,6 +481,9 @@ static int resolve_deps(const char *src)
1bf31c
                 if (strstr(buf, "cannot read header"))
1bf31c
                         break;
1bf31c
 
1bf31c
+                if (strstr(buf, "cannot be preloaded"))
1bf31c
+                        break;
1bf31c
+
1bf31c
                 if (strstr(buf, destrootdir))
1bf31c
                         break;
1bf31c
 
1bf31c