X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Flttng-modules%2Fparam-build.sh;h=e580dd41318866e0de4ab3049f580e7c6bb203de;hb=5aacfb5ba36f1d30502e2e2ddc4fce77e613699e;hp=21e219cb33d2a30364312333d7b73a489dbe29ca;hpb=53b51a153a5615633d47cedb589c6ce030332202;p=lttng-ci.git diff --git a/scripts/lttng-modules/param-build.sh b/scripts/lttng-modules/param-build.sh index 21e219c..e580dd4 100644 --- a/scripts/lttng-modules/param-build.sh +++ b/scripts/lttng-modules/param-build.sh @@ -32,6 +32,7 @@ verlte() { } verlt() { + # shellcheck disable=SC2015 [ "$1" = "$2" ] && return 1 || verlte "$1" "$2" } @@ -40,13 +41,22 @@ vergte() { } vergt() { + # shellcheck disable=SC2015 [ "$1" = "$2" ] && return 1 || vergte "$1" "$2" } git_clone_modules_sources() { mkdir -p "$MODULES_GIT_DIR" - git clone --depth=1 -b "${mversion}" "${mgitrepo}" "$MODULES_GIT_DIR" + + # If the version starts with "refs/", checkout the specific git ref, otherwise treat it + # as a branch name. + if [ "${mversion:0:5}" = "refs/" ]; then + git clone --no-tags --depth=1 "${mgitrepo}" "$MODULES_GIT_DIR" + (cd "$MODULES_GIT_DIR" && git fetch origin "${mversion}" && git checkout FETCH_HEAD) + else + git clone --no-tags --depth=1 -b "${mversion}" "${mgitrepo}" "$MODULES_GIT_DIR" + fi } # Checkout a shallow kernel tree of the specified tag @@ -312,9 +322,13 @@ extract_distro_headers() { rm -f "${LINUX_HDROBJ_DIR}/scripts/*.o" rm -f "${LINUX_HDROBJ_DIR}/scripts/*/*.o" - # On powerpc this object is required to link modules + # On powerpc 32bits this object is required to link modules if [ "${karch}" = "powerpc" ]; then - cp -a --parents arch/powerpc/lib/crtsavres.[So] "${LINUX_HDROBJ_DIR}/" + if [ "x$(scripts/config -s CONFIG_PPC64)" = "xy" ] && vergte "${kversion}" "5.4"; then + : + else + cp -a --parents arch/powerpc/lib/crtsavres.[So] "${LINUX_HDROBJ_DIR}/" + fi fi # On arm64 between 4.13 and 1.15 this object is required to build with ftrace support @@ -370,9 +384,13 @@ extract_distro_headers() { # And regen the modules support files make modules_prepare CC="$CC" - # On powerpc this object is required to link modules + # On powerpc 32bits this object is required to link modules if [ "${karch}" = "powerpc" ]; then - make arch/powerpc/lib/crtsavres.o CC="$CC" + if [ "x$(scripts/config -s CONFIG_PPC64)" = "xy" ] && vergte "${kversion}" "5.4"; then + : + else + make arch/powerpc/lib/crtsavres.o CC="$CC" + fi fi # On arm64 between 4.13 and 4.15 this object is required to build with ftrace support @@ -558,7 +576,7 @@ elif [ "x${arch}" != "x" ]; then ;; esac else - echo "Not arch or cross_arch specified" + echo "No arch or cross_arch specified" exit 1 fi