From 8e862c6d9b403fd4b0a2d31ca52e326e02e350ac Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 30 May 2019 13:41:27 +0000 Subject: [PATCH] iscsi-scst, srpt: Restore MOFED_MAJOR and MOFED_MINOR definitions This patch reverts commit bcdb25e550bb (r7363). git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8397 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/Makefile | 4 +++- scripts/specialize-patch | 18 ++++++++++++++++++ srpt/Makefile | 2 ++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/iscsi-scst/Makefile b/iscsi-scst/Makefile index aa1c03584..52d9410c0 100644 --- a/iscsi-scst/Makefile +++ b/iscsi-scst/Makefile @@ -81,7 +81,9 @@ ifeq ($(OFED_FLAVOR),MOFED) OFED_DIR:=/usr/src/ofa_kernel/default OFED_CFLAGS:= -I$(OFED_DIR)/include \ -I$(OFED_DIR)/include/uapi \ - -include $(OFED_DIR)/include/linux/compat-2.6.h + -include $(OFED_DIR)/include/linux/compat-2.6.h \ + -DMOFED_MAJOR=$(shell echo $(OFED_VERS) | cut -f1 -d.)\ + -DMOFED_MINOR=$(shell echo $(OFED_VERS) | cut -f2 -d.) ISER_SYMVERS:="$(ISER_SYMVERS) $(OFED_DIR)/$(MODULE_SYMVERS)" OFED_CONFIG:= CONFIG_DTRACE= else diff --git a/scripts/specialize-patch b/scripts/specialize-patch index 19fb9d933..9c59e1bf3 100755 --- a/scripts/specialize-patch +++ b/scripts/specialize-patch @@ -197,6 +197,22 @@ function evaluate(stmnt, pattern, arg, op, result) { "(\\1) * 256 + (\\2)", "g", stmnt) } + if (MOFED_MAJOR == "") { + gsub("defined\\(MOFED_MAJOR\\)", "0", stmnt) + gsub("MOFED_MAJOR", "", stmnt) + } else { + gsub("defined\\(MOFED_MAJOR\\)", "1", stmnt) + gsub("MOFED_MAJOR", MOFED_MAJOR, stmnt) + } + + if (MOFED_MINOR == "") { + gsub("defined\\(MOFED_MINOR\\)", "0", stmnt) + gsub("MOFED_MINOR", "", stmnt) + } else { + gsub("defined\\(MOFED_MINOR\\)", "1", stmnt) + gsub("MOFED_MINOR", MOFED_MINOR, stmnt) + } + gsub("defined\\(UEK_KABI_RENAME\\)", "0", stmnt) if (SCSI_EXEC_REQ_FIFO_DEFINED != "") @@ -384,6 +400,8 @@ function handle_if(evaluated) || $0 ~ "IB_QUERY_GID_HAS_ATTR_ARG" \ || $0 ~ "INSIDE_KERNEL_TREE" \ || $0 ~ "MAD_HANDLER_TAKES_SEND_BUF" \ + || $0 ~ "MOFED_MAJOR" \ + || $0 ~ "MOFED_MINOR" \ || $0 ~ "RDMA_CREATE_ID_TAKES_NET_ARG" \ || $0 ~ "REGISTER_MAD_AGENT_HAS_FLAGS_ARG" \ || $0 ~ "RHEL_MAJOR" \ diff --git a/srpt/Makefile b/srpt/Makefile index 159a15577..d262a64dc 100644 --- a/srpt/Makefile +++ b/srpt/Makefile @@ -67,6 +67,8 @@ OFED_VERS=$(OFED_RPM_VERS)$(OFED_DEB_VERS) OFED_CFLAGS:=-I$(OFED_KERNEL_DIR)/include \ -I$(OFED_KERNEL_DIR)/include/uapi \ -include "linux/compat-2.6.h" +OFED_CFLAGS+=-DMOFED_MAJOR=$(shell echo "$(OFED_VERS)" | sed 's/\([0-9]\+\)[^0-9]\+\([0-9]\+\).*/\1/g') +OFED_CFLAGS+=-DMOFED_MINOR=$(shell echo "$(OFED_VERS)" | sed 's/\([0-9]\+\)[^0-9]\+\([0-9]\+\).*/\2/g') else # OFED 1.5 OFED_KERNEL_DIR:=/usr/src/ofa_kernel