Merge scstadmin from trunk. Hence add support for saving and restoring the ALUA state, unify the qla2x00t/iSCSI-SCST and SCST init scripts, compute the SCST handler kernel module list from /etc/scst.conf and add man pages for scstadmin, /etc/scst.conf and /etc/default/scst. (svn merge -r3389:3982 https://scst.svn.sourceforge.net/svnroot/scst/trunk/scstadmin/Makefile Makefile)

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.0.x@3983 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2011-12-15 09:45:18 +00:00
parent f9601efb4c
commit ea4de63afc
17 changed files with 4177 additions and 1294 deletions
+79 -12
View File
@@ -1,6 +1,31 @@
SCSTADMIN_DIR = scstadmin
INITDIR := $(PREFIX)/etc/init.d
MANDIR := $(DESTDIR)/usr/local/man
INITDIR := $(shell if [ -f /etc/slackware-version ]; then \
echo /etc/rc.d; \
else \
echo /etc/init.d; \
fi)
INSTALL_INITD_CMD := $(shell if [ -f /etc/gentoo-release ]; then \
echo rc-update add; \
elif [ -f /etc/slackware-version ]; then \
echo none; \
else \
echo /usr/lib/lsb/install_initd; \
fi)
INSTALL_INITD_ARGS := $(shell [ -f /etc/gentoo-release ] && echo default)
REMOVE_INITD_CMD := $(shell if [ -f /etc/gentoo-release ]; then \
echo rc-update del; \
elif [ -f /etc/slackware-version ]; then \
echo none; \
else \
echo /usr/lib/lsb/remove_initd; \
fi)
DEFAULTDIR := $(shell if [ -f /etc/gentoo-release ]; then \
echo /etc/conf.d; \
else \
echo /etc/default; \
fi)
all:
cd $(SCSTADMIN_DIR) && $(MAKE) $@
@@ -9,20 +34,62 @@ install:
@if ! perl -MExtUtils::MakeMaker -e '' >/dev/null 2>&1; then \
echo Error: the Perl module ExtUtils::MakeMaker must be installed \
first; false; fi
@if [ ! -e /usr/lib/lsb/install_initd ]; then \
echo Error: the lsb-core package must be installed first; false; fi
@if [ ! -e /etc/slackware-version -a ! -e /etc/gentoo-release \
-a ! -e /lib/lsb/init-functions ]; then \
echo "Error: the lsb-core (Debian, Ubuntu), redhat-lsb (RHEL, CentOS,"\
"Scientific Linux, Fedora) or insserv (SLES, openSUSE) package must" \
"be installed first"; false; fi
cd $(SCSTADMIN_DIR) && $(MAKE) $@
-/usr/lib/lsb/install_initd scst
-/usr/lib/lsb/install_initd qla2x00t
mkdir -m 755 -p $(DESTDIR)$(INITDIR)
install -m 755 init.d/scst $(DESTDIR)$(INITDIR)
install -m 755 init.d/qla2x00t $(DESTDIR)$(INITDIR)
for m in scstadmin/man*/*.[1-9]; do \
if [ -e $$m ]; then \
d=$(MANDIR)/$$(basename $$(dirname $$m)); \
if install -d $$d; then \
install -m 644 $$m $$d; \
fi \
fi \
done
install -d $(DESTDIR)$(INITDIR)
tmp=/tmp/scst-initd-$$$$ && init.d/scst >$$tmp && \
install -m 755 $$tmp $(DESTDIR)$(INITDIR)/scst && \
rm -f $$tmp
if [ ! -e $(DESTDIR)$(DEFAULTDIR)/scst ]; then \
install -m 755 default/scst $(DESTDIR)$(DEFAULTDIR); \
fi
@if [ "$(REMOVE_INITD_CMD)" != "none" ]; then \
$(REMOVE_INITD_CMD) iscsi-scst >/dev/null 2>&1; \
rm -f $(INITDIR)/iscsi-scst; \
$(REMOVE_INITD_CMD) qla2x00t >/dev/null 2>&1; \
rm -f $(INITDIR)/qla2x00t; \
fi
@if [ "$(INSTALL_INITD_CMD)" != "none" ]; then \
echo; \
echo 'If you want SCST to start automatically at boot time, run' \
'the following command:'; \
if [ ! -z "$(DESTDIR)" ]; then echo -n "chroot $(DESTDIR) "; fi; \
echo '$(INSTALL_INITD_CMD) scst $(INSTALL_INITD_ARGS)'; \
echo; \
fi
uninstall:
-/usr/lib/lsb/remove_initd qla2x00t
-/usr/lib/lsb/remove_initd scst
-rm -f $(DESTDIR)$(PATH_INITD)/qla2x00t
-rm -f $(DESTDIR)$(PATH_INITD)/scst
if [ -e $(DESTDIR)$(DEFAULTDIR)/scst ]; then \
mv $(DESTDIR)$(DEFAULTDIR)/scst \
$(DESTDIR)$(DEFAULTDIR)/scst.`date +%F,%T`; \
fi
if [ -e $(DESTDIR)$(INITDIR)/scst -a "$(REMOVE_INITD_CMD)" != "none" ];\
then \
if [ -z "$(DESTDIR)" ]; then \
$(REMOVE_INITD_CMD) scst; \
else \
chroot $(DESTDIR) $(REMOVE_INITD_CMD) scst; \
fi; \
rm -f $(DESTDIR)$(INITDIR)/scst; \
fi
for m in scstadmin/man*/*.[1-9]; do \
if [ -e $$m ]; then \
d=$(MANDIR)/$$(basename $$(dirname $$m)); \
rm -f $$d/$$(basename $$m); \
fi \
done
cd $(SCSTADMIN_DIR) && $(MAKE) $@
perl-module: