Change in osmo-gsm-tester[master]: jenkins-build-common: adds support to the new variables for patchelf.

pespin gerrit-no-reply at lists.osmocom.org
Fri Jun 11 11:49:11 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24643 )

Change subject: jenkins-build-common: adds support to the new variables for patchelf.
......................................................................

jenkins-build-common: adds support to the new variables for patchelf.

2 variables are added in order to increase the flexibility of the add_rpath function.
patchelf_rpath_extra_args: adds more arguments to the rpath patch. For example "--force-rpath"
patchelf_rpath_dir: path to the libraries. This path is appended to the default '$ORIGIN/../lib/'

This commit add the jenkins-build-srslte-bbu.sh script, that builds the given repository filling the information for the 2 newly added variables.

Change-Id: I9f510112c63e7598add8c00f8573e34cac1b6064
---
M contrib/jenkins-build-common.sh
A contrib/jenkins-build-srslte-bbu.sh
2 files changed, 33 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh
index 9d59ca7..1579c34 100644
--- a/contrib/jenkins-build-common.sh
+++ b/contrib/jenkins-build-common.sh
@@ -204,11 +204,22 @@
 	#
 	# Add an rpath relative to the binary and library if the directory
 	# exists.
+
+  rpath_args='--set-rpath'
+  rpath_dir='$ORIGIN/../lib/'
+  if [ -n "$patchelf_rapth_extra_args" ]; then
+    rpath_args="$patchelf_rapth_extra_args $rpath_args"
+  fi
+
+  if [ -n "$patchelf_rpath_dir" ]; then
+    rpath_dir="$rpath_dir:$patchelf_rpath_dir"
+  fi
+
 	if [ -d bin/ ]; then
-		find bin -depth -type f -exec patchelf --set-rpath '$ORIGIN/../lib/' {} \;
+		find bin -depth -type f -exec patchelf $rpath_args "$rpath_dir" {} \;
 	fi
 	if [ -d sbin/ ]; then
-		find sbin -depth -type f -exec patchelf --set-rpath '$ORIGIN/../lib/' {} \;
+		find sbin -depth -type f -exec patchelf $rpath_args "$rpath_dir" {} \;
 	fi
 	if [ -d lib/ ]; then
 		find lib -depth -type f -name "lib*.so.*" -exec patchelf --set-rpath '$ORIGIN/' {} \;
diff --git a/contrib/jenkins-build-srslte-bbu.sh b/contrib/jenkins-build-srslte-bbu.sh
new file mode 100755
index 0000000..48ae622
--- /dev/null
+++ b/contrib/jenkins-build-srslte-bbu.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+set -e -x
+
+if [ -z "$trial_binaries" ]; then
+  trial_binaries="srsue srsenb srsepc"
+fi
+
+export patchelf_rpath_dir="/mnt/nfs/bdlibs"
+export patchelf_rapth_extra_args="--force-rpath"
+
+base="$PWD"
+name="srslte"
+git_url="${git_url:-https://github.com/srsLTE}"
+project_name="${project_name:-srsLTE}"
+. "$(dirname "$0")/jenkins-build-common.sh"
+
+#TODO: make sure libconfig, zeroMQ is installed
+build_repo $project_name $configure_opts
+
+create_bin_tgz "$trial_binaries"

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/24643
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I9f510112c63e7598add8c00f8573e34cac1b6064
Gerrit-Change-Number: 24643
Gerrit-PatchSet: 2
Gerrit-Owner: alealcon <alejandro.leal at srs.io>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210611/094f7704/attachment.htm>


More information about the gerrit-log mailing list