From f4e0fc096ed1a481acc6392f21244c0a31a55898 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Tue, 12 Jul 2022 13:16:27 +0200 Subject: [PATCH] pkgdep/git: Use $kernel_ver in global scope Preparation for incoming patches in the series. Signed-off-by: Michal Berger Change-Id: I46a9c68b89034793083f536b8d3b20f68ad1482e Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13640 Community-CI: Broadcom CI Reviewed-by: Pawel Piatek Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki Reviewed-by: Kamil Godzwon Tested-by: SPDK CI Jenkins --- test/common/config/pkgdep/git | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/test/common/config/pkgdep/git b/test/common/config/pkgdep/git index 5b3d7ee7d..89790a147 100644 --- a/test/common/config/pkgdep/git +++ b/test/common/config/pkgdep/git @@ -102,10 +102,6 @@ function install_refspdk() { } function install_qat() { - # Dissect the kernel version into maj, min, release and local version - local kernel_maj kernel_min kernel_rel kernel_loc - local kernel_ver - if ! hash yasm; then install yasm fi @@ -114,8 +110,8 @@ function install_qat() { local syms if [[ -e /proc/kallsyms ]]; then syms=/proc/kallsyms - elif [[ -e /boot/System.map-$(< /proc/sys/kernel/osrelease) ]]; then - syms=/boot/System.map-$(< /proc/sys/kernel/osrelease) + elif [[ -e /boot/System.map-$kernel_ver ]]; then + syms=/boot/System.map-$kernel_ver else return 0 fi @@ -123,9 +119,6 @@ function install_qat() { grep -q "$1" "$syms" } - IFS=".-" read -r kernel_{maj,min,rel,loc} < /proc/sys/kernel/osrelease - kernel_ver=$((kernel_maj << 16 | kernel_min << 8 | kernel_rel)) - if [[ -e /sys/module/qat_c62x ]]; then sudo modprobe -r qat_c62x || : fi @@ -447,7 +440,7 @@ function install_ice() { curl -L -o- "$ICE_DRIVER" | tar -C "$GIT_REPOS" -xzf - if [[ $OSID == ubuntu && $OSVERSION == 18.04 ]]; then - if ge "$(< /proc/sys/kernel/osrelease)" 4.15.0-159; then + if ge "$kernel_ver" 4.15.0-159; then patch --dir="$GIT_REPOS/ice-$ICE_VERSION" -p1 fi < "$rootdir/test/common/config/pkgdep/patches/ice/0001-undef-skb-frag-off.patch" fi @@ -586,3 +579,6 @@ export GIT_REPO_BPFTRACE GIT_REPOS=${GIT_REPOS:-$HOME} gcc_version=$(gcc -dumpversion) gcc_version=${gcc_version%%.*} +if [[ -e /proc/sys/kernel/osrelease ]]; then + kernel_ver=$(< /proc/sys/kernel/osrelease) +fi