osmith submitted this change.

View Change

Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified
contrib/jenkins.sh: new file

Build the kernel module against a given linux tree. This script will be
used in CI at jenkins.osmocom.org.

Related: OS#5407
Depends: docker-playground Id72d19ad08681cd7cb3194de2226292f19e96df5
Change-Id: I904ab66a1ecd72492642ac2cc4cb102c7283c590
---
A contrib/jenkins.sh
1 file changed, 32 insertions(+), 0 deletions(-)

diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
new file mode 100755
index 0000000..eeb3fbc
--- /dev/null
+++ b/contrib/jenkins.sh
@@ -0,0 +1,32 @@
+#!/bin/sh -ex
+# Build the kernel module against the linux tree in KSRC
+
+DEFCONFIG="${DEFCONFIG:-x86_64_defconfig}"
+TOPDIR="$(realpath "$(dirname "$(realpath "$0")")/..")"
+KSRC="${KSRC:-$TOPDIR/../linux}"
+JOBS="${JOBS:-9}"
+
+if ! [ -d "$KSRC" ]; then
+ set +x
+ echo "ERROR: KSRC does not exist: $KSRC"
+ echo "Let the KSRC env var point at a linux source tree and try again."
+ exit 1
+fi
+
+cd "$KSRC"
+
+if ! [ -e ".config" ]; then
+ make "$DEFCONFIG"
+fi
+
+if [ "arch/x86/configs/$DEFCONFIG" -nt ".config" ]; then
+ set +x
+ echo "ERROR: .config inside kernel source tree is older than $DEFCONFIG"
+ echo "Move/delete/touch .config and try again."
+ exit 1
+fi
+
+git log -1 --pretty="%t - %s"
+
+make -j "$JOBS" modules_prepare
+make -j "$JOBS" -C "$TOPDIR" KSRC="$KSRC"

To view, visit change 27059. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: dahdi-linux
Gerrit-Branch: master
Gerrit-Change-Id: I904ab66a1ecd72492642ac2cc4cb102c7283c590
Gerrit-Change-Number: 27059
Gerrit-PatchSet: 8
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>
Gerrit-MessageType: merged