From bb43fbc46824e11e5627bfc58ab2df536f4a81cb Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 21 Jun 2020 16:31:59 +0000 Subject: [PATCH] scst/src/Makefile: Run /usr/sbin/weak-modules --remove-kernel before install Apparently RHEL 8 / CentOS 8 create soft links in the weak-modules to SCST directory but do not update these links correctly after having upgraded to a newer kernel version and after having reinstalled SCST. Hence remove all weak module links before installing SCST. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9033 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scst/src/Makefile b/scst/src/Makefile index dafc5cb3c..ffa701c31 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -127,6 +127,13 @@ install: all false; fi -rm -f $(INSTALL_DIR)/scsi_tgt.ko KDIR=$(KDIR) ../../scripts/sign-modules + # Apparently on RHEL 8 and CentOS 8 the module installation can + # leave stale symlinks in /lib/modules/$(KVER)/weak-updates/. These + # symlinks may cause loading of SCST to fail, Remove these symlinks + # before installing SCST. + if [ -e /usr/sbin/weak-modules ]; then \ + /usr/sbin/weak-modules --remove-kernel; \ + fi $(MAKE) -C $(KDIR) M=$(shell pwd)/dev_handlers \ INSTALL_MOD_DIR=extra/dev_handlers \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \