diff options
author | Filipe Brandenburger <filbranden@google.com> | 2014-08-26 07:53:58 +0400 |
---|---|---|
committer | Pavel Emelyanov <xemul@parallels.com> | 2014-08-26 13:08:56 +0400 |
commit | 3b9e9b84f2ac7580b3b7f913026098cb47f88fbd (patch) | |
tree | 659fceeeecfd7a5142be6488470aea8c126240e8 | |
parent | 3a8cf03d9478013efdc87bb099f3e37d58231cfb (diff) |
test: enhance library lookup when building mntns root
Use a single awk script to parse the ldd output. Filter out other cases that
are clearly not libraries, such as static builds ("not a dynamic executable")
and linux-gate.so. Make the grep for vdso more specific into linux-vdso.so.
Tested:
- sudo test/zdtm.sh '^ns/.*'
Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
-rwxr-xr-x | test/zdtm.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/zdtm.sh b/test/zdtm.sh index 06152a658..cfbdce27e 100755 --- a/test/zdtm.sh +++ b/test/zdtm.sh @@ -337,7 +337,15 @@ construct_root() # libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6dc5000) # /lib/ld-linux-armhf.so.3 (0xb6f0b000) - for i in `ldd $test_path $ps_path | grep -P '^\s' | grep -v vdso | sed "s/.*=> //" | awk '{ print $1 }'`; do + local libs=$(ldd $test_path $ps_path | awk ' + !/^[ \t]/ { next } + /\<linux-vdso\.so\>/ { next } + /\<linux-gate\.so\>/ { next } + /\<not a dynamic executable$/ { next } + $2 ~ /^=>$/ { print $3; next } + { print $1 } + ') + for i in ${libs}; do local ldir lib=`basename $i` [ -f $libdir2/$lib ] && continue # fast path |