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 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/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) || " \ 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 bc3ce3269..185670014 100644 --- a/scst.spec.in +++ b/scst.spec.in @@ -195,9 +195,18 @@ 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 +* 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/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) 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) \ 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)