From 2eabd72416ed17f69edd096248822a29374c6922 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 30 Nov 2016 03:14:03 +0000 Subject: [PATCH] Merged revisions 7032,7034,7037 via svnmerge from svn+ssh://svn.code.sf.net/p/scst/svn/trunk ........ r7032 | bvassche | 2016-11-24 08:53:00 -0800 (Thu, 24 Nov 2016) | 6 lines scripts/generate-kernel-patch: Revert r7022 Revert r7022 because: * Changing $kver3 into $kver is wrong for 2.x kernels. * Building include/iscsi_scst_itf_ver.h must not depend on the kernel version. ........ r7034 | bvassche | 2016-11-24 09:32:40 -0800 (Thu, 24 Nov 2016) | 7 lines iscsi-scst/Makefile: Fix INFINIBAND_ENABLED test Running "make install" ensures that the kernel config file is available in $(KDIR)/.config. However, that file is not available if $(KDIR) points at a kernel that comes from a Linux distributor. Hence change the $(INFINIBAND_ENABLED) test to check $(KDIR)/../modules.symbols. ........ r7037 | vlnb | 2016-11-29 19:06:38 -0800 (Tue, 29 Nov 2016) | 9 lines generate-kernel-patch: fix custom cross-compilation kernel case Otherwise there is non-fatal error like: No such file or directory grep: /lib/modules//build/.config: Permission denied This is a better version of r7022 suggested by Bart ........ git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.2.x@7038 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/Makefile | 5 ++++- scripts/generate-kernel-patch | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/iscsi-scst/Makefile b/iscsi-scst/Makefile index 5cab2239d..421b77325 100644 --- a/iscsi-scst/Makefile +++ b/iscsi-scst/Makefile @@ -48,7 +48,7 @@ ifeq ($(INSTALL_MOD_PATH),) endif INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra -INFINIBAND_ENABLED := $(shell if grep -q '^CONFIG_INFINIBAND=[my]$$' $(KDIR)/.config; then echo true; else echo false; fi) +INFINIBAND_ENABLED = $(shell if grep -wq 'ib_register_client' $$(dirname "$(KDIR)")/modules.symbols; then echo true; else echo false; fi) all: progs mods @@ -112,6 +112,7 @@ PRE_CFLAGS=$(OFED_CFLAGS) $(CREATE_CQ_FLAG) -DOFED_FLAVOR=$(OFED_FLAVOR) mods: include/iscsi_scst_itf_ver.h Modules.symvers Module.symvers $(MAKE) -C $(KDIR) SCST_INC_DIR=$(SCST_INC_DIR) SUBDIRS=$(KMOD) modules + echo "$@: INFINIBAND_ENABLED = $(INFINIBAND_ENABLED)" if $(INFINIBAND_ENABLED); then \ echo " Building against $(OFED_FLAVOR) InfiniBand kernel headers."; \ $(MAKE) -C $(KDIR) SCST_INC_DIR=$(SCST_INC_DIR) SUBDIRS=$(ISERTMOD) \ @@ -138,6 +139,7 @@ install: all $(MAKE) -C $(KDIR) SCST_INC_DIR=$(SCST_INC_DIR) SUBDIRS=$(KMOD) \ $$([ -n "$(DESTDIR)$(INSTALL_MOD_PATH)" ] && echo DEPMOD=true) \ modules_install + echo "$@: INFINIBAND_ENABLED = $(INFINIBAND_ENABLED)" if $(INFINIBAND_ENABLED); then \ $(MAKE) -C $(KDIR) SCST_INC_DIR=$(SCST_INC_DIR) SUBDIRS=$(ISERTMOD) \ $$([ -n "$(DESTDIR)$(INSTALL_MOD_PATH)" ] && echo DEPMOD=true) \ @@ -159,6 +161,7 @@ ifneq ($(SCST_MOD_VERS),) Modules.symvers: $(SCST_DIR)/Modules.symvers echo $(SCST_MOD_VERS) cp $(SCST_DIR)/Modules.symvers kernel/ + echo "$@: INFINIBAND_ENABLED = $(INFINIBAND_ENABLED)" if $(INFINIBAND_ENABLED); then \ cp $(SCST_DIR)/Modules.symvers kernel/isert-scst; \ fi diff --git a/scripts/generate-kernel-patch b/scripts/generate-kernel-patch index 6af9fd0de..89fab2cd1 100755 --- a/scripts/generate-kernel-patch +++ b/scripts/generate-kernel-patch @@ -114,7 +114,7 @@ function specialize_patch { fi | "$(dirname $0)/specialize-patch" \ ${specialize_patch_options} \ - -v kernel_version="${kver}" \ + -v kernel_version="${kver3}" \ -v SCSI_EXEC_REQ_FIFO_DEFINED="${scsi_exec_req_fifo_defined}" \ -v SCST_IO_CONTEXT="${scst_io_context}" else @@ -478,7 +478,7 @@ add_file "fcst/README" "Documentation/scst/README.fcst" \ # Directory drivers/scst/iscsi-scst/ # Make sure the file iscsi-scst/iscsi_scst_itf_ver.h is up to date. -make KVER=${kver3} -s -C iscsi-scst include/iscsi_scst_itf_ver.h +make -s -C iscsi-scst include/iscsi_scst_itf_ver.h ( for f in $(ls iscsi-scst/include/*h 2>/dev/null)