summaryrefslogtreecommitdiff
path: root/sys-block/vblade
diff options
context:
space:
mode:
Diffstat (limited to 'sys-block/vblade')
-rw-r--r--sys-block/vblade/Manifest11
-rw-r--r--sys-block/vblade/files/conf.d-vblade25
-rw-r--r--sys-block/vblade/files/init.d-vblade.vblade0120
-rw-r--r--sys-block/vblade/files/init.d-vblade.vblade0-r1125
-rw-r--r--sys-block/vblade/files/vbladed19
-rw-r--r--sys-block/vblade/metadata.xml11
-rw-r--r--sys-block/vblade/vblade-20.ebuild36
-rw-r--r--sys-block/vblade/vblade-23.ebuild39
8 files changed, 386 insertions, 0 deletions
diff --git a/sys-block/vblade/Manifest b/sys-block/vblade/Manifest
new file mode 100644
index 000000000000..17a7ee625658
--- /dev/null
+++ b/sys-block/vblade/Manifest
@@ -0,0 +1,11 @@
+AUX conf.d-vblade 817 SHA256 b7cd23549819508d777c7d5a4b2dbc75c1b5a91c84846d8a57e383068088a4b9 SHA512 b65275d01a367888d16a3d51b189f01ceb7634d7b5a1dc02860ecae9a5030d18e99fd47a842748b5ccf48204242fb6d7613698fc3e21f6a1790d91a7600c172f WHIRLPOOL bf9e891b5f055abce93a3a17c5a37c22a73c584116b2a9d99e494077064d939ffc73e7c8eea7a62c7a88986fdc0a508deb7b34d7c6a4566134dcd451ef1ae06b
+AUX init.d-vblade.vblade0 2785 SHA256 f7666d9ddbce1d18fff763823644cd51a9df1c5f5cd428d00efcc9b11cca28e2 SHA512 d2665414e5e3fb209e90a7a7bd63edf5dce61735a4bdd1bf347d8b55b9ad57e88eaa2c9c995294ffffa89da7727f5facdfe9468ed212ed6d0497304b54bf92df WHIRLPOOL 1753819673e09aecf52f5b04d3ad6919c16f4c79d34046ee3b1816f038957a08658e020c7f2b685759e724a0103f16d3ac53f7d555b781a612108fb5a0be6e40
+AUX init.d-vblade.vblade0-r1 2927 SHA256 db25f9332915f2d90955301548921fba17bde062a56dfda628dfa685b87c3aed SHA512 97a72cbf49e363ab1bc62b43c84c04ece79e777c3c427ce59850f257203124bfb662e6e7959e3d77d06bc9e85de3fb030e42d325e1ba258dbd184ac6ab46e438 WHIRLPOOL 593f2ffcde16673aedb744d97d84c454a1962f8cd4efc1263528b125b965beca8464266a2bf7f67d55d92bf2c898f368586ad5ca0d8875648c5a68d8c9396077
+AUX vbladed 544 SHA256 0a7f5a803e42f56455448f6ecc2227f67976cafc2fb032542e0f0d33378d59e1 SHA512 447dbec563f41848727fe72ff391c07136509acbb707cf427485ef9ad190ec4247d809a2d71136e8f5456cf4f1798b89c9ca4ddcc4407f71d63ad220dab37c30 WHIRLPOOL a52776ae4abeca1facd9619f75360dabf4f45f0c45e132481f676ffc607f5ae22ab47fa869009d13904f757b9cfbaf615bfe44d2a72cd7dd2dc83fc49755083e
+DIST vblade-20.tgz 26689 SHA256 c8fe2fc4f2fba8e07e5cfdf17335982584eef2cd5c78bf8b1db93f2b56e7121d SHA512 b6c10ff9d75a2fc99c93af6b6de8f23c8b17ab70e2d5ed7049389ee8752ad001b3940764af16ff06f7f38c7bc528065edb0f285663af6fdd00fe58f022c26f02 WHIRLPOOL c663c997216d5b2694331911376f61464187bf2225a92e812fb8e152a40ae0582abeefcbed61fbdd902fc188f90a68bf83b32f3f319bd30620d92c57d50decb3
+DIST vblade-23.tar.gz 27432 SHA256 aa3c2035d6b14ab30ef1cee333092fcd5d1509211d737f181833a6a370973b21 SHA512 a27379933b5c0fc84966f47e0ee0089fe978fe77ea38d91c21fb6bb6bc4fa7f393b8b4c57f84c6840b549908eb8666847f121b836e3a076895e038e8096c0cfa WHIRLPOOL a89ec60c3d457962b8e2d95850e5083d16e1556d3da228dabc8ffb1ed0168a560cf6b7dc590c03a0272c79de62958fea4e6cd7b9c95aa16999fd75296ddf8a22
+EBUILD vblade-20.ebuild 757 SHA256 b352ccf53a40839d3b243f3c693644b9b2bf13e4d8089734607fb9eb377b7cf0 SHA512 9c884688885859be759c23f1dd1418b28915ed2c059a2aa060af9a82b57919197366b1c1b89025074c0c309ff57e9142f001c2cf8f80aacac7f1492452bea07c WHIRLPOOL f3e996ebbf00eeaccba4a356ae12a4cb17ba38ffd50b5d9c159b1750c1b97e115afdda9097e8e517068f2a052a610be839bec4e9b4d3b271328d50810df93a7b
+EBUILD vblade-23.ebuild 808 SHA256 9c1864ff38a622d5c0044b0c3fc2fde45cb04830dee277585ee47edfb77a4285 SHA512 1d6cfabebd2ba3fc13128db1a438967418fdd16c3136b6019b9094c152a85d37d3ffda0cea6abf557937c603400338d5cabac6693594c791c477f8ac8ee8b30f WHIRLPOOL 47b081eab829f9a3375c981492718aa96a320f41e6a628817f29cdde4d1454fd03cc513605ce95aef8eb071f215dcc3f8d9a293284cf0e85b1291f2364f2af02
+MISC ChangeLog 3332 SHA256 c5aa8ed2cbfd1a4043009db7f42605be770c80210c1fd8a78047ee03fc7b4aef SHA512 2f1c066570cb9cb8765fb836249fe3524fbebbca3ff5b9f4fe85b6a8052ad0d583ef3a0ed5e9609c9ad5cd885aec88d03fe1dce3ed74066157b8ced1b251d88d WHIRLPOOL 01cdfe1b7c17f6c5c910194edf53aa25b942d47ea8ac8bc4e6b00701498450571b0e59b19f4baffdd031c82e2fc595f53a1475e189a69116070efb9235b9d040
+MISC ChangeLog-2015 4998 SHA256 850d0cf500e3b546f40deeb281d18b5bcdcf1ed060f3c989b8cc2eb4553966dd SHA512 a3ec3288f6fe0156a9eebb10dc55f960b8db4d060d7411c62ea95ad2ce975fa4b9a48aceae61b032c32d64267dedb2586fec829444434bd51e77885c4b53af90 WHIRLPOOL a0f4e4e90809c20cc46312424ac7d388bd054094029c7b6652bb8f7e77632c092048a325263da4c3c1b04906d248bc2707fef6071e4128b470709eaab12a940f
+MISC metadata.xml 328 SHA256 53eb7f304a093aba136350c98c1f0d82c088a18ca49920dafafd17d3ebab84d5 SHA512 5f04425d524c4535b0b3b42a2c310afa42f09649929f08e12bb491ae808f2fb8dbd08e3c153426bdcef328291b9b19feea2c557ef0a2c6e3a98fc69824c11ca5 WHIRLPOOL 8695fe66b114b944cacf5b9f24751e2c3dad5d89e7dcdd9a5fbc231447994ba187e6be34ea733c6ac605e505cab26d7197648bc52e92be9e57d67b5674af8f76
diff --git a/sys-block/vblade/files/conf.d-vblade b/sys-block/vblade/files/conf.d-vblade
new file mode 100644
index 000000000000..4948543ee6e2
--- /dev/null
+++ b/sys-block/vblade/files/conf.d-vblade
@@ -0,0 +1,25 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# 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/init.d-vblade.vblade0 b/sys-block/vblade/files/init.d-vblade.vblade0
new file mode 100644
index 000000000000..253304dc187a
--- /dev/null
+++ b/sys-block/vblade/files/init.d-vblade.vblade0
@@ -0,0 +1,120 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+extra_commands="checkconfig"
+
+depend() {
+ need net
+}
+
+# bug #218043
+if [ ! -f /etc/init.d/sysfs ]; then
+ conf="$(add_suffix /etc/conf.d/vblade)"
+ [[ -e "${conf}" ]] && source "${conf}"
+ vblade_name="${myservice#*.}"
+else
+ conf="/etc/conf.d/vblade"
+ [[ -e "${conf}" ]] && source "${conf}"
+ vblade_name="${RC_SVCNAME#*.}"
+fi
+
+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}"
+ eend $?
+
+ #${shelf} ${slot} ${netif} "${src}" 2>&1 | logger -t ${srvname} &
+}
+
+stop() {
+ ebegin "Stopping ${srvname}"
+ #start-stop-daemon --stop --quiet --pidfile ${pidfile}
+ getconfig
+ ps -Ao pid,args | egrep "^[[:space:]]*[[:digit:]]+ /usr/sbin/vbladed? ${shelf} ${slot}" | awk '{print $1}' | xargs kill
+ eend $?
+
+ #start-stop-daemon --stop --quiet --exec /usr/sbin/vblade
+}
+
+# vim: ft=gentoo-init-d syntax=gentoo-init-d :
+# vim: ai sw=4 sts=4 ts=4 :
diff --git a/sys-block/vblade/files/init.d-vblade.vblade0-r1 b/sys-block/vblade/files/init.d-vblade.vblade0-r1
new file mode 100644
index 000000000000..174e473ffc17
--- /dev/null
+++ b/sys-block/vblade/files/init.d-vblade.vblade0-r1
@@ -0,0 +1,125 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+extra_commands="checkconfig"
+
+depend() {
+ need net
+}
+
+# bug #218043
+if [ ! -f /etc/init.d/sysfs ]; then
+ conf="$(add_suffix /etc/conf.d/vblade)"
+ [[ -e "${conf}" ]] && source "${conf}"
+ vblade_name="${myservice#*.}"
+else
+ conf="/etc/conf.d/vblade"
+ [[ -e "${conf}" ]] && source "${conf}"
+ vblade_name="${RC_SVCNAME#*.}"
+fi
+
+vblade_conf_variable="config_${vblade_name}"
+vblade_conf="${!vblade_conf_variable}"
+pidfile="/var/run/vblade-${vblade_name}.pid"
+srvname="vblade.${vblade_name}"
+
+getconfig() {
+ args=""
+ while getopts b:dsrm: FLAG; do
+ case "${FLAG}" in
+ b) is_valid_numeric "${OPTARG}" && args="${args} -b ${OPTARG}" || ewarn "vblade block size argument is non-numeric IGNORING";;
+
+ d|s|r) args="${args} -${FLAG}";;
+
+ # FIXME: there is no sanity checking on the MAC address...we'll leave that up to vblade
+ m) args="${args} -m ${OPTARG}";;
+ esac
+ done
+
+ shift $(( OPTIND - 1 ))
+
+ shelf=${1}
+ slot=${2}
+ netif=${3}
+ src=${4}
+
+ export args shelf slot netif src
+}
+
+checkconfig() {
+ if [ -z "${vblade_conf}" ]; then
+ eerror "vblade configuration not specified for ${vblade_name}"
+ return 1
+ fi
+ getconfig ${vblade_conf}
+
+ 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
+ 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 -- \
+ ${args} ${shelf} ${slot} ${netif} "${src}"
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${srvname}"
+ getconfig ${vblade_conf}
+ ps -Ao pid,args | egrep "^[[:space:]]*[[:digit:]]+ /usr/sbin/vblade.* ${shelf} ${slot} " | awk '{print $1}' | xargs kill
+ eend $?
+}
+
+# vim: ft=gentoo-init-d syntax=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..5822d677843a
--- /dev/null
+++ b/sys-block/vblade/files/vbladed
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+#
+# 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/metadata.xml b/sys-block/vblade/metadata.xml
new file mode 100644
index 000000000000..c8d6e3faca25
--- /dev/null
+++ b/sys-block/vblade/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<upstream>
+ <remote-id type="sourceforge">aoetools</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-block/vblade/vblade-20.ebuild b/sys-block/vblade/vblade-20.ebuild
new file mode 100644
index 000000000000..7d5ed1198e8e
--- /dev/null
+++ b/sys-block/vblade/vblade-20.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit toolchain-funcs
+
+DESCRIPTION="vblade exports a block device using AoE"
+HOMEPAGE="http://sf.net/projects/aoetools/"
+SRC_URI="mirror://sourceforge/aoetools/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ppc64 x86"
+IUSE=""
+
+RDEPEND="sys-apps/util-linux"
+
+src_prepare() {
+ sed -i -e 's,^CFLAGS.*,CFLAGS += -Wall,' \
+ -e 's:-o vblade:${LDFLAGS} \0:' \
+ makefile || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ dosbin vblade
+ dosbin "${FILESDIR}"/vbladed
+ doman vblade.8
+ dodoc HACKING NEWS README
+ newconfd "${FILESDIR}"/conf.d-vblade vblade
+ newinitd "${FILESDIR}"/init.d-vblade.vblade0 vblade.vblade0
+}
diff --git a/sys-block/vblade/vblade-23.ebuild b/sys-block/vblade/vblade-23.ebuild
new file mode 100644
index 000000000000..bf2ac0290947
--- /dev/null
+++ b/sys-block/vblade/vblade-23.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs
+
+DESCRIPTION="vblade exports a block device using AoE"
+HOMEPAGE="https://github.com/OpenAoE/vblade"
+SRC_URI="https://github.com/OpenAoE/${PN}/archive/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+
+RDEPEND="sys-apps/util-linux"
+
+S="${WORKDIR}/${PN}-${P}"
+
+src_prepare() {
+ default
+
+ sed -i -e 's,^CFLAGS.*,CFLAGS += -Wall,' \
+ -e 's:-o vblade:${LDFLAGS} \0:' \
+ makefile || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ dosbin vblade
+ dosbin "${FILESDIR}"/vbladed
+ doman vblade.8
+ dodoc HACKING NEWS README
+ newconfd "${FILESDIR}"/conf.d-vblade vblade
+ newinitd "${FILESDIR}"/init.d-vblade.vblade0-r1 vblade.vblade0
+}