[openfabrics-ewg] [PATCH 1/4] IB/iSER: Integrate open-iscsi into the OFED build scripts

Erez Zilber erezz at voltaire.com
Sun Dec 31 05:29:53 PST 2006


Add open-iscsi into configure & Makefile.

Signed-off-by: Erez Zilber <erezz at voltaire.com>

diff -ruN ofa_1_2_kernel-20061228-0200/Makefile ofa_1_2_kernel-20061228-0200-open-iscsi/Makefile
--- ofa_1_2_kernel-20061228-0200/Makefile	2006-12-31 14:49:38.000000000 +0200
+++ ofa_1_2_kernel-20061228-0200-open-iscsi/Makefile	2006-12-31 14:32:38.000000000 +0200
@@ -15,6 +15,8 @@
         export KERNEL_MEMTRACK_CFLAGS =
 endif
 
+export OPEN_ISCSI_MODULES = iscsi_tcp.ko libiscsi.ko scsi_transport_iscsi.ko
+
 configure.mk:
 	@echo Please run ./configure.kernel
 	@exit 1
@@ -75,6 +77,22 @@
 		' \
 		modules
 
+	if [ "$(CONFIG_INFINIBAND_ISER)" == "m" ]; then \
+		echo "Building open-iscsi"; \
+		$(MAKE) -C $(KSRC) SUBDIRS="$(CWD)/drivers/scsi" KERNELRELEASE=$(KVERSION) \
+			EXTRAVERSION=$(EXTRAVERSION) V=1 $(WITH_MAKE_PARAMS) \
+			CONFIG_SCSI_ISCSI_ATTRS=$(CONFIG_SCSI_ISCSI_ATTRS) \
+			CONFIG_ISCSI_TCP=$(CONFIG_ISCSI_TCP) \
+			LINUXINCLUDE=' \
+			$(BACKPORT_INCLUDES) \
+			-I$(CWD)/include \
+			-Iinclude \
+			$$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) \
+			-include include/linux/autoconf.h \
+			-include $(CWD)/include/linux/autoconf.h \
+			' \
+			modules; \
+	fi		
 
 #########################
 #	Install kernel	#
@@ -88,8 +106,15 @@
 		KERNELRELEASE=$(KVERSION) EXTRAVERSION=$(EXTRAVERSION) \
 		INSTALL_MOD_DIR="infiniband" INSTALL_MOD_PATH=$(CWD) \
 		$(WITH_MAKE_PARAMS) modules_install
+	
+	if [ "$(CONFIG_INFINIBAND_ISER)" == "m" ]; then \
+		$(MAKE) -C $(KSRC) SUBDIRS="$(CWD)/drivers/scsi" \
+			KERNELRELEASE=$(KVERSION) EXTRAVERSION=$(EXTRAVERSION) \
+			INSTALL_MOD_DIR="scsi" INSTALL_MOD_PATH=$(CWD) \
+			$(WITH_MAKE_PARAMS) modules_install; \
+	fi
 
-	# Backup original infiniband kernel modules
+	# Backup original infiniband (and open-iscsi if iSER was selected) kernel modules
 	# under 'prefix'/backup directory
 	
 	if [ -d $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/infiniband ]; then \
@@ -100,7 +125,25 @@
 			mv $(DESTDIR)/$(prefix)/backup/infko_tmp.tgz $(DESTDIR)/$(prefix)/backup/infiniband_ko-$(KVERSION).tgz; \
 		fi; \
 		/bin/rm -rf $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/infiniband; \
-	fi
+	fi;
+
+	if [ "$(CONFIG_INFINIBAND_ISER)" == "m" ]; then \
+		if [ -d $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/scsi ]; then \
+			mkdir -p $(DESTDIR)/$(prefix)/backup; \
+			if [ ! -f $(DESTDIR)/$(prefix)/backup/open_iscsi_ko-$(KVERSION).tgz ]; then \
+				open_iscsi_mods_full_path=""; \
+				for open_iscsi_module in $(OPEN_ISCSI_MODULES); \
+				do \
+					open_iscsi_mods_full_path="$(DESTDIR)/$(MODULES_DIR)/kernel/drivers/scsi/$$open_iscsi_module $$open_iscsi_mods_full_path"; \
+				done; \
+				tar czfP $(DESTDIR)/$(prefix)/backup/open_iscsi_ko-$(KVERSION).tgz $$open_iscsi_mods_full_path; \
+			fi; \
+			for open_iscsi_module in $(OPEN_ISCSI_MODULES); \
+			do \
+				(/bin/rm -f $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/scsi/$$open_iscsi_module ); \
+			done; \
+		fi; \
+	fi;
 	
 	# Copy new infiniband kernel modules to $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/infiniband
 	if [ -d $(CWD)/lib/modules/$(KVERSION)/infiniband ]; then \
@@ -112,6 +155,24 @@
 		mv $(CWD)/lib/modules/$(KVERSION)/extra $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/infiniband; \
 	fi
 
+	# If iSER was selected, Copy new open-iscsi kernel modules to $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/scsi	
+	if [ "$(CONFIG_INFINIBAND_ISER)" == "m" ]; then \
+		if [ -d $(CWD)/lib/modules/$(KVERSION)/scsi ]; then \
+			mkdir -p $(DESTDIR)/$(MODULES_DIR)/kernel/drivers; \
+			for open_iscsi_module in $(OPEN_ISCSI_MODULES); \
+			do \
+				(mv $(CWD)/lib/modules/$(KVERSION)/scsi/$$open_iscsi_module $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/scsi ); \
+			done; \
+		fi; \
+		if [ -d $(CWD)/lib/modules/$(KVERSION)/extra ]; then \
+			mkdir -p $(DESTDIR)/$(MODULES_DIR)/kernel/drivers; \
+                        for open_iscsi_module in $(OPEN_ISCSI_MODULES); \
+			do \
+				(mv $(CWD)/lib/modules/$(KVERSION)/extra/$$open_iscsi_module $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/scsi ); \
+			done; \
+		fi; \
+	fi;
+
 	$(DEPMOD) -r -ae $(KVERSION)
 
 clean: clean_kernel
@@ -125,6 +186,16 @@
 		tar xzfP $(DESTDIR)/$(prefix)/backup/infiniband_ko-$(KVERSION).tgz; \
 		/bin/rm -f $(DESTDIR)/$(prefix)/backup/infiniband_ko-$(KVERSION).tgz; \
 	fi
+	if [ "$(CONFIG_INFINIBAND_ISER)" == "m" ]; then \
+		if [ -f $(DESTDIR)/$(prefix)/backup/open_iscsi_ko-$(KVERSION).tgz ]; then \
+                        for open_iscsi_module in $(OPEN_ISCSI_MODULES); \
+                        do \
+                               (/bin/rm $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/scsi/$$open_iscsi_module ); \
+                        done; \
+                        tar xzfP $(DESTDIR)/$(prefix)/backup/open_iscsi_ko-$(KVERSION).tgz; \
+                        /bin/rm -f $(DESTDIR)/$(prefix)/backup/open_iscsi_ko-$(KVERSION).tgz; \
+		fi; \
+	fi;
 
 	$(DEPMOD) -r -ae $(KVERSION)
 
diff -ruN ofa_1_2_kernel-20061228-0200/configure ofa_1_2_kernel-20061228-0200-open-iscsi/configure
--- ofa_1_2_kernel-20061228-0200/configure	2006-12-31 14:49:38.000000000 +0200
+++ ofa_1_2_kernel-20061228-0200-open-iscsi/configure	2006-12-31 14:53:45.000000000 +0200
@@ -555,9 +555,13 @@
                         ;;
                         --with-iser-mod)
                             CONFIG_INFINIBAND_ISER="m"
+                            CONFIG_SCSI_ISCSI_ATTRS="m"
+                            CONFIG_ISCSI_TCP="m"
                         ;;
                         --without-iser-mod)
                             CONFIG_INFINIBAND_ISER=
+                            CONFIG_SCSI_ISCSI_ATTRS=
+                            CONFIG_ISCSI_TCP=
                         ;;
                         --with-ehca-mod)
                             CONFIG_INFINIBAND_EHCA="m"
@@ -667,6 +671,8 @@
 
 CONFIG_INFINIBAND_IPOIB_DEBUG=${CONFIG_INFINIBAND_IPOIB_DEBUG:-''}
 CONFIG_INFINIBAND_ISER=${CONFIG_INFINIBAND_ISER:-''}
+CONFIG_SCSI_ISCSI_ATTRS=${CONFIG_SCSI_ISCSI_ATTRS:-''}
+CONFIG_ISCSI_TCP=${CONFIG_ISCSI_TCP:-''}
 CONFIG_INFINIBAND_EHCA=${CONFIG_INFINIBAND_EHCA:-''}
 CONFIG_INFINIBAND_EHCA_SCALING=${CONFIG_INFINIBAND_EHCA_SCALING:-''}
 CONFIG_INFINIBAND_RDS=${CONFIG_INFINIBAND_RDS:-''}
@@ -728,6 +734,8 @@
 
 CONFIG_INFINIBAND_IPOIB_DEBUG=${CONFIG_INFINIBAND_IPOIB_DEBUG}
 CONFIG_INFINIBAND_ISER=${CONFIG_INFINIBAND_ISER}
+CONFIG_SCSI_ISCSI_ATTRS=${CONFIG_SCSI_ISCSI_ATTRS}
+CONFIG_ISCSI_TCP=${CONFIG_ISCSI_TCP}
 CONFIG_INFINIBAND_EHCA=${CONFIG_INFINIBAND_EHCA}
 CONFIG_INFINIBAND_EHCA_SCALING=${CONFIG_INFINIBAND_EHCA_SCALING}
 CONFIG_INFINIBAND_RDS=${CONFIG_INFINIBAND_RDS}
@@ -797,8 +805,12 @@
 fi
 if [ "X${CONFIG_INFINIBAND_ISER}" == "Xm" ]; then
         DEFINE_INFINIBAND_ISER="#define CONFIG_INFINIBAND_ISER 1"
+        DEFINE_SCSI_ISCSI_ATTRS="#define CONFIG_SCSI_ISCSI_ATTRS 1"
+        DEFINE_ISCSI_TCP="#define CONFIG_ISCSI_TCP 1"
 else
         DEFINE_INFINIBAND_ISER="#undef CONFIG_INFINIBAND_ISER"
+        DEFINE_SCSI_ISCSI_ATTRS="#undef CONFIG_SCSI_ISCSI_ATTRS"
+        DEFINE_ISCSI_TCP="#undef CONFIG_ISCSI_TCP"
 fi
 if [ "X${CONFIG_INFINIBAND_EHCA}" == "Xm" ]; then
         DEFINE_INFINIBAND_EHCA="#define CONFIG_INFINIBAND_EHCA 1"
@@ -918,6 +930,8 @@
 
 ${DEFINE_INFINIBAND_IPOIB_DEBUG}
 ${DEFINE_INFINIBAND_ISER}
+${DEFINE_SCSI_ISCSI_ATTRS}
+${DEFINE_ISCSI_TCP}
 ${DEFINE_INFINIBAND_EHCA}
 ${DEFINE_INFINIBAND_RDS}
 ${DEFINE_INFINIBAND_RDS_DEBUG}






More information about the ewg mailing list