1 |
commit: cc62e07606d5568e34dde4c9343e894044587214 |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Aug 14 13:31:37 2017 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Aug 14 13:36:12 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc62e076 |
7 |
|
8 |
sys-block/vblade: Bump to version 23 (bug #536330). |
9 |
|
10 |
Added new init script provided by Mark Tomich in bug #522898. |
11 |
|
12 |
Package-Manager: Portage-2.3.7, Repoman-2.3.3 |
13 |
|
14 |
sys-block/vblade/Manifest | 1 + |
15 |
sys-block/vblade/files/init.d-vblade.vblade0-r1 | 125 ++++++++++++++++++++++++ |
16 |
sys-block/vblade/vblade-23.ebuild | 39 ++++++++ |
17 |
3 files changed, 165 insertions(+) |
18 |
|
19 |
diff --git a/sys-block/vblade/Manifest b/sys-block/vblade/Manifest |
20 |
index 8a3e40e86f9..d755caad894 100644 |
21 |
--- a/sys-block/vblade/Manifest |
22 |
+++ b/sys-block/vblade/Manifest |
23 |
@@ -1,2 +1,3 @@ |
24 |
DIST vblade-20.tgz 26689 SHA256 c8fe2fc4f2fba8e07e5cfdf17335982584eef2cd5c78bf8b1db93f2b56e7121d SHA512 b6c10ff9d75a2fc99c93af6b6de8f23c8b17ab70e2d5ed7049389ee8752ad001b3940764af16ff06f7f38c7bc528065edb0f285663af6fdd00fe58f022c26f02 WHIRLPOOL c663c997216d5b2694331911376f61464187bf2225a92e812fb8e152a40ae0582abeefcbed61fbdd902fc188f90a68bf83b32f3f319bd30620d92c57d50decb3 |
25 |
DIST vblade-21.tgz 26434 SHA256 b5740bb7d57141769ba77baa3c690f134dd62069f1df310debc2520d416a1b92 SHA512 cf2826fd40a5c1377dd65149581b10460a55eb17f480a7fd3bdd35fbe8066a8c571b62ebb93dbfadad3aac569a03b142bff1df2c4a49efff98ad5ed084739d14 WHIRLPOOL e9555817ccaad19a3d36824efcb3339d67f5e5dbb6a39a5980eb2b17282a4ea173907d3917d98fb991b6816aac065ec36f6be6079d55b2786bfa22d03f35d16c |
26 |
+DIST vblade-23.tar.gz 27432 SHA256 aa3c2035d6b14ab30ef1cee333092fcd5d1509211d737f181833a6a370973b21 SHA512 a27379933b5c0fc84966f47e0ee0089fe978fe77ea38d91c21fb6bb6bc4fa7f393b8b4c57f84c6840b549908eb8666847f121b836e3a076895e038e8096c0cfa WHIRLPOOL a89ec60c3d457962b8e2d95850e5083d16e1556d3da228dabc8ffb1ed0168a560cf6b7dc590c03a0272c79de62958fea4e6cd7b9c95aa16999fd75296ddf8a22 |
27 |
|
28 |
diff --git a/sys-block/vblade/files/init.d-vblade.vblade0-r1 b/sys-block/vblade/files/init.d-vblade.vblade0-r1 |
29 |
new file mode 100644 |
30 |
index 00000000000..174e473ffc1 |
31 |
--- /dev/null |
32 |
+++ b/sys-block/vblade/files/init.d-vblade.vblade0-r1 |
33 |
@@ -0,0 +1,125 @@ |
34 |
+#!/sbin/openrc-run |
35 |
+# Copyright 1999-2017 Gentoo Foundation |
36 |
+# Distributed under the terms of the GNU General Public License, v2 or later |
37 |
+ |
38 |
+extra_commands="checkconfig" |
39 |
+ |
40 |
+depend() { |
41 |
+ need net |
42 |
+} |
43 |
+ |
44 |
+# bug #218043 |
45 |
+if [ ! -f /etc/init.d/sysfs ]; then |
46 |
+ conf="$(add_suffix /etc/conf.d/vblade)" |
47 |
+ [[ -e "${conf}" ]] && source "${conf}" |
48 |
+ vblade_name="${myservice#*.}" |
49 |
+else |
50 |
+ conf="/etc/conf.d/vblade" |
51 |
+ [[ -e "${conf}" ]] && source "${conf}" |
52 |
+ vblade_name="${RC_SVCNAME#*.}" |
53 |
+fi |
54 |
+ |
55 |
+vblade_conf_variable="config_${vblade_name}" |
56 |
+vblade_conf="${!vblade_conf_variable}" |
57 |
+pidfile="/var/run/vblade-${vblade_name}.pid" |
58 |
+srvname="vblade.${vblade_name}" |
59 |
+ |
60 |
+getconfig() { |
61 |
+ args="" |
62 |
+ while getopts b:dsrm: FLAG; do |
63 |
+ case "${FLAG}" in |
64 |
+ b) is_valid_numeric "${OPTARG}" && args="${args} -b ${OPTARG}" || ewarn "vblade block size argument is non-numeric IGNORING";; |
65 |
+ |
66 |
+ d|s|r) args="${args} -${FLAG}";; |
67 |
+ |
68 |
+ # FIXME: there is no sanity checking on the MAC address...we'll leave that up to vblade |
69 |
+ m) args="${args} -m ${OPTARG}";; |
70 |
+ esac |
71 |
+ done |
72 |
+ |
73 |
+ shift $(( OPTIND - 1 )) |
74 |
+ |
75 |
+ shelf=${1} |
76 |
+ slot=${2} |
77 |
+ netif=${3} |
78 |
+ src=${4} |
79 |
+ |
80 |
+ export args shelf slot netif src |
81 |
+} |
82 |
+ |
83 |
+checkconfig() { |
84 |
+ if [ -z "${vblade_conf}" ]; then |
85 |
+ eerror "vblade configuration not specified for ${vblade_name}" |
86 |
+ return 1 |
87 |
+ fi |
88 |
+ getconfig ${vblade_conf} |
89 |
+ |
90 |
+ is_valid_numeric "${shelf}" 0 |
91 |
+ if [[ $? -ne 0 ]]; then |
92 |
+ eerror "Shelf '${shelf}' is non-numeric or less than zero." |
93 |
+ return 1 |
94 |
+ fi |
95 |
+ is_valid_numeric "${slot}" 0 15 |
96 |
+ if [[ $? -ne 0 ]]; then |
97 |
+ eerror "Slot '${slot}' is outside the valid range [0..15]." |
98 |
+ return 1 |
99 |
+ fi |
100 |
+ |
101 |
+ sysfs_base="/sys/class/net/" |
102 |
+ procfs_base="/proc/sys/net/ipv4/conf/" |
103 |
+ if test ! \( -e "${sysfs_base}${netif}" -o -e "${procfs_base}${netif}" \); then |
104 |
+ eerror "Network interface '${netif}' does not exist" |
105 |
+ return 1 |
106 |
+ fi |
107 |
+ |
108 |
+ if test ! \( -f "${src}" -o -b "${src}" \) ; then |
109 |
+ eerror "Source '${src}' must be a file or block device" |
110 |
+ return 1 |
111 |
+ fi |
112 |
+ |
113 |
+ if test ! \( -e "${src}" -a -r "${src}" \) ; then |
114 |
+ eerror "Source '${src}' is not readable." |
115 |
+ return 1 |
116 |
+ fi |
117 |
+ |
118 |
+ return 0 |
119 |
+} |
120 |
+ |
121 |
+is_valid_numeric() { |
122 |
+ num="${1}" |
123 |
+ min="${2}" |
124 |
+ max="${3}" |
125 |
+ # non-numeric |
126 |
+ test "$num" -ge "0" 2>/dev/null |
127 |
+ rc=$? |
128 |
+ test "$rc" -eq 2 && return 2 |
129 |
+ # check for min |
130 |
+ test -z "$min" && return 0 |
131 |
+ test "$num" -lt "$min" && return 1 |
132 |
+ # check for max |
133 |
+ test -z "$max" && return 0 |
134 |
+ test "$num" -gt "$max" && return 1 |
135 |
+ # done |
136 |
+ return 0 |
137 |
+} |
138 |
+ |
139 |
+start() { |
140 |
+ checkconfig || return 1 |
141 |
+ ebegin "Starting ${srvname}: e${shelf}.${slot} on ${netif} using '${src}'" |
142 |
+ export LOGTAG="${srvname}" |
143 |
+ start-stop-daemon --start --quiet \ |
144 |
+ --pidfile ${pidfile} --background \ |
145 |
+ --make-pidfile --exec /usr/sbin/vbladed -- \ |
146 |
+ ${args} ${shelf} ${slot} ${netif} "${src}" |
147 |
+ eend $? |
148 |
+} |
149 |
+ |
150 |
+stop() { |
151 |
+ ebegin "Stopping ${srvname}" |
152 |
+ getconfig ${vblade_conf} |
153 |
+ ps -Ao pid,args | egrep "^[[:space:]]*[[:digit:]]+ /usr/sbin/vblade.* ${shelf} ${slot} " | awk '{print $1}' | xargs kill |
154 |
+ eend $? |
155 |
+} |
156 |
+ |
157 |
+# vim: ft=gentoo-init-d syntax=gentoo-init-d : |
158 |
+# vim: ai sw=4 sts=4 ts=4 : |
159 |
|
160 |
diff --git a/sys-block/vblade/vblade-23.ebuild b/sys-block/vblade/vblade-23.ebuild |
161 |
new file mode 100644 |
162 |
index 00000000000..bf2ac029094 |
163 |
--- /dev/null |
164 |
+++ b/sys-block/vblade/vblade-23.ebuild |
165 |
@@ -0,0 +1,39 @@ |
166 |
+# Copyright 1999-2017 Gentoo Foundation |
167 |
+# Distributed under the terms of the GNU General Public License v2 |
168 |
+ |
169 |
+EAPI=6 |
170 |
+ |
171 |
+inherit toolchain-funcs |
172 |
+ |
173 |
+DESCRIPTION="vblade exports a block device using AoE" |
174 |
+HOMEPAGE="https://github.com/OpenAoE/vblade" |
175 |
+SRC_URI="https://github.com/OpenAoE/${PN}/archive/${P}.tar.gz" |
176 |
+ |
177 |
+LICENSE="GPL-2" |
178 |
+SLOT="0" |
179 |
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" |
180 |
+ |
181 |
+RDEPEND="sys-apps/util-linux" |
182 |
+ |
183 |
+S="${WORKDIR}/${PN}-${P}" |
184 |
+ |
185 |
+src_prepare() { |
186 |
+ default |
187 |
+ |
188 |
+ sed -i -e 's,^CFLAGS.*,CFLAGS += -Wall,' \ |
189 |
+ -e 's:-o vblade:${LDFLAGS} \0:' \ |
190 |
+ makefile || die |
191 |
+} |
192 |
+ |
193 |
+src_compile() { |
194 |
+ emake CC="$(tc-getCC)" |
195 |
+} |
196 |
+ |
197 |
+src_install() { |
198 |
+ dosbin vblade |
199 |
+ dosbin "${FILESDIR}"/vbladed |
200 |
+ doman vblade.8 |
201 |
+ dodoc HACKING NEWS README |
202 |
+ newconfd "${FILESDIR}"/conf.d-vblade vblade |
203 |
+ newinitd "${FILESDIR}"/init.d-vblade.vblade0-r1 vblade.vblade0 |
204 |
+} |