diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2006-01-25 06:17:55 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2006-01-25 06:17:55 +0000 |
commit | f5d56084e9fe35f3434bd0457ccbcbb22e0485a5 (patch) | |
tree | 108c463275a1db01edf879b58284cb3bcf3b29b4 /sys-block | |
parent | Add a pre version for people to play with #119734 by Matthew Schick. (diff) | |
download | historical-f5d56084e9fe35f3434bd0457ccbcbb22e0485a5.tar.gz historical-f5d56084e9fe35f3434bd0457ccbcbb22e0485a5.tar.bz2 historical-f5d56084e9fe35f3434bd0457ccbcbb22e0485a5.zip |
Version bump, bug #118594. Also now includes init scripts, partially based on a submission by Markus Wagner <markus1108wagner@t-online.de>.
Package-Manager: portage-2.1_pre3-r1
Diffstat (limited to 'sys-block')
-rw-r--r-- | sys-block/vblade/ChangeLog | 11 | ||||
-rw-r--r-- | sys-block/vblade/Manifest | 13 | ||||
-rw-r--r-- | sys-block/vblade/files/conf.d-vblade | 26 | ||||
-rw-r--r-- | sys-block/vblade/files/digest-vblade-10 | 1 | ||||
-rw-r--r-- | sys-block/vblade/files/init.d-vblade.vblade0 | 109 | ||||
-rw-r--r-- | sys-block/vblade/files/vbladed | 20 | ||||
-rw-r--r-- | sys-block/vblade/vblade-10.ebuild | 42 |
7 files changed, 216 insertions, 6 deletions
diff --git a/sys-block/vblade/ChangeLog b/sys-block/vblade/ChangeLog index 3917edd9baad..a2aa44f4a6ee 100644 --- a/sys-block/vblade/ChangeLog +++ b/sys-block/vblade/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-block/vblade -# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-block/vblade/ChangeLog,v 1.3 2005/12/05 02:01:48 robbat2 Exp $ +# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-block/vblade/ChangeLog,v 1.4 2006/01/25 06:17:55 robbat2 Exp $ + +*vblade-10 (25 Jan 2006) + + 25 Jan 2006; Robin H. Johnson <robbat2@gentoo.org> +files/conf.d-vblade, + +files/init.d-vblade.vblade0, +files/vbladed, +vblade-10.ebuild: + Version bump, bug #118594. Also now includes init scripts, partially based + on a submission by Markus Wagner <markus1108wagner@t-online.de>. *vblade-9 (05 Dec 2005) diff --git a/sys-block/vblade/Manifest b/sys-block/vblade/Manifest index b6653829c409..7ba228fbfb0e 100644 --- a/sys-block/vblade/Manifest +++ b/sys-block/vblade/Manifest @@ -1,6 +1,11 @@ -MD5 db100138d182965f263349844efe9b23 vblade-9.ebuild 887 -MD5 f54f560cb083660797da2e799afe4b90 vblade-6.ebuild 887 -MD5 6145938bc9bd006c851df8c16ee95daa ChangeLog 599 -MD5 c8bc5b7915619c3198683ce72b740321 metadata.xml 202 +MD5 21c2049936841104941ad9fd5c35a052 ChangeLog 912 +MD5 34e059f8c29888d30558536919443b50 files/conf.d-vblade 929 +MD5 be08fa8f8c260b83d68c82f13b29ca66 files/digest-vblade-10 60 MD5 b57d594810cbd242c2bd7a76c0f2eba3 files/digest-vblade-6 59 MD5 62c8729984f7a526c0b5c1edf9c4b7d8 files/digest-vblade-9 59 +MD5 937f05b17136823c2b5b51f5dce257c7 files/init.d-vblade.vblade0 2564 +MD5 f29d83183c32e85e0579c7325959dbaa files/vbladed 650 +MD5 c8bc5b7915619c3198683ce72b740321 metadata.xml 202 +MD5 2cdcf9efd640caa0817004f7658560b8 vblade-10.ebuild 1083 +MD5 f54f560cb083660797da2e799afe4b90 vblade-6.ebuild 887 +MD5 db100138d182965f263349844efe9b23 vblade-9.ebuild 887 diff --git a/sys-block/vblade/files/conf.d-vblade b/sys-block/vblade/files/conf.d-vblade new file mode 100644 index 000000000000..8df7cddc591f --- /dev/null +++ b/sys-block/vblade/files/conf.d-vblade @@ -0,0 +1,26 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-block/vblade/files/conf.d-vblade,v 1.1 2006/01/25 06:17:55 robbat2 Exp $ + +# If you intent to run only one vblade, you should edit config_vblade0 +# SYNTAX: SHELF SLOT NETIF SOURCE +config_vblade0="0 0 eth0 /root/test.img" + +# SHELF is a numeric value >= 0 +# SLOT is a numeric value 0 <= X <= 15 +# NETIF is a network interface name +# SOURCE is a file or block device + +# For additional vblades, run: +# ln -s /etc/init.d/vblade.vblade0 /etc/init.d/vblade.$NAME +# and define config_$NAME in this file. + +# Note that the combination of SHELF:SLOT:NETIF should be unique for your +# network. + +# Some additional examples +# config_vblade1="0 1 eth0 /root/test2.img" +# config_foobar="0 1 eth1 /dev/md0" + +# vim: ft=filetype=gentoo-conf-d syntax=filetype=gentoo-conf-d : +# vim: ai sw=2 sts=2 ts=2 : diff --git a/sys-block/vblade/files/digest-vblade-10 b/sys-block/vblade/files/digest-vblade-10 new file mode 100644 index 000000000000..ad67aebdc5e5 --- /dev/null +++ b/sys-block/vblade/files/digest-vblade-10 @@ -0,0 +1 @@ +MD5 c51783ee3235aba58a0c095bdf5fc35c vblade-10.tar.gz 16689 diff --git a/sys-block/vblade/files/init.d-vblade.vblade0 b/sys-block/vblade/files/init.d-vblade.vblade0 new file mode 100644 index 000000000000..8f4f27758f14 --- /dev/null +++ b/sys-block/vblade/files/init.d-vblade.vblade0 @@ -0,0 +1,109 @@ +#!/sbin/runscript +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/sys-block/vblade/files/init.d-vblade.vblade0,v 1.1 2006/01/25 06:17:55 robbat2 Exp $ + +opts="${opts} checkconfig" + +depend() { + need net +} + +conf="$(add_suffix /etc/conf.d/vblade)" +[[ -e "${conf}" ]] && source "${conf}" +vblade_name="${myservice#*.}" +vblade_conf_variable="config_${vblade_name}" +vblade_conf="${!vblade_conf_variable}" +pidfile="/var/run/vblade-${vblade_name}.pid" +srvname="vblade.${vblade_name}" + +getconfig() { + tmp="${vblade_conf}" + shelf="${tmp/ *}" + tmp="${tmp#* }" + slot="${tmp/ *}" + tmp="${tmp#* }" + netif="${tmp/ *}" + tmp="${tmp#* }" + src="${tmp}" + export shelf slot netif src +} + + +checkconfig() { + if [ -z "${vblade_conf}" ]; then + eerror "vblade configuration not specified for ${vblade_name}" + return 1 + fi + getconfig + + is_valid_numeric "${shelf}" 0 + if [[ $? -ne 0 ]]; then + eerror "Shelf '${shelf}' is non-numeric or less than zero." + return 1 + fi + is_valid_numeric "${slot}" 0 15 + if [[ $? -ne 0 ]]; then + eerror "Slot '${slot}' is outside the valid range [0..15]." + return 1 + fi + + sysfs_base="/sys/class/net/" + procfs_base="/proc/sys/net/ipv4/conf/" + if test ! \( -e "${sysfs_base}${netif}" -o -e "${procfs_base}${netif}" \); then + eerror "Network interface '${netif}' does not exist" + return 1 + fi + + if test ! \( -f "${src}" -o -b "${src}" \) ; then + eerror "Source '${src}' must be a file or block device" + return 1 + fi + + if test ! \( -e "${src}" -a -r "${src}" \) ; then + eerror "Source '${src}' is not readable." + return 1 + fi + + return 0 +} + +is_valid_numeric() { + num="${1}" + min="${2}" + max="${3}" + # non-numeric + test "$num" -ge "0" 2>/dev/null + rc=$? + test "$rc" -eq 2 && return 2 + # check for min + test -z "$min" && return 0 + test "$num" -lt "$min" && return 1 + # check for max + test -z "$max" && return 0 + test "$num" -gt "$max" && return 1 + # done + return 0 +} + +start() { + checkconfig || return 1 + getconfig + ebegin "Starting ${srvname}: e${shelf}.${slot} on ${netif} using '${src}'" + export LOGTAG="${srvname}" + start-stop-daemon --start --quiet \ + --pidfile ${pidfile} --background \ + --make-pidfile --exec /usr/sbin/vbladed -- \ + ${shelf} ${slot} ${netif} "${src}" + #${shelf} ${slot} ${netif} "${src}" 2>&1 | logger -t ${srvname} & + eend $? +} + +stop() { + ebegin "Stopping ${srvname}" + start-stop-daemon --stop --quiet --pidfile ${pidfile} + eend $? +} + +# vim: ft=filetype=gentoo-init-d syntax=filetype=gentoo-init-d : +# vim: ai sw=4 sts=4 ts=4 : diff --git a/sys-block/vblade/files/vbladed b/sys-block/vblade/files/vbladed new file mode 100644 index 000000000000..a40376be600d --- /dev/null +++ b/sys-block/vblade/files/vbladed @@ -0,0 +1,20 @@ +#!/bin/sh +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-block/vblade/files/vbladed,v 1.1 2006/01/25 06:17:55 robbat2 Exp $ +# +# run a vblade daemon using a logger process +# output is directed to syslogd +# +# Although logging goes to syslog, let's going to +# protect ourselves against the most common way or +# calling vbladed: without arguments. +if [ -z "$*" ] +then + echo "Usage: vbladed <shelf> <slot> <ethn> <device>" >&2 + exit 1 +fi + +[ -z "${LOGTAG}" ] && LOGTAG=vbladed + +/usr/sbin/vblade "${@}" </dev/null 2>&1 | /usr/bin/logger -t "${LOGTAG}" diff --git a/sys-block/vblade/vblade-10.ebuild b/sys-block/vblade/vblade-10.ebuild new file mode 100644 index 000000000000..299ed28445db --- /dev/null +++ b/sys-block/vblade/vblade-10.ebuild @@ -0,0 +1,42 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-block/vblade/vblade-10.ebuild,v 1.1 2006/01/25 06:17:55 robbat2 Exp $ + +inherit eutils + +DESCRIPTION="vblade exports a block device using AoE" +HOMEPAGE="http://sf.net/projects/aoetools/" +SRC_URI="mirror://sourceforge/aoetools/${P}.tar.gz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86" +IUSE="" +DEPEND="virtual/libc" +RDEPEND="${DEPEND} + sys-apps/util-linux" + +src_unpack() { + unpack ${A} + cd ${S} + # messy tarball + make clean || die "Failed to clean up source" + sed -i 's,^CFLAGS.*,CFLAGS += -Wall,' makefile || die "Failed to clean up makefile" +} +src_compile() { + emake || die "emake failed" +} + +src_install() { + into /usr + doman vblade.8 + dodoc HACKING NEWS README + dosbin vblade + dosbin ${FILESDIR}/vbladed + newconfd ${FILESDIR}/conf.d-vblade vblade + newinitd ${FILESDIR}/init.d-vblade.vblade0 vblade.vblade0 +} + +pkg_postinst() { + einfo "We do now include an init.d script, please look in your init.d and" + einfo "conf.d directories for it." +} |