From 87d64c162d59af9cbfd7082f2ce7b2ae2d69b127 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 9 Oct 2019 01:33:25 +0000 Subject: [PATCH 1/7] scst: Unbreak the build for RHEL 6 / CentOS 6 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8610 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/sign-modules | 7 ++++++- scst/src/certs/Makefile | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/sign-modules b/scripts/sign-modules index 6b79fb847..c9cfdf46f 100755 --- a/scripts/sign-modules +++ b/scripts/sign-modules @@ -9,7 +9,12 @@ fi scst_dir=$(dirname "$(cd "$(dirname "$0")" && pwd)") -CONFIG_MODULE_SIG_HASH=$(sed -n 's/^CONFIG_MODULE_SIG_HASH="\([^"]*\)"$/\1/p' "${KDIR}/.config") +if [ ! -e "${KDIR}/scripts/sign-file" ]; then + echo "Not signing modules because no sign-file executable" + exit +fi + +CONFIG_MODULE_SIG_HASH=$(sed -n 's/^CONFIG_MODULE_SIG_HASH="\([^"]*\)"$/\1/p' "${KDIR}/.config" | { read -r line; [ -n "$line" ] && echo "$line" || echo sha256; }) sed 's,^kernel/,,' < modules.order | \ while read -r f; do diff --git a/scst/src/certs/Makefile b/scst/src/certs/Makefile index 90818f69d..2c9d76ff0 100644 --- a/scst/src/certs/Makefile +++ b/scst/src/certs/Makefile @@ -1,4 +1,4 @@ -CONFIG_MODULE_SIG_HASH := $(shell sed -n 's/^CONFIG_MODULE_SIG_HASH="\([^"]*\)"$$/\1/p' "$(KDIR)/.config") +CONFIG_MODULE_SIG_HASH := $(shell sed -n 's/^CONFIG_MODULE_SIG_HASH="\([^"]*\)"$$/\1/p' "$(KDIR)/.config" | { read -r line; [ -n "$$line" ] && echo "$$line" || echo sha256; }) all: $(shell grep -q '^CONFIG_MODULE_SIG=y$$' "$(KDIR)/.config" && \ echo module_signing_enabled) From a504222723bf3429c3f73794ed963525c5b84cb3 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 9 Oct 2019 02:16:28 +0000 Subject: [PATCH 2/7] scst/src/Makefile: Specify the installation directory for device handlers explicitly This patch unbreaks 'make rpm' against Linux kernel v5.3. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8611 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/scst/src/Makefile b/scst/src/Makefile index b84826da7..20ec5225e 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -130,6 +130,7 @@ install: all -rm -f $(INSTALL_DIR)/scsi_tgt.ko KDIR=$(KDIR) ../../scripts/sign-modules $(MAKE) -C $(KDIR) M=$(shell pwd)/dev_handlers \ + INSTALL_MOD_DIR=extra/dev_handlers \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install $(MAKE) -C $(KDIR) M=$(shell pwd) \ From 1e79f561bc11095809178621e287dd2c6eeb33d3 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 9 Oct 2019 02:17:11 +0000 Subject: [PATCH 3/7] scst.spec.in: Make this spec file compatible with rpm v4.14 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8612 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst.spec.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scst.spec.in b/scst.spec.in index bc3ce3269..2082d270b 100644 --- a/scst.spec.in +++ b/scst.spec.in @@ -195,7 +195,14 @@ rm -rf /usr/local/include/scst %files devel %defattr(-,root,root,0755) %dir /usr/include/scst -/usr/include/scst/ +/usr/include/scst/Module.symvers +/usr/include/scst/backport.h +/usr/include/scst/scst.h +/usr/include/scst/scst_const.h +/usr/include/scst/scst_debug.h +/usr/include/scst/scst_itf_ver.h +/usr/include/scst/scst_sgv.h +/usr/include/scst/scst_user.h %changelog * Wed May 6 2015 Bart Van Assche From 36e4ee26bba687b3d39ccdda2a9a47a1f2cdcc15 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 9 Oct 2019 02:39:44 +0000 Subject: [PATCH 4/7] scst/include/backport.h: Include on RHEL 8 This patch is a build fix for RHEL 8. Signed-off-by: Ivan Orlov git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8613 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index dff512a25..9696d83e4 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -23,7 +23,8 @@ #include #include #include /* struct request_queue */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 21, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 21, 0) || \ + (defined(RHEL_MAJOR) && RHEL_MAJOR -0 >= 8) #include #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) From 4c329342433d52291b85cdb4785adbac2b26b32b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 9 Oct 2019 02:40:14 +0000 Subject: [PATCH 5/7] iscsi-scst/Makefile_user_space_only: Synchronize this file with iscsi-scst/Makefile Signed-off-by: Ivan Orlov git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8614 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/Makefile_user_space_only | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/iscsi-scst/Makefile_user_space_only b/iscsi-scst/Makefile_user_space_only index 65d692173..972876ba6 100644 --- a/iscsi-scst/Makefile_user_space_only +++ b/iscsi-scst/Makefile_user_space_only @@ -5,7 +5,7 @@ # removes any old dependencies. DON'T put your own dependencies here # unless it's something special (not a .c file). -SBINDIR := /usr/local/sbin +SBINDIR := $(PREFIX)/sbin INITDIR := /etc/init.d RCDIR := /etc/rc.d @@ -24,17 +24,9 @@ include/iscsi_scst_itf_ver.h: include/iscsi_scst.h install: all @install -vD -m 755 usr/iscsi-scstd $(DESTDIR)$(SBINDIR)/iscsi-scstd @install -vD -m 755 usr/iscsi-scst-adm $(DESTDIR)$(SBINDIR)/iscsi-scst-adm - if [ -f /etc/debian_version ]; then \ - install -vD -m 755 etc/initd/initd.debian $(DESTDIR)$(INITDIR)/iscsi-scst; \ - elif [ -f /etc/redhat-release ]; then \ - install -vD -m 755 etc/initd/initd.redhat $(DESTDIR)$(INITDIR)/iscsi-scst; \ - elif [ -f /etc/gentoo-release ]; then \ - install -vD -m 755 etc/initd/initd.gentoo $(DESTDIR)$(INITDIR)/iscsi-scst; \ - elif [ -f /etc/slackware-version ]; then \ - install -vD -m 755 etc/initd/initd $(DESTDIR)$(RCDIR)/iscsi-scst; \ - else \ - install -vD -m 755 etc/initd/initd $(DESTDIR)$(INITDIR)/iscsi-scst; \ - fi + @install -vD -m 644 doc/manpages/iscsi-scstd.conf.5 $(DESTDIR)$(MANDIR)/man5/iscsi-scstd.conf.5 + @install -vD -m 644 doc/manpages/iscsi-scstd.8 $(DESTDIR)$(MANDIR)/man8/iscsi-scstd.8 + @install -vD -m 644 doc/manpages/iscsi-scst-adm.8 $(DESTDIR)$(MANDIR)/man8/iscsi-scst-adm.8 clean: $(MAKE) -C usr clean From 5d3e3e9590d9d991a3c1164c81f2e84df904dae6 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 9 Oct 2019 02:41:48 +0000 Subject: [PATCH 6/7] scripts/specialize-patch: Port to RHEL 8 Signed-off-by: Ivan Orlov git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8615 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/specialize-patch | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/specialize-patch b/scripts/specialize-patch index 434d3a099..7140aea85 100755 --- a/scripts/specialize-patch +++ b/scripts/specialize-patch @@ -72,8 +72,7 @@ function evaluate(stmnt, pattern, arg, op, result) { "(LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0))", stmnt) gsub("defined\\(USE_PRE_440_WR_STRUCTURE\\)", - "(LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) || " \ - "RHEL_RELEASE_CODE -0 >= 7 * 256 + 6)", stmnt) + "(LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0))", stmnt) gsub("defined\\(IB_CREATE_CQ_HAS_INIT_ATTR\\)", "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) || " \ @@ -84,8 +83,7 @@ function evaluate(stmnt, pattern, arg, op, result) { "RHEL_RELEASE_CODE -0 >= 7 * 256 + 6)", stmnt) gsub("defined\\(IB_CM_LISTEN_TAKES_FOURTH_ARG\\)", - "(LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) || " \ - "RHEL_RELEASE_CODE -0 >= 7 * 256 + 6)", stmnt) + "(LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0))", stmnt) gsub("defined\\(IB_CLIENT_REMOVE_TAKES_TWO_ARGS\\)", "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) || " \ @@ -103,7 +101,12 @@ function evaluate(stmnt, pattern, arg, op, result) { "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))", stmnt) gsub("HAVE_DEV_ATTR_MAX_SEND_SGE", - "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))", stmnt) + "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) || " \ + "RHEL_RELEASE_CODE -0 >= 8 * 256 + 0)", stmnt) + + gsub("defined\\(HAVE_DEV_ATTR_MAX_RECV_SGE\\)", + "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) || " \ + "RHEL_RELEASE_CODE -0 >= 8 * 256 + 0)", stmnt) gsub("HAVE_RDMA_DESTROY_AH_WITH_FLAGS", "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 21, 0))", stmnt) @@ -125,8 +128,7 @@ function evaluate(stmnt, pattern, arg, op, result) { "RHEL_RELEASE_CODE -0 >= 6 * 256 + 10)", stmnt) gsub("defined\\(HAVE_IB_QUERY_DEVICE\\)", - "(LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) || " \ - "RHEL_RELEASE_CODE -0 >= 7 * 256 + 6)", stmnt) + "(LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0))", stmnt) gsub("defined\\(MAD_HANDLER_TAKES_SEND_BUF\\)", "(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) || " \ From 8dbffe9b2510d6a9bc0f6fab7d000f0e27f7fc24 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 9 Oct 2019 02:57:22 +0000 Subject: [PATCH 7/7] scst-dkms.spec.in: Sync with scst.spec.in git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8616 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst-dkms.spec.in | 11 ++++++++++- scst.spec.in | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/scst-dkms.spec.in b/scst-dkms.spec.in index 67e5527cd..7a8ca9435 100644 --- a/scst-dkms.spec.in +++ b/scst-dkms.spec.in @@ -224,9 +224,18 @@ true %files devel %defattr(-,root,root,0755) %dir /usr/include/scst -/usr/include/scst/ +/usr/include/scst/Module.symvers +/usr/include/scst/backport.h +/usr/include/scst/scst.h +/usr/include/scst/scst_const.h +/usr/include/scst/scst_debug.h +/usr/include/scst/scst_itf_ver.h +/usr/include/scst/scst_sgv.h +/usr/include/scst/scst_user.h %changelog +* Tue Oct 8 2019 Bart Van Assche +- Make this spec file compatible with rpmbuild v4.14. * Wed May 6 2015 Bart Van Assche - Build in release mode instead of debug mode. * Mon May 4 2015 Bart Van Assche diff --git a/scst.spec.in b/scst.spec.in index 2082d270b..185670014 100644 --- a/scst.spec.in +++ b/scst.spec.in @@ -205,6 +205,8 @@ rm -rf /usr/local/include/scst /usr/include/scst/scst_user.h %changelog +* Tue Oct 8 2019 Bart Van Assche +- Make this spec file compatible with rpmbuild v4.14. * Wed May 6 2015 Bart Van Assche - Build in release mode instead of debug mode. * Mon May 4 2015 Bart Van Assche