Initial checkin of our local portage overlay

git-svn-id: svn+ssh://svnintern.kmrc.de/projects/gentoo/iwm-overlay@4226 cbe59ace-07ea-0310-918e-868702b5370d
This commit is contained in:
Torsten Kurbad 2007-05-02 09:19:43 +00:00
commit 9f7196c9b7
5 changed files with 265 additions and 0 deletions

View File

@ -0,0 +1,16 @@
AUX initiatorname.iscsi 1282 RMD160 6af81c25d2704e2c6bb98ff5155de91cdbd17ff7 SHA1 2d2b0a50652772e0e3a16f3a90ef5977639b97ee SHA256 4ae558522881796f67ad5915ecf38d01e64c9d9768469847adb17405404485f3
MD5 c1652519ed63d33125269c9016b962ba files/initiatorname.iscsi 1282
RMD160 6af81c25d2704e2c6bb98ff5155de91cdbd17ff7 files/initiatorname.iscsi 1282
SHA256 4ae558522881796f67ad5915ecf38d01e64c9d9768469847adb17405404485f3 files/initiatorname.iscsi 1282
AUX iscsid-init.d 3598 RMD160 f409f2c0620ecbeceb05f6999e4815f7a46419cb SHA1 12b89df96c9926169ef311b95071e1d2535b4082 SHA256 5d9066f86164973c6d99c76a37a7371596090e9eea1316cd67a4f084de3d6ae1
MD5 6c5621957755b1595ca12bd4fec0a1cf files/iscsid-init.d 3598
RMD160 f409f2c0620ecbeceb05f6999e4815f7a46419cb files/iscsid-init.d 3598
SHA256 5d9066f86164973c6d99c76a37a7371596090e9eea1316cd67a4f084de3d6ae1 files/iscsid-init.d 3598
DIST open-iscsi-2.0-754.tar.gz 223383 RMD160 841035a1da90e701719f4f7989616de9f613aac6 SHA1 1506a293d48dc88aff09299cb8f6f9d236905dbd SHA256 fc286e8bc457612af733fafab0608a25280b81f7306c9f218c9361e1fd8e573e
EBUILD open-iscsi-2.0.754.ebuild 2303 RMD160 d6b3a32da47c6201641dc5d4a6ec1673a7269e27 SHA1 f31cfec163228378d2621a0a33b667fae0b50334 SHA256 cbe061d185470710e39ce6406771faa47f1ea7f03a2246c95d8610c45a2055b5
MD5 8a849a89afaf607974bbab90a3874ac3 open-iscsi-2.0.754.ebuild 2303
RMD160 d6b3a32da47c6201641dc5d4a6ec1673a7269e27 open-iscsi-2.0.754.ebuild 2303
SHA256 cbe061d185470710e39ce6406771faa47f1ea7f03a2246c95d8610c45a2055b5 open-iscsi-2.0.754.ebuild 2303
MD5 2205c92654f59f3b784966cdcdc97394 files/digest-open-iscsi-2.0.754 256
RMD160 35d5d4379fb7f611631d3863daffbd4034d3de06 files/digest-open-iscsi-2.0.754 256
SHA256 ac44155a6a3320e0f4e16047ac251f48f127ca2b2067163cb2a9a7ce23822e3a files/digest-open-iscsi-2.0.754 256

View File

@ -0,0 +1,3 @@
MD5 2e7ce941ea4e4eda7c82f0b272a33bf9 open-iscsi-2.0-754.tar.gz 223383
RMD160 841035a1da90e701719f4f7989616de9f613aac6 open-iscsi-2.0-754.tar.gz 223383
SHA256 fc286e8bc457612af733fafab0608a25280b81f7306c9f218c9361e1fd8e573e open-iscsi-2.0-754.tar.gz 223383

View File

@ -0,0 +1,31 @@
# 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/initiatorname.iscsi,v 1.2 2006/03/08 09:19:25 robbat2 Exp $
#
# This file must contain a InitiatorName entry!
# white space is significent here!
#InitiatorName=iqn.2005-09.tld.domain.hostname:openiscsi-initiator
#InitiatorAlias=foobar
# Sample documentation follows:
# The InitiatorName should take the following format
# iqn.${YEAR}-${MONTH}-${DOMAIN_REVERSED}.${HOSTNAME}:${UNIQUE_STRING}
# Where YEAR and MONTH are the dates that your domain was registered.
# You can use WHOIS to find when your domain was registered.
# If you don't have a real domain in the outside world, invent one, but use
# .local for your top-level.
# Example case #1:
# This assumes you own foobar.co.uk.
# Domain name: foobar.co.uk.
# Registration date: March 2001
# Hostname: linux
# InitiatorName=iqn.2001-03.uk.co.foobar.linux:openiscsi-29b48ad602d5f83dd9cd9aa3ef741216
# Example case #2:
# This assumes you don't have a domain of your own.
# Domain name: foobar.local
# Registration date: March 2001
# Hostname: linux
# InitiatorName=iqn.2001-03.local.foobar.linux:openiscsi-29b48ad602d5f83dd9cd9aa3ef741216

View File

@ -0,0 +1,137 @@
#!/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.4 2006/03/07 08:26:46 robbat2 Exp $
PID_FILE=/var/run/iscsid.pid
CONFIG_FILE=/etc/iscsi/iscsid.conf
DUMP_DIR=/etc/iscsi
DUMP_NODE="${DUMP_DIR}/node.dump"
DUMP_DISCOVERY="${DUMP_DIR}/discovery.dump"
INITIATORNAME=/etc/iscsi/initiatorname.iscsi
DAEMON=/usr/sbin/iscsid
ADM=/usr/sbin/iscsiadm
NAME="iSCSI initiator service"
UDEVINFO=/usr/bin/udevinfo
depend() {
after modules
use net
}
checkconfig() {
if [ ! -f $CONFIG_FILE ]; then
eerror "Config file $CONFIG_FILE does not exist!"
return 1
fi
if [ ! -f $INITIATORNAME -o -z "$(egrep '^InitiatorName=' "${INITIATORNAME}")" ]; then
eerror "$INITIATORNAME should contain a string with your initiatior name, eg:"
eerror "InitiatorName=iqn.2005-09.tld.domainname.hostname:initiator-name"
eerror "Initiator name file does not exist!"
return 1
fi
}
do_modules() {
msg="$1"
shift
modules="$1"
shift
opts="$@"
for m in ${modules}; do
ebegin "${msg} - ${m}"
modprobe ${opts} $m
ret=$?
eend $ret
[ $ret -ne 0 ] && return $ret
done
return 0
}
start() {
checkconfig || return 1
do_modules 'Loading iSCSI modules' 'scsi_transport_iscsi iscsi_tcp'
ret=$?
[ $ret -ne 0 ] && return 1
ebegin "Starting ${NAME}"
start-stop-daemon --start --exec $DAEMON --quiet -- -i $INITIATORNAME
ret=$?
eend $ret
ebegin "Logging in to all automatic nodes"
${ADM} -m node -L automatic
ret=$?
eend $ret
sleep 5
ebegin "Mounting all disks with entries in /etc/fstab"
PARTITIONS=""
DISKS="`iscsiadm -m session -i | grep '^Attached scsi disk ' | awk '{ print $4; }'`"
for DISK in "${DISKS}" ; do
PARTITIONS="`find /dev -name \"${DISK}[0-9]*\" | grep -v '\.udev/'` ${PARTITIONS}"
done
for PARTITION in "${PARTITIONS}" ; do
PART_LABEL="`${UDEVINFO} -q env -n ${PARTITION} | grep '^ID_FS_LABEL=' | awk -F '=' '{ print $2; }'`"
IN_FSTAB="`grep ${PART_LABEL} /etc/fstab`"
if [ "x${IN_FSTAB}" != "x" ] ; then
mount -s /dev/disk/by-label/${PART_LABEL}
fi
done
ret=$?
eend $ret
return $ret
}
stop() {
ebegin "Unmounting all disks with entries in /etc/mtab"
ISCSI_MOUNTS="`grep _netdev /etc/mtab | awk '{ print $1; }'`"
for ISCSI_MOUNT in "${ISCSI_MOUNTS}" ; do
umount ${ISCSI_MOUNT}
done
ret=$?
eend $ret
ebegin "Logging out of all nodes"
${ADM} -m node -U all
ret=$?
eend $ret
ebegin "Stopping ${NAME}"
start-stop-daemon --signal HUP --stop --quiet --exec $DAEMON #--pidfile $PID_FILE
eend $?
# ugly, but pid file is not removed by iscsid
rm -f $PID_FILE
do_modules 'Removing iSCSI modules' 'iscsi_tcp scsi_transport_iscsi' '-r'
ret=$?
return $ret
}
opts="${opts} dump"
dump() {
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}/"
}

View File

@ -0,0 +1,78 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-block/open-iscsi/open-iscsi-1.0.514.ebuild,v 1.2 2006/05/23 01:55:46 robbat2 Exp $
inherit versionator linux-mod eutils flag-o-matic
DESCRIPTION="High performance, transport independent, multi-platform implementation of RFC3720."
HOMEPAGE="http://www.open-iscsi.org/"
MY_PV="$(replace_version_separator 2 '-')"
MY_P="${PN}-${MY_PV}"
SRC_URI="http://www.open-iscsi.org/bits/${MY_P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~amd64 ~ppc"
IUSE="debug module"
RDEPEND="virtual/modutils
sys-apps/util-linux"
DEPEND="${RDEPEND}
virtual/linux-sources"
S="${WORKDIR}/${MY_P}"
MODULE_NAMES_ARG="kernel/drivers/scsi:${S}/kernel"
MODULE_NAMES="iscsi_tcp(${MODULE_NAMES_ARG}) libiscsi(${MODULE_NAMES_ARG}) scsi_transport_iscsi(${MODULE_NAMES_ARG})"
BUILD_TARGETS="all"
CONFIG_CHECK="CRYPTO_CRC32C"
ERROR_CFG="open-iscsi needs CRC32C support in your kernel."
src_compile() {
if use module; then
use debug && append-flags -DDEBUG_TCP -DDEBUG_SCSI
einfo "Building kernel modules"
export KSRC="${KERNEL_DIR}"
linux-mod_src_compile || die "failed to build modules"
fi
einfo "Building userspace"
cd usr && emake || die "emake failed"
}
src_install() {
if use module; then
einfo "Installing kernel modules"
export KSRC="${KERNEL_DIR}"
linux-mod_src_install
fi
einfo "Installing userspace"
dosbin usr/iscsid usr/iscsiadm usr/iscsistart
einfo "Installing docs"
doman doc/*[1-8]
dodoc README THANKS
docinto test
dodoc test/*
einfo "Installing configuration"
insinto /etc/iscsi
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/iscsi/iscsid.conf
}
pkg_postinst() {
use module && linux-mod_pkg_postinst
[ -d ${ROOT}/var/db/iscsi ] && chmod 700 ${ROOT}/var/db/iscsi
[ -f ${ROOT}/etc/iscsi/iscsid.conf ] && chmod 600 ${ROOT}/etc/iscsi/iscsid.conf
ewarn "This new version of open-iscsi is not compatible with the"
ewarn "open-iscsi-1.0-485 release. You must upgrade your tools and you must"
ewarn "clear your old DB."
ewarn "To remove your old DB run: iscsiadm -m db --remove"
ebeep
epause 5
}