From: Vladimir Sokolovsky Date: Thu, 13 Feb 2014 08:17:49 +0000 (+0200) Subject: gen-compat-config.sh: Fix SLES11 SP3 detection X-Git-Tag: vofed-3.12~29 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=2abe47343702879f2aa9ac4389bcf9dfd00636b1;p=~emulex%2Fcompat-rdma_3.12.git gen-compat-config.sh: Fix SLES11 SP3 detection Signed-off-by: Vladimir Sokolovsky --- diff --git a/ofed_scripts/gen-compat-config.sh b/ofed_scripts/gen-compat-config.sh index cc0e4d9..c27e148 100755 --- a/ofed_scripts/gen-compat-config.sh +++ b/ofed_scripts/gen-compat-config.sh @@ -75,12 +75,14 @@ if [[ ${CONFIG_COMPAT_KERNEL_3_2} = "y" ]]; then set_config CONFIG_COMPAT_USE_LRO y fi -SLES_11_3_KERNEL=$(echo ${KVERSION} | sed -n 's/^\(3\.0\.76\+\)\-\(.*\)\-\(.*\)/\1-\2-\3/p') -if [[ ! -z ${SLES_11_3_KERNEL} ]]; then +case ${KVERSION} in + 3.0.7[6-9]-[0-9].[0-9]* | 3.0.[8-9][0-9]-[0-9].[0-9]* | 3.0.[1-9][0-9][0-9]-[0-9].[0-9]*) + SLES_11_3_KERNEL=${KVERSION} SLES_MAJOR="11" SLES_MINOR="3" set_config CONFIG_COMPAT_SLES_11_3 y -fi + ;; +esac SLES_11_2_KERNEL=$(echo ${KVERSION} | sed -n 's/^\(3\.0\.[0-9]\+\)\-\(.*\)\-\(.*\)/\1-\2-\3/p') if [[ ! -z ${SLES_11_2_KERNEL} ]]; then @@ -149,7 +151,8 @@ if [[ ${CONFIG_COMPAT_SLES_11_2} = "y" ]]; then set_config CONFIG_COMPAT_EN_SYSFS y fi -if [[ ${CONFIG_COMPAT_SLES_11_3} = "y" ]]; then +if (grep -q 'scsi_target_unblock(struct device \*, enum scsi_device_state)' ${KLIB_BUILD}/include/scsi/scsi_device.h > /dev/null 2>&1 || + grep -q 'scsi_target_unblock(struct device \*, enum scsi_device_state)' /lib/modules/${KVERSION}/source/include/scsi/scsi_device.h > /dev/null 2>&1); then set_config CONFIG_COMPAT_SCSI_TARGET_UNBLOCK y fi