From 34a56ef337ebd6064b35ac74c73183827568170c Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 29 Jun 2014 05:20:31 +0000 Subject: [PATCH] ib_srpt: Remove existing ib_srpt.ko kernel modules before installation (merge r5621, r5628 and r5630 from trunk) git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5633 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst.spec.in | 2 ++ srpt/Makefile | 13 +++---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/scst.spec.in b/scst.spec.in index 7271c67f4..4dc2ff9b8 100644 --- a/scst.spec.in +++ b/scst.spec.in @@ -90,6 +90,8 @@ rm -f /usr/local/man/man8/iscsi-scstd.8 rm -f /usr/local/sbin/iscsi-scst-adm rm -f /usr/local/sbin/iscsi-scstd rm -rf /usr/local/include/scst +# Remove existing ib_srpt.ko kernel modules +find /lib/modules/%{kver} -name ib_srpt.ko -exec rm {} \; %post /sbin/depmod -a %{kver} diff --git a/srpt/Makefile b/srpt/Makefile index 4a4c2efd4..173c48144 100644 --- a/srpt/Makefile +++ b/srpt/Makefile @@ -75,12 +75,6 @@ endif OFED_MODULE_SYMVERS:=$(OFED_KERNEL_DIR)/Module.symvers endif -# Path of the OFED ib_srpt.ko kernel module. -OFED_SRPT_PATH:=/lib/modules/$(KVER)/updates/kernel/drivers/infiniband/ulp/srpt/ib_srpt.ko - -# Whether or not the OFED ib_srpt.ko kernel module has been installed. -OFED_SRPT_INSTALLED:=$(shell if [ -e $(OFED_SRPT_PATH) ]; then echo true; else echo false; fi) - HAVE_KCFLAGS = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/kcflags KCFLAGS=-DKCFLAGS_MACRO=1 >/dev/null 2>&1 && echo true || echo false) HAVE_PRE_CFLAGS = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/pre_cflags PRE_CFLAGS=-DPRE_CFLAGS_MACRO=1 >/dev/null 2>&1 && echo true || echo false) AUTOCONF_FLAGS = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/gid_change PRE_CFLAGS="$(OFED_CFLAGS)" >/dev/null 2>&1 && echo -DHAVE_IB_EVENT_GID_CHANGE) @@ -92,6 +86,9 @@ all: src/$(MODULE_SYMVERS) KCFLAGS="$(AUTOCONF_FLAGS)" SCST_INC_DIR=$(SCST_INC_DIR) modules install: all src/ib_srpt.ko + @[ -z "$(DESTDIR)$(INSTALL_MOD_PATH)" ] && \ + find /lib/modules/$(KVER) -name ib_srpt.ko -exec rm {} \; ; \ + true $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src \ PRE_CFLAGS="$(OFED_CFLAGS)" SCST_INC_DIR=$(SCST_INC_DIR) \ modules_install @@ -116,10 +113,6 @@ src/Module.symvers src/Modules.symvers: $(SCST_SYMVERS_DIR)/$(MODULE_SYMVERS) "must be removed first" \ " (/lib/modules/$(KVER)/kernel/drivers/infiniband)."; \ false; \ - elif $(OFED_SRPT_INSTALLED); then \ - echo "Error: OFED has been built with srpt=y in ofed.conf."; \ - echo "Rebuild OFED with srpt=n."; \ - false; \ elif [ "$(HAVE_PRE_CFLAGS)" = false ]; then \ echo "Error: the kernel build system has not yet been patched.";\ false; \