osmith submitted this change.
testenv: qemu_initrd_add_bin: support adding so
Erlang has its own library loading mechanism, so we need to explicitly
add the depending libraries to the initramfs instead of just pointing at
binaries.
Change-Id: I1b9f06e7bff22b9260fbe0bd765177a25e97b557
---
M _testenv/data/scripts/qemu/qemu_functions.sh
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/_testenv/data/scripts/qemu/qemu_functions.sh b/_testenv/data/scripts/qemu/qemu_functions.sh
index efbdd2d..c1ef8b8 100755
--- a/_testenv/data/scripts/qemu/qemu_functions.sh
+++ b/_testenv/data/scripts/qemu/qemu_functions.sh
@@ -51,19 +51,27 @@
done
}
-# Add binaries with depending libraries
-# $@: paths to binaries
+# Add binaries/libraries with depending libraries
+# $@: paths to binaries/libraries
qemu_initrd_add_bin() {
local bin
local bin_path
local file
for bin in "$@"; do
- local bin_path="$(which "$bin")"
- if [ -z "$bin_path" ]; then
- echo "ERROR: file not found: $bin"
- exit 1
- fi
+ local bin_path
+ case "$bin" in
+ /*)
+ bin_path="$bin"
+ ;;
+ *)
+ bin_path="$(which "$bin")"
+ if [ -z "$bin_path" ]; then
+ echo "ERROR: file not found: $bin"
+ exit 1
+ fi
+ ;;
+ esac
lddtree_out="$(lddtree -l "$bin_path")"
if [ -z "$lddtree_out" ]; then
To view, visit change 40318. To unsubscribe, or for help writing mail filters, visit settings.