osmith submitted this change.

View Change

Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve
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.

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I1b9f06e7bff22b9260fbe0bd765177a25e97b557
Gerrit-Change-Number: 40318
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>