public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Lars Wendler" <polynomial-c@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-block/vblade/files/, sys-block/vblade/
Date: Mon, 14 Aug 2017 13:36:20 +0000 (UTC)	[thread overview]
Message-ID: <1502717772.cc62e07606d5568e34dde4c9343e894044587214.polynomial-c@gentoo> (raw)

commit:     cc62e07606d5568e34dde4c9343e894044587214
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 14 13:31:37 2017 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon Aug 14 13:36:12 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc62e076

sys-block/vblade: Bump to version 23 (bug #536330).

Added new init script provided by Mark Tomich in bug #522898.

Package-Manager: Portage-2.3.7, Repoman-2.3.3

 sys-block/vblade/Manifest                       |   1 +
 sys-block/vblade/files/init.d-vblade.vblade0-r1 | 125 ++++++++++++++++++++++++
 sys-block/vblade/vblade-23.ebuild               |  39 ++++++++
 3 files changed, 165 insertions(+)

diff --git a/sys-block/vblade/Manifest b/sys-block/vblade/Manifest
index 8a3e40e86f9..d755caad894 100644
--- a/sys-block/vblade/Manifest
+++ b/sys-block/vblade/Manifest
@@ -1,2 +1,3 @@
 DIST vblade-20.tgz 26689 SHA256 c8fe2fc4f2fba8e07e5cfdf17335982584eef2cd5c78bf8b1db93f2b56e7121d SHA512 b6c10ff9d75a2fc99c93af6b6de8f23c8b17ab70e2d5ed7049389ee8752ad001b3940764af16ff06f7f38c7bc528065edb0f285663af6fdd00fe58f022c26f02 WHIRLPOOL c663c997216d5b2694331911376f61464187bf2225a92e812fb8e152a40ae0582abeefcbed61fbdd902fc188f90a68bf83b32f3f319bd30620d92c57d50decb3
 DIST vblade-21.tgz 26434 SHA256 b5740bb7d57141769ba77baa3c690f134dd62069f1df310debc2520d416a1b92 SHA512 cf2826fd40a5c1377dd65149581b10460a55eb17f480a7fd3bdd35fbe8066a8c571b62ebb93dbfadad3aac569a03b142bff1df2c4a49efff98ad5ed084739d14 WHIRLPOOL e9555817ccaad19a3d36824efcb3339d67f5e5dbb6a39a5980eb2b17282a4ea173907d3917d98fb991b6816aac065ec36f6be6079d55b2786bfa22d03f35d16c
+DIST vblade-23.tar.gz 27432 SHA256 aa3c2035d6b14ab30ef1cee333092fcd5d1509211d737f181833a6a370973b21 SHA512 a27379933b5c0fc84966f47e0ee0089fe978fe77ea38d91c21fb6bb6bc4fa7f393b8b4c57f84c6840b549908eb8666847f121b836e3a076895e038e8096c0cfa WHIRLPOOL a89ec60c3d457962b8e2d95850e5083d16e1556d3da228dabc8ffb1ed0168a560cf6b7dc590c03a0272c79de62958fea4e6cd7b9c95aa16999fd75296ddf8a22

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 00000000000..174e473ffc1
--- /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/vblade-23.ebuild b/sys-block/vblade/vblade-23.ebuild
new file mode 100644
index 00000000000..bf2ac029094
--- /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
+}


             reply	other threads:[~2017-08-14 13:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-14 13:36 Lars Wendler [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-08-31  3:17 [gentoo-commits] repo/gentoo:master commit in: sys-block/vblade/files/, sys-block/vblade/ Thomas Deutschmann
2021-06-17 23:20 Thomas Deutschmann
2021-09-04 17:35 David Seifert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1502717772.cc62e07606d5568e34dde4c9343e894044587214.polynomial-c@gentoo \
    --to=polynomial-c@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox