Skip to content

Commit 45404a2

Browse files
committed
dracut-install,dracut: fix ldd output parsing
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
1 parent 7e916ae commit 45404a2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

dracut.sh

+1
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ export LC_ALL=C
548548
export LANG=C
549549
unset NPATH
550550
unset LD_LIBRARY_PATH
551+
unset LD_PRELOAD
551552
unset GREP_OPTIONS
552553

553554
export DRACUT_LOG_LEVEL=warning

install/dracut-install.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,11 @@ static int resolve_deps(const char *src)
392392
if (strstr(buf, destrootdir))
393393
break;
394394

395-
p = strchr(buf, '/');
395+
p = strstr(buf, "=>");
396+
if (!p)
397+
p = buf;
398+
399+
p = strchr(p, '/');
396400
if (p) {
397401
for (q = p; *q && *q != ' ' && *q != '\n'; q++) ;
398402
*q = '\0';

0 commit comments

Comments
 (0)