2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

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>
This commit is contained in:
Filipe Brandenburger
2014-08-25 20:53:58 -07:00
committed by Pavel Emelyanov
parent 3a8cf03d94
commit 3b9e9b84f2

View File

@@ -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