[packages/unh_iscsi] - up to 2.0, disabled kernel (2.6.x) module building

qboosh qboosh at pld-linux.org
Sun Mar 17 16:02:59 CET 2024


commit 99171c4cdebb2eb4b1cb06937bbb6345a06713d1
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Mar 17 15:24:40 2024 +0100

    - up to 2.0, disabled kernel (2.6.x) module building

 unh_iscsi-format.patch  |  11 ++++
 unh_iscsi-headers.patch |  30 +++++++----
 unh_iscsi-sh.patch      |  11 ++++
 unh_iscsi.spec          | 141 +++++++++++++++++++++---------------------------
 4 files changed, 102 insertions(+), 91 deletions(-)
---
diff --git a/unh_iscsi.spec b/unh_iscsi.spec
index de7cfe4..38229e5 100644
--- a/unh_iscsi.spec
+++ b/unh_iscsi.spec
@@ -3,28 +3,29 @@
 #
 # Conditional build:
 %bcond_without	dist_kernel	# allow non-distribution kernel
-%bcond_without	kernel		# don't build kernel modules
-%bcond_without	smp		# don't build SMP module
-%bcond_without	userspace	# don't build userspace module
+%bcond_with	kernel		# kernel modules (2.6.x)
+%bcond_without	userspace	# userspace package
 %bcond_with	verbose		# verbose build (V=1)
 #
-%define		_rel 1
+%define	rel	0.1
 Summary:	UNH iSCSI Initiator/Target for Linux
 Summary(pl.UTF-8):	Sterowniki UNH iSCSI Initiator/Target dla Linuksa
 Name:		unh_iscsi
-Version:	1.6.00
-Release:	%{_rel}
-License:	GPL
+Version:	2.0
+Release:	%{rel}
+License:	GPL v2+
 Group:		Base/Kernel
-Source0:	http://dl.sourceforge.net/unh-iscsi/%{name}-%{version}.tar.gz
-# Source0-md5:	086e09a2cb48f0020ff6602aa5e34cf4
-Source1:	%{name}.init
-Source2:	%{name}.sysconfig
+Source0:	https://downloads.sourceforge.net/unh-iscsi/unh-iscsi-%{version}.tar.bz2
+# Source0-md5:	5759e3a7bafaeb72f2d7ce0992b06f7e
+# not found in repo
+#Source1:	%{name}.init
+#Source2:	%{name}.sysconfig
 Patch0:		%{name}-headers.patch
-URL:		http://unh-iscsi.sourceforge.net/
+Patch1:		%{name}-sh.patch
+Patch2:		%{name}-format.patch
+URL:		https://unh-iscsi.sourceforge.net/
 %{?with_dist_kernel:BuildRequires:	kernel-headers >= 2.6.0}
 BuildRequires:	rpmbuild(macros) >= 1.268
-BuildRequires:	sysfsutils-static
 Requires(post,preun):	/sbin/chkconfig
 Requires:	rc-scripts
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -44,9 +45,10 @@ Networking (SAN) (draft 20).
 %package -n kernel-unh_iscsi
 Summary:	UNH ISCSI kernel module
 Summary(pl.UTF-8):	Moduł jądra UNH ISCSI
-Release:	%{_rel}@%{_kernel_ver_str}
+Release:	%{rel}@%{_kernel_ver_str}
 Group:		Base/Kernel
 Requires:	%{name} = %{version}-%{release}
+Obsoletes:	kernel-smp-unh_iscsi < 2
 
 %description -n kernel-unh_iscsi
 IP over SCSI kernel module.
@@ -54,80 +56,60 @@ IP over SCSI kernel module.
 %description -n kernel-unh_iscsi -l pl.UTF-8
 Moduł jądra dla protokołu IP over SCSI.
 
-%package -n kernel-smp-unh_iscsi
-Summary:	ISCSI SMP kernel module
-Summary(pl.UTF-8):	Moduł jądra SMP ISCSI
-Release:	%{_rel}@%{_kernel_ver_str}
-Group:		Base/Kernel
-Requires:	%{name} = %{version}-%{release}
-
-%description -n kernel-smp-unh_iscsi
-IP over SCSI SMP kernel module.
-
-%description -n kernel-smp-unh_iscsi -l pl.UTF-8
-Moduł jądra SMP dla protokołu IP over SCSI.
-
 %prep
-%setup -q -n %{name}.%{version}
+%setup -q -n unh-iscsi-%{version}
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
-%build
-cd src
-cp Makefile-26 Makefile
+%{__sed} -i -e 's/ -Werror//' Makefile-user
 
+%build
 %if %{with kernel}
 echo "#define OUR_NAME \"PLD Linux %{name}/%{version} for kernel %{_kernel_ver_str}.\"" > initiator/version.h
 
 # kernel module(s)
-for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
-	if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
-		exit 1
-	fi
-	rm -rf include
-	install -d include/{linux,config}
-	ln -sf %{_kernelsrcdir}/config-$cfg .config
-	ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h include/linux/autoconf.h
-	ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
-	ln -sf %{_kernelsrcdir}/Module.symvers-$cfg Module.symvers
-	touch include/config/MARKER
-
-	%{__make} -C %{_kernelsrcdir} clean \
-		RCS_FIND_IGNORE="-name '*.ko' -o" \
-		M=$PWD O=$PWD \
-		%{?with_verbose:V=1}
-		%{__make} -C %{_kernelsrcdir} modules \
-		M=$PWD O=$PWD \
-		%{?with_verbose:V=1}
-
-	for mod in unh_iscsi_initiator unh_iscsi_target unh_scsi_target; do
-		mv ${mod}{,-$cfg}.ko
-	done
-done
+if [ ! -r "%{_kernelsrcdir}/.config" ]; then
+	exit 1
+fi
+rm -rf include
+install -d include/{linux,config}
+ln -sf %{_kernelsrcdir}/include/linux/autoconf.h include/linux/autoconf.h
+ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
+ln -sf %{_kernelsrcdir}/Module.symvers Module.symvers
+touch include/config/MARKER
+
+%{__make} -C %{_kernelsrcdir} clean \
+	RCS_FIND_IGNORE="-name '*.ko' -o" \
+	M=$PWD O=$PWD \
+	%{?with_verbose:V=1}
+%{__make} -C %{_kernelsrcdir} modules \
+	M=$PWD O=$PWD \
+	%{?with_verbose:V=1}
 %endif
 
+CFLAGS="%{rpmcflags} -D_DEFAULT_SOURCE" \
+%{__make} -f Makefile-user \
+	CC="%{__cc}"
+
 %{__make} -C cmd \
 	CC="%{__cc}" \
-	CFLAGS="%{rpmcflags}"
+	CFLAGS="%{rpmcflags} -D_DEFAULT_SOURCE"
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man{1,5,8},/etc/{rc.d/init.d,sysconfig}}
 
-cd src
 %if %{with kernel}
 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
 for mod in unh_iscsi_initiator unh_iscsi_target unh_scsi_target; do
-	install ${mod}-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
+	install ${mod}.ko \
 		$RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/${mod}.ko
-%if %{with smp} && %{with dist_kernel}
-	install ${mod}-smp.ko \
-		$RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/${mod}.ko
-%endif
 done
 %endif
 
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
-install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+#install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+#cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
 
 install cmd/{iscsi_config,iscsi_connect,iscsi_disconnect,iscsi_manage,iscsi_mount,iscsi_rebuild,iscsi_test,iscsi_umount} \
 	$RPM_BUILD_ROOT%{_sbindir}
@@ -141,12 +123,6 @@ rm -rf $RPM_BUILD_ROOT
 %postun -n kernel-unh_iscsi
 %depmod %{_kernel_ver}
 
-%post -n kernel-smp-unh_iscsi
-%depmod %{_kernel_ver}smp
-
-%postun -n kernel-smp-unh_iscsi
-%depmod %{_kernel_ver}smp
-
 %post
 /sbin/chkconfig --add %{name}
 #%%service %{name} start
@@ -160,20 +136,23 @@ fi
 %if %{with userspace}
 %files
 %defattr(644,root,root,755)
-%doc src/docs/* src/CHANGELOG
-%attr(755,root,root) %{_sbindir}/*
-%attr(754,root,root) /etc/rc.d/init.d/%{name}
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
+%doc CHANGELOG README TODO docs/{DISKIO_MODE,ENTRY-POINTS-INI,FIELD.GRID,INI-*,ISCSI_*,KEY.GRID,OVERVIEW*,TARGET_*,USER_SPACE,crc_v3.txt,iSER_MEMORY,iscsi_manage_keys}
+%attr(755,root,root) %{_sbindir}/iscsi_config
+%attr(755,root,root) %{_sbindir}/iscsi_connect
+%attr(755,root,root) %{_sbindir}/iscsi_disconnect
+%attr(755,root,root) %{_sbindir}/iscsi_manage
+%attr(755,root,root) %{_sbindir}/iscsi_mount
+%attr(755,root,root) %{_sbindir}/iscsi_rebuild
+%attr(755,root,root) %{_sbindir}/iscsi_test
+%attr(755,root,root) %{_sbindir}/iscsi_umount
+#%attr(754,root,root) /etc/rc.d/init.d/%{name}
+#%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
 %endif
 
 %if %{with kernel}
 %files -n kernel-unh_iscsi
 %defattr(644,root,root,755)
-/lib/modules/%{_kernel_ver}/misc/*
-
-%if %{with smp} && %{with dist_kernel}
-%files -n kernel-smp-unh_iscsi
-%defattr(644,root,root,755)
-/lib/modules/%{_kernel_ver}smp/misc/*
-%endif
+/lib/modules/%{_kernel_ver}/misc/unh_iscsi_initiator.ko*
+/lib/modules/%{_kernel_ver}/misc/unh_iscsi_target.ko*
+/lib/modules/%{_kernel_ver}/misc/unh_scsi_target.ko*
 %endif
diff --git a/unh_iscsi-format.patch b/unh_iscsi-format.patch
new file mode 100644
index 0000000..c800d2f
--- /dev/null
+++ b/unh_iscsi-format.patch
@@ -0,0 +1,11 @@
+--- unh-iscsi-2.0/datamover/iser_pdu.c.orig	2008-05-28 20:54:49.000000000 +0200
++++ unh-iscsi-2.0/datamover/iser_pdu.c	2024-03-17 14:40:21.025430319 +0100
+@@ -916,7 +916,7 @@ void iser_pdu_print(char *prefix,	//!< s
+ 	__u32 opcode;
+ 	int max_data_print_len = 0x1000;
+ 
+-	PRINT_BUFF_CAT(prefix);
++	PRINT_BUFF_CAT("%s", prefix);
+ 	if ((char *) p_id != NULL)
+ 		PRINT_BUFF_CAT("(0x%p): ", (char *) p_id);
+ 
diff --git a/unh_iscsi-headers.patch b/unh_iscsi-headers.patch
index 8be407f..d098bce 100644
--- a/unh_iscsi-headers.patch
+++ b/unh_iscsi-headers.patch
@@ -1,11 +1,21 @@
-diff -urN unh_iscsi.1.5.03.org/src/common/iscsi_common.c unh_iscsi.1.5.03/src/common/iscsi_common.c
---- unh_iscsi.1.5.03.org/src/common/iscsi_common.c	2004-06-15 03:08:02.283380912 +0200
-+++ unh_iscsi.1.5.03/src/common/iscsi_common.c	2004-06-15 03:08:56.081202400 +0200
-@@ -35,7 +35,6 @@
- #include <linux/socket.h>
- #include <linux/net.h>
- #include <linux/in.h>
--#include <linux/inet.h>
- #include <scsi/scsi.h>
+--- unh-iscsi-2.0/common/user_space.h.orig	2008-05-28 20:54:49.000000000 +0200
++++ unh-iscsi-2.0/common/user_space.h	2024-03-17 14:30:08.472082138 +0100
+@@ -48,6 +48,7 @@
+ #include <fcntl.h>
+ #include <signal.h>
+ #include <pthread.h>
++#include <limits.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/times.h>
+--- unh-iscsi-2.0/initiator/initiator_utilities.c.orig	2008-05-28 20:54:49.000000000 +0200
++++ unh-iscsi-2.0/initiator/initiator_utilities.c	2024-03-17 14:42:53.027940184 +0100
+@@ -224,7 +224,7 @@ static inline void __attribute__ ((no_in
+ 	this_command->tx_iovlen = 1;
+ }
  
- #include "iscsi_common.h"
+-inline int __attribute__ ((no_instrument_function))
++int __attribute__ ((no_instrument_function))
+     get_immed_length(struct session *current_session,
+ 		 struct connection *current_connection,
+ 		 struct scsi_cmnd *Cmnd)
diff --git a/unh_iscsi-sh.patch b/unh_iscsi-sh.patch
new file mode 100644
index 0000000..9d84170
--- /dev/null
+++ b/unh_iscsi-sh.patch
@@ -0,0 +1,11 @@
+--- unh-iscsi-2.0/Makefile-user.orig	2024-03-17 14:33:20.007711167 +0100
++++ unh-iscsi-2.0/Makefile-user	2024-03-17 14:36:33.996660239 +0100
+@@ -137,7 +137,7 @@ initiator/unh_main_scsi_initiator: initi
+ make.dep:
+ 	rm -f $(DEPEND_FILE)
+ 	touch $(DEPEND_FILE)
+-	makedepend `find . -name \*.[ch]` -f$(DEPEND_FILE) >& /dev/null
++	makedepend `find . -name \*.[ch]` -f$(DEPEND_FILE) > /dev/null 2>&1
+ 	rm $(DEPEND_FILE).bak
+ 
+ #
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/unh_iscsi.git/commitdiff/99171c4cdebb2eb4b1cb06937bbb6345a06713d1



More information about the pld-cvs-commit mailing list