]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-install,dracut: fix ldd output parsing
authorHarald Hoyer <harald@redhat.com>
Fri, 17 Jan 2014 10:52:43 +0000 (11:52 +0100)
committerHarald Hoyer <harald@redhat.com>
Fri, 17 Jan 2014 13:52:01 +0000 (14:52 +0100)
dracut-install could not handle output like:
/lib/$LIB/liblsp.so => /lib/lib64/liblsp.so (0x00007faf00727000)

also unset LD_PRELOAD, so we get a clean environment

dracut.sh
install/dracut-install.c

index 2cfba5088492c0f06b65ba0d5392180b867e74b4..7ae5a58b379d54ac33d63989ebe9c1e270d11d45 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -548,6 +548,7 @@ export LC_ALL=C
 export LANG=C
 unset NPATH
 unset LD_LIBRARY_PATH
+unset LD_PRELOAD
 unset GREP_OPTIONS
 
 export DRACUT_LOG_LEVEL=warning
index 397aa621b0e8c9deb9e6a4789294f9e51cc9c8c3..5b97cdd39e895d0cc13189a4a0d17499f7c3299c 100644 (file)
@@ -392,7 +392,11 @@ static int resolve_deps(const char *src)
                 if (strstr(buf, destrootdir))
                         break;
 
-                p = strchr(buf, '/');
+                p = strstr(buf, "=>");
+                if (!p)
+                        p = buf;
+
+                p = strchr(p, '/');
                 if (p) {
                         for (q = p; *q && *q != ' ' && *q != '\n'; q++) ;
                         *q = '\0';