Skip to content

Commit

Permalink
fix(dracut-install): continue parsing if ldd prints "cannot be preloa…
Browse files Browse the repository at this point in the history
…ded"

When /etc/ld.so.preload contains a non-existing library, `ldd` prints the
following output:

```
> ldd /usr/lib64/libfido2.so.1.12.0
ERROR: ld.so: object '/usr/lib64/libfoo.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib64/libfoo.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
	linux-vdso.so.1 (0x00007ffd477f5000)
	libcbor.so.0.10 => /lib64/libcbor.so.0.10 (0x00007f34062dd000)
	libcrypto.so.3 => /lib64/libcrypto.so.3 (0x00007f3405e00000)
	libudev.so.1 => /lib64/libudev.so.1 (0x00007f34062af000)
	libhidapi-hidraw.so.0 => /lib64/libhidapi-hidraw.so.0 (0x00007f34062a6000)
	libz.so.1 => /lib64/libz.so.1 (0x00007f340628c000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f3405c05000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f3406336000)
ERROR: ld.so: object '/usr/lib64/libfoo.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
> echo $?
0
ERROR: ld.so: object '/usr/lib64/libfoo.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
```

If `dracut-install` stops parsing the `ldd` output, the initrd will not contain
all the required dependencies.

Fixes issue dracutdevs#2241

(cherry picked from commit dracut-ng/dracut-ng@ace9e1b)

bsc#1208690
  • Loading branch information
aafeijoo-suse committed Jun 4, 2024
1 parent 2783eee commit 8ef5ca5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/install/dracut-install.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ static int resolve_deps(const char *src)
break;

if (strstr(buf, "cannot be preloaded"))
break;
continue;

if (strstr(buf, destrootdir))
break;
Expand Down

0 comments on commit 8ef5ca5

Please sign in to comment.