Change SRC_URI to mirror://gentoo/ now that the source has spread, also clean up...
authorRobin H. Johnson <robbat2@gentoo.org>
Tue, 20 Sep 2005 08:00:38 +0000 (08:00 +0000)
committerRobin H. Johnson <robbat2@gentoo.org>
Tue, 20 Sep 2005 08:00:38 +0000 (08:00 +0000)
Package-Manager: portage-2.0.51.22-r2

sys-block/open-iscsi/ChangeLog
sys-block/open-iscsi/Manifest
sys-block/open-iscsi/files/iscsid-init.d
sys-block/open-iscsi/open-iscsi-0.4.413.ebuild

index c11da800035642ffe21e61126742cd633a7bb825..77f56b1d0a08f15421b06d23365768b90272c3df 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for sys-block/open-iscsi
 # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/ChangeLog,v 1.1 2005/09/20 04:33:34 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/ChangeLog,v 1.2 2005/09/20 08:00:38 robbat2 Exp $
+
+  20 Sep 2005; Robin H. Johnson <robbat2@gentoo.org> files/iscsid-init.d,
+  open-iscsi-0.4.413.ebuild:
+  Change SRC_URI to mirror://gentoo/ now that the source has spread, also
+  clean up install location for modules, security of config file and
+  databases, and clean up the init script to be gentoo-like instead of
+  debian-like.
 
 *open-iscsi-0.4.413 (20 Sep 2005)
 
index 5c6d76e97913be910a0d9532fe3a5eaa0abe724d..13423eb5b170280bf96a61846c70c6816a589359 100644 (file)
@@ -1,6 +1,6 @@
-MD5 f3c0735d64f0ee90e74ef767e116af44 open-iscsi-0.4.413.ebuild 2100
-MD5 7c96acb098ff760945c04e20b47d6a07 ChangeLog 575
+MD5 88e0027844d0bb73925ed95ba41cd2ca open-iscsi-0.4.413.ebuild 2321
+MD5 e67529a6fb35ab7b06e53655d9cec5f3 ChangeLog 908
 MD5 21cd68602737d7c996bceabf6e62c468 metadata.xml 223
 MD5 ec58849ae9c14ba36b99b28f204bd9be files/initiatorname.iscsi 422
 MD5 46455650192b84fe9800a574256ec67e files/digest-open-iscsi-0.4.413 70
-MD5 61c07f96dcbe59e3cb43ab7fb7de55c2 files/iscsid-init.d 1893
+MD5 ad2618aed85b081bedd4ebcf72316183 files/iscsid-init.d 2213
index 060a311d31061bf30d8b7a1e9135490d08e268d3..f08b64542189edc4a7cac55747a950b5d8f6aa24 100644 (file)
@@ -1,10 +1,13 @@
 #!/sbin/runscript
 # Copyright 1999-2005 Gentoo Technologies, Inc.
 # Distributed under the terms of the GNU General Public License, v2 or later
-# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/files/iscsid-init.d,v 1.1 2005/09/20 04:33:34 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/files/iscsid-init.d,v 1.2 2005/09/20 08:00:38 robbat2 Exp $
 
 PID_FILE=/var/run/iscsid.pid
 CONFIG_FILE=/etc/iscsid.conf
+DUMP_DIR=/var/db/iscsi
+DUMP_NODE="${DUMP_DIR}/node.dump"
+DUMP_DISCOVERY="${DUMP_DIR}/discovery.dump"
 INITIATORNAME=/etc/initiatorname.iscsi
 DAEMON=/usr/sbin/iscsid
 
@@ -23,58 +26,50 @@ checkconfig() {
 
 start() {
        checkconfig
-       echo -n "Starting iSCSI initiator service: "
+       ebegin "Starting iSCSI initiator service"
        modprobe scsi_transport_iscsi
        modprobe iscsi_tcp
        start-stop-daemon --start --exec $DAEMON --quiet
-       RETVAL=$?
-       if [ $RETVAL == "0" ]; then
-           echo "succeeded."
-       else
-           echo "failed."
-       fi          
-
-       echo -n "Removing iSCSI modules: "
-       modprobe -r iscsi_tcp
-       modprobe -r scsi_transport_iscsi
-       RETVAL=$?
-       if [ $RETVAL == "0" ]; then
-           echo "succeeded."
-       else
-           echo "failed."
-           return 1
-       fi
+       ret=$?
+       eend $ret
+       [ $ret -gt 0 ] && return $ret
 }
        
 stop() {
-       echo -n "Stopping iSCSI initiator service: "
+       ebegin "Stopping iSCSI initiator service"
        start-stop-daemon --stop --quiet --exec $DAEMON --pidfile $PID_FILE
-       RETVAL=$?
-       if [ $RETVAL == "0" ]; then
-           echo "succeeded."
-       else
-           echo "failed."
-       fi
+       eend $?
+
        # ugly, but pid file is not removed by iscsid
        rm -f $PID_FILE
+       
+       ebegin "Removing iSCSI modules"
+       modprobe -r iscsi_tcp
+       modprobe -r scsi_transport_iscsi
+       ret=$?
+       eend $ret
+       [ $ret -gt 0 ] && return $ret
 }
 
 opts="${opts} dump"
 
 dump() {
-       DUMP=`tempfile -p iscsid`
-       RETVAL=$?
-       if [ $RETVAL != "0" ]; then
-           echo "Failed to create dump file $DUMP"
-           return 1
-       fi
-       /usr/sbin/iscsiadm -m node --record 0a45f8 >$DUMP
-       RETVAL=$?
-       if [ $RETVAL != "0" ]; then
-           echo "Error dumping config from daemon"
-           rm $DUMP
-           return 1
-       fi
-       mv -u $DUMP $CONFIG_FILE
-       echo "Config dumped to $CONFIG_FILE"
+       einfo "Starting dump of iscsid database (nodes)"
+       NODELIST="$(iscsiadm -m node |  awk -F '[\\[\\]]' '{print $2}')"
+       [ -f ${DUMP_NODE} ] && mv -f ${DUMP_NODE} ${DUMP_NODE}.old
+       for i in $NODELIST ; do
+               echo "# $(iscsiadm -m node | egrep "^\[$i\]")" >>${DUMP_NODE}
+               iscsiadm -m node --record=$i >>${DUMP_NODE}
+               echo >>${DUMP_NODE}
+       done
+       einfo "Starting dump of iscsid database (discovery)"
+       DISCOVERYLIST="$(iscsiadm -m discovery |  awk -F '[\\[\\]]' '{print $2}')"
+       [ -f ${DUMP_DISCOVERY} ] && mv -f ${DUMP_DISCOVERY} ${DUMP_DISCOVERY}.old
+       for i in $DISCOVERYLIST ; do
+               echo "# $(iscsiadm -m discovery | egrep "^\[$i\]")" >>${DUMP_DISCOVERY}
+               iscsiadm -m discovery --record=$i >>${DUMP_DISCOVERY}
+               echo >>${DUMP_DISCOVERY}
+       done
+
+       einfo "Config dumped to ${DUMP_DIR}/"
 }
index 2c2a90e9e3ed3723bd3759d7f770edf5b6bf72a6..a40aa904bdd41a076a729a648af98ab5f0000949 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/open-iscsi-0.4.413.ebuild,v 1.1 2005/09/20 04:33:34 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/open-iscsi-0.4.413.ebuild,v 1.2 2005/09/20 08:00:38 robbat2 Exp $
 
 inherit versionator linux-mod eutils
 
@@ -8,7 +8,7 @@ DESCRIPTION="Open-iSCSI project is a high performance, transport independent, mu
 HOMEPAGE="http://www.open-iscsi.org/"
 MY_PV="$(replace_version_separator 2 '-')"
 MY_P="${PN}-${MY_PV}"
-SRC_URI="http://dev.gentoo.org/~robbat2/distfiles/${MY_P}.tar.gz"
+SRC_URI="mirror://gentoo/${MY_P}.tar.gz"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~x86 ~amd64"
@@ -20,7 +20,7 @@ RDEPEND="${DEPEND}
                sys-apps/util-linux"
 S="${WORKDIR}/${MY_P}"
 
-MODULE_NAMES_ARG="drivers/scsi:${S}/kernel"
+MODULE_NAMES_ARG="kernel/drivers/scsi:${S}/kernel"
 MODULE_NAMES="iscsi_tcp(${MODULE_NAMES_ARG}) scsi_transport_iscsi(${MODULE_NAMES_ARG})"
 BUILD_TARGETS="all"
 CONFIG_CHECK="CRYPTO_MD5 CRYPTO_CRC32C"
@@ -70,4 +70,15 @@ src_install() {
        doins etc/iscsid.conf
        doins ${FILESDIR}/initiatorname.iscsi
        newinitd ${FILESDIR}/iscsid-init.d iscsid
+
+       # security
+       keepdir /var/db/iscsi
+       fperms 700 /var/db/iscsi
+       fperms 600 /etc/iscsid.conf
+}
+
+pkg_postinst() {
+       linux-mod_pkg_postinst
+       [ -d /var/db/iscsi ] && chmod 700 /var/db/iscsi
+       [ -f /etc/iscsid.conf ] && chmod 600 /etc/iscsid.conf
 }