]> git.ipfire.org Git - thirdparty/dracut.git/commit
dracut-install: simplify ldd parsing logic
authorMike Gilbert <floppym@gentoo.org>
Thu, 4 Oct 2018 20:45:47 +0000 (16:45 -0400)
committerHarald Hoyer <harald@hoyer.xyz>
Tue, 9 Oct 2018 11:38:47 +0000 (13:38 +0200)
commit6d886bb74d1608e4565d926aa259ea5afc9df7b9
tree3fe529b1f279bf5f0d1dd959dfb01c7659f08dda
parent225e4b94cbdb702cf512490dcd2ad9ca5f5b22c1
dracut-install: simplify ldd parsing logic

The previous logic would not handle absolute paths on the left side of
the "=>" properly. For example, on Gentoo ARM64, ldd outputs this:

/lib/ld-linux-aarch64.so.1 => /lib64/ld-linux-aarch64.so.1

At runtime, the kernel tries to load the file from /lib, and fails if we
only provide it in /lib64.

Instead of looking for the first slash after the "=>", just look for the
first slash, period. This would fail if we somehow had a relative path
on the left side (foo/libbar.so), but I'm not aware of any binaries that
would contain such an entry in DT_NEEDED.

Bug: https://bugs.gentoo.org/667752
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
install/dracut-install.c