From 9dcd13d45cd0856717d2a6ac70d91cbcf1bc86f9 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Wed, 22 Jan 2014 17:50:30 +0100 Subject: [PATCH] Make copy_required_libs() more robust On some systems ldd gives a slightly different output for VDSOs. It doesn't contain a '=>'. E.g.: linux-vdso.so.1 (0x00007fff2f4a6000) instead of: linux-vdso.so.1 => (0x00007fff2f4a6000) This patch simply skips all entries in the ldd output which don't expand to a path name to workaround that. Change-Id: Ie37637890b775b36bb31af4e586e61131bd80fa8 --- lib/ramdisk-functions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ramdisk-functions b/lib/ramdisk-functions index aaa269839..ea0a6b392 100644 --- a/lib/ramdisk-functions +++ b/lib/ramdisk-functions @@ -112,12 +112,14 @@ function copy_required_libs() { # /lib64/ld-linux-x86-64.so.2 => /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 (0x00007facff857000) # 4. name to empty (vdso) # linux-vdso.so.1 => (0x00007fff0c5ff000) + # or, in some setups: + # linux-vdso.so.1 (0x00007fff0c5ff000) for i in `echo "$ldd_out" | sed -e 's/^\t*//'`; do local ref=$( echo "$i" | awk -F '[ ]' '{print $1}') local real=$( echo "$i" | awk -F '[ ]' '$2 == "=>" {print $3} $2 != "=>" {print $1}') - if [ -z "$real" ]; then + if [ -z "$real" ] || [[ "$real" != /* ]]; then continue fi if [ "$ref" = "${ref#/}" ]; then