Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve installation process #171

Merged
merged 3 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ If the following packages have not yet been installed, install these now:
The next step is to build and install SCST. How to do that depends on whether
or not your Linux distribution supports a package manager:

make release
make 2release
if rpm -q glibc >/dev/null 2>&1; then
rm -rf {,scstadmin/}rpmbuilddir
make rpm
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ help:
@echo " usr_install : usr target: install"
@echo " usr_uninstall : usr target: uninstall"
@echo ""
@echo " scst-rpm : make SCST RPM packages"
@echo " scst-dkms-rpm : make SCST DKMS RPM packages"
@echo " rpm : make both SCST and scstadmin RPM packages"
@echo " rpm-dkms : make both SCST DKMS and scstadmin RPM packages"
@echo ""
@echo " dpkg : make SCST dpkg packages"
@echo ""
@echo " 2perf : changes debug state to full performance"
@echo " 2release : changes debug state to release"
@echo " 2debug : changes debug state to full debug"
Expand Down
7 changes: 5 additions & 2 deletions fcst/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ ifeq ($(INSTALL_MOD_PATH),)
export INSTALL_MOD_PATH := $(DESTDIR)
endif

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra
INSTALL_MOD_DIR=extra

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR)

SCST_DIR := $(shell echo "$$PWD")/../scst/src

Expand All @@ -67,6 +69,7 @@ install: all
KDIR=$(KDIR) ../scripts/sign-modules
$(MAKE) -C $(KDIR) M=$(shell pwd) \
$(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \
INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
$$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \
CONFIG_MODULE_SIG_ALL= modules_install

Expand All @@ -87,4 +90,4 @@ extraclean: clean
release-archive:
../scripts/generate-release-archive fcst "$$(sed -n 's/^#define[[:blank:]]FT_VERSION[[:blank:]]*\"\([^\"]*\)\".*/\1/p' fcst.h)"

.PHONY: all tgt install uninstall clean extraclean release-archive
.PHONY: all install uninstall clean extraclean release-archive
6 changes: 5 additions & 1 deletion iscsi-scst/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ ifeq ($(INSTALL_MOD_PATH),)
export INSTALL_MOD_PATH := $(DESTDIR)
endif

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra
INSTALL_MOD_DIR=extra

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR)
INFINIBAND_ENABLED = $(shell syms=$$(dirname "$(KDIR)")/modules.symbols; if [ -e "$$syms" ] && grep -wq 'ib_register_client' "$$syms" || grep -q "^CONFIG_INFINIBAND=[my]$$" "$(KDIR)/.config"; then echo true; else echo false; fi)

all: progs mods
Expand Down Expand Up @@ -166,13 +168,15 @@ install: all
(cd $(KMOD) && KDIR=$(KDIR) ../../scripts/sign-modules)
$(MAKE) -C $(KDIR) M=$(KMOD) \
$(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \
INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
$$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \
CONFIG_MODULE_SIG_ALL= modules_install
echo "$@: INFINIBAND_ENABLED = $(INFINIBAND_ENABLED)"
if $(INFINIBAND_ENABLED); then \
(cd $(ISERTMOD) && KDIR=$(KDIR) ../../../scripts/sign-modules);\
$(MAKE) -C $(KDIR) M=$(ISERTMOD) \
$(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \
INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
$$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \
CONFIG_MODULE_SIG_ALL= modules_install; \
fi
Expand Down
7 changes: 5 additions & 2 deletions qla2x00t-32gbit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ ifeq ($(INSTALL_MOD_PATH),)
export INSTALL_MOD_PATH := $(DESTDIR)
endif

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra
INSTALL_MOD_DIR=extra

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR)

all:
$(MAKE) -C $(KDIR) M=$(shell pwd) \
Expand All @@ -56,6 +58,7 @@ install: all
KDIR=$(KDIR) ../scripts/sign-modules
$(MAKE) -C $(KDIR) M=$(shell pwd) \
$(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \
INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
$$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \
CONFIG_MODULE_SIG_ALL= modules_install

Expand All @@ -71,7 +74,7 @@ clean:
extraclean: clean
rm -f *.orig *.rej

.PHONY: all tgt install uninstall clean extraclean
.PHONY: all install uninstall clean extraclean

endif

Expand Down
7 changes: 5 additions & 2 deletions qla2x00t-32gbit/qla2x00-target/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ ifndef PREFIX
PREFIX=/usr/local
endif

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra
INSTALL_MOD_DIR=extra

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR)

SCST_DIR := $(shell echo "$$PWD/../../scst/src")

Expand All @@ -77,6 +79,7 @@ endif
KDIR=$(KDIR) ../../scripts/sign-modules
$(MAKE) -C $(KDIR) M=$(shell pwd) \
$(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \
INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
$$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \
CONFIG_MODULE_SIG_ALL= modules_install

Expand All @@ -102,4 +105,4 @@ endif
extraclean: clean
rm -f *.orig *.rej

.PHONY: all tgt install uninstall clean extraclean qla2xxx_scst
.PHONY: all install uninstall clean extraclean qla2xxx_scst
7 changes: 5 additions & 2 deletions qla2x00t/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ ifeq ($(INSTALL_MOD_PATH),)
export INSTALL_MOD_PATH := $(DESTDIR)
endif

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra
INSTALL_MOD_DIR=extra

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR)

all:
$(MAKE) -C $(KDIR) M=$(shell pwd) \
Expand All @@ -54,6 +56,7 @@ install: all
KDIR=$(KDIR) ../scripts/sign-modules
$(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=m \
$(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \
INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
$$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \
CONFIG_MODULE_SIG_ALL= modules_install

Expand All @@ -69,7 +72,7 @@ clean:
extraclean: clean
rm -f *.orig *.rej

.PHONY: all tgt install uninstall clean extraclean
.PHONY: all install uninstall clean extraclean

endif

Expand Down
7 changes: 5 additions & 2 deletions qla2x00t/qla2x00-target/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ ifndef PREFIX
PREFIX=/usr/local
endif

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra
INSTALL_MOD_DIR=extra

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR)

SCST_DIR := $(shell echo "$$PWD/../../scst/src")

Expand All @@ -76,6 +78,7 @@ endif
KDIR=$(KDIR) ../../scripts/sign-modules
$(MAKE) -C $(KDIR) M=$(shell pwd) \
$(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \
INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
$$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \
CONFIG_MODULE_SIG_ALL= modules_install

Expand All @@ -101,4 +104,4 @@ endif
extraclean: clean
rm -f *.orig *.rej

.PHONY: all tgt install uninstall clean extraclean qla2xxx_scst
.PHONY: all install uninstall clean extraclean qla2xxx_scst
30 changes: 18 additions & 12 deletions scst/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ SHELL=/bin/bash

DEV_HANDLERS_DIR = dev_handlers

SCST_MOD_DIR := $(shell pwd)
SCST_DH_MOD_DIR := $(shell pwd)/$(DEV_HANDLERS_DIR)

ifeq ($(KVER),)
ifeq ($(KDIR),)
KVER := $(shell uname -r)
Expand All @@ -58,8 +61,13 @@ ifeq ($(SCST_INC_DIR),)
SCST_INC_DIR := ../include
endif

INSTALL_MOD_DIR=extra

SCST_INTF_VER_FILE := $(SCST_INC_DIR)/scst_itf_ver.h

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR)
INSTALL_DIR_H := $(DESTDIR)$(PREFIX)/include/scst

$(SCST_INTF_VER_FILE): $(SCST_INC_DIR)/scst.h $(SCST_INC_DIR)/scst_const.h $(SCST_INC_DIR)/scst_user.h
echo "/* Autogenerated, don't edit */" >$(SCST_INTF_VER_FILE)
echo "" >>$(SCST_INTF_VER_FILE)
Expand All @@ -73,13 +81,13 @@ $(SCST_INTF_VER_FILE): $(SCST_INC_DIR)/scst.h $(SCST_INC_DIR)/scst_const.h $(SCS
all: $(SCST_INTF_VER_FILE)
$(MAKE) -C certs KDIR=$(KDIR) \
$(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)")
$(MAKE) -C $(KDIR) M=$(shell pwd) \
$(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) \
$(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)")
$(MAKE) -C $(KDIR) M=$(shell pwd)/dev_handlers \
$(MAKE) -C $(KDIR) M=$(SCST_DH_MOD_DIR) \
$(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)")

scst:
$(MAKE) -C $(KDIR) M=$(shell pwd) \
$(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) \
$(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)")

install: all
Expand All @@ -89,13 +97,15 @@ install: all
false; fi
-rm -f $(INSTALL_DIR)/scsi_tgt.ko
KDIR=$(KDIR) ../../scripts/sign-modules
$(MAKE) -C $(KDIR) M=$(shell pwd)/dev_handlers \
$(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) \
$(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \
INSTALL_MOD_DIR=extra/dev_handlers \
INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
$$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \
CONFIG_MODULE_SIG_ALL= modules_install
$(MAKE) -C $(KDIR) M=$(shell pwd) \
(cd $(SCST_DH_MOD_DIR) && KDIR=$(KDIR) ../../../scripts/sign-modules)
$(MAKE) -C $(KDIR) M=$(SCST_DH_MOD_DIR) \
$(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \
INSTALL_MOD_DIR=$(INSTALL_MOD_DIR)/dev_handlers \
$$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \
CONFIG_MODULE_SIG_ALL= modules_install
install -d $(INSTALL_DIR_H)
Expand Down Expand Up @@ -130,16 +140,12 @@ uninstall:
-/sbin/depmod -b $(INSTALL_MOD_PATH)/ -a $(KVER)
rm -rf $(INSTALL_DIR_H)

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra
INSTALL_DIR_H := $(DESTDIR)$(PREFIX)/include/scst

clean:
rm -f $(SCST_INTF_VER_FILE)
$(MAKE) -C $(KDIR) M=$(shell pwd) $@
$(MAKE) -C $(DEV_HANDLERS_DIR) $@
rm -f $(SCST_INTF_VER_FILE)
$(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) $@

extraclean: clean
rm -f $(SCST_INTF_VER_FILE)
cd $(DEV_HANDLERS_DIR) && $(MAKE) $@
rm -f *.orig *.rej

Expand Down
8 changes: 6 additions & 2 deletions scst/src/dev_handlers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ ifeq ($(INSTALL_MOD_PATH),)
export INSTALL_MOD_PATH := $(DESTDIR)
endif

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra
INSTALL_MOD_DIR=extra/dev_handlers

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR)

all:
$(MAKE) -C $(KDIR) M=$(shell pwd) \
Expand All @@ -63,11 +65,13 @@ install: all
KDIR=$(KDIR) ../../../scripts/sign-modules
$(MAKE) -C $(KDIR) M=$(shell pwd) \
$(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \
INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
$$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \
CONFIG_MODULE_SIG_ALL= modules_install

uninstall:
rm -f $(INSTALL_DIR)/dev_handlers/scst_*.ko
rm -f $(INSTALL_DIR)/scst_*.ko
-rmdir $(INSTALL_DIR) 2>/dev/null

clean:
$(MAKE) -C $(KDIR) M=$(shell pwd) $@
Expand Down
7 changes: 5 additions & 2 deletions scst_local/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ ifeq ($(INSTALL_MOD_PATH),)
export INSTALL_MOD_PATH := $(DESTDIR)
endif

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra
INSTALL_MOD_DIR=extra

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR)

SCST_DIR := $(shell echo "$$PWD")/../scst/src

Expand All @@ -41,6 +43,7 @@ install: all
KDIR=$(KDIR) ../scripts/sign-modules
$(MAKE) -C $(KDIR) M=$(shell pwd) \
$(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \
INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
$$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \
CONFIG_MODULE_SIG_ALL= modules_install

Expand All @@ -57,5 +60,5 @@ extraclean: clean
release-archive:
../scripts/generate-release-archive scst_local "$$(sed -n 's/^#define[[:blank:]]SCST_LOCAL_VERSION[[:blank:]]*\"\([^\"]*\)\".*/\1/p' scst_local.c)"

.PHONY: all tgt install uninstall clean extraclean
.PHONY: all install uninstall clean extraclean

5 changes: 4 additions & 1 deletion srpt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ ifeq ($(INSTALL_MOD_PATH),)
export INSTALL_MOD_PATH := $(DESTDIR)
endif

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra
INSTALL_MOD_DIR=extra

INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/$(INSTALL_MOD_DIR)

SRC_FILES=$(wildcard */*.[ch])

Expand Down Expand Up @@ -125,6 +127,7 @@ install: all
$(MAKE) -C $(KDIR) M=$(shell pwd)/src \
$(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \
CONFTEST_CFLAGS="$(CONFTEST_CFLAGS)" \
INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
$$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \
CONFIG_MODULE_SIG_ALL= modules_install

Expand Down