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