From 0733627b2c0464a08bb9a39ef7232b73905a8b36 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 3 Apr 2007 14:49:33 +0000 Subject: [PATCH] Fixed depmod to work for the necessary kernel, not the current one git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@106 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/Makefile | 5 +++-- qla2x00t/qla2x00-target/Makefile | 7 ++++--- scst/src/Makefile | 7 ++++--- scst/src/dev_handlers/Makefile | 5 +++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/qla2x00t/Makefile b/qla2x00t/Makefile index e4b1dd649..2b9974015 100644 --- a/qla2x00t/Makefile +++ b/qla2x00t/Makefile @@ -21,7 +21,8 @@ obj-$(CONFIG_SCSI_QLA24XX) += qla2xxx.o qla2400.o else ifeq ($(KVER),) ifeq ($(KDIR),) - KDIR := /lib/modules/$(shell uname -r)/build + KVER = $(shell uname -r) + KDIR := /lib/modules/$(KVER)/build endif else KDIR := /lib/modules/$(KVER)/build @@ -36,7 +37,7 @@ install: all uninstall: rm -f $(INSTALL_DIR)/qla2[2-3]00.ko $(INSTALL_DIR)/qla2xxx.ko - -/sbin/depmod -a + -/sbin/depmod -a $(KVER) endif clean: diff --git a/qla2x00t/qla2x00-target/Makefile b/qla2x00t/qla2x00-target/Makefile index 273485746..334bd9576 100644 --- a/qla2x00t/qla2x00-target/Makefile +++ b/qla2x00t/qla2x00-target/Makefile @@ -42,7 +42,8 @@ EXTRA_CFLAGS += -DDEBUG_TGT -g ifeq ($(KVER),) ifeq ($(KDIR),) - KDIR := /lib/modules/$(shell uname -r)/build + KVER = $(shell uname -r) + KDIR := /lib/modules/$(KVER)/build endif else KDIR := /lib/modules/$(KVER)/build @@ -66,7 +67,7 @@ tgt: Modules.symvers Module.symvers install: all $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \ modules_install - -depmod -a + -depmod -a $(KVER) SCST_MOD_VERS := $(shell ls $(SCST_DIR)/Modules.symvers 2>/dev/null) ifneq ($(SCST_MOD_VERS),) @@ -87,7 +88,7 @@ endif uninstall: rm -f $(INSTALL_DIR)/qla2[23x]00tgt.ko - -/sbin/depmod -a + -/sbin/depmod -a $(KVER) endif clean: diff --git a/scst/src/Makefile b/scst/src/Makefile index 82029e9b2..e8ca08e5a 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -47,7 +47,8 @@ obj-$(BUILD_DEV) += $(DEV_HANDLERS_DIR)/ else ifeq ($(KVER),) ifeq ($(KDIR),) - KDIR := /lib/modules/$(shell uname -r)/build + KVER = $(shell uname -r) + KDIR := /lib/modules/$(KVER)/build endif else KDIR := /lib/modules/$(KVER)/build @@ -77,13 +78,13 @@ ifneq ($(MOD_VERS),) rm -f $(INSTALL_DIR_H)/Modules.symvers install -m 644 Module.symvers $(INSTALL_DIR_H) endif - -depmod -a + -depmod -a $(KVER) uninstall: cd $(DEV_HANDLERS_DIR) && $(MAKE) $@ rm -f $(INSTALL_DIR)/scsi_tgt.ko -rmdir $(INSTALL_DIR) 2>/dev/null - -/sbin/depmod -a + -/sbin/depmod -a $(KVER) rm -rf $(INSTALL_DIR_H) endif diff --git a/scst/src/dev_handlers/Makefile b/scst/src/dev_handlers/Makefile index 62a23bc72..be590a20e 100644 --- a/scst/src/dev_handlers/Makefile +++ b/scst/src/dev_handlers/Makefile @@ -43,7 +43,8 @@ obj-$(CONFIG_SCSI_TARGET_VDISK) += scst_vdisk.o else ifeq ($(KDIR),) - KDIR := /lib/modules/$(shell uname -r)/build + KVER = $(shell uname -r) + KDIR := /lib/modules/$(KVER)/build endif all: @@ -52,7 +53,7 @@ all: install: all $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) \ modules_install - -depmod -a + -depmod -a $(KVER) uninstall: rm -f $(INSTALL_DIR)/scst_*.ko