1 |
commit: 47fd69ecdf0411ae786a83ed41e4dae74f9e4af4 |
2 |
Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 2 16:53:25 2017 +0000 |
4 |
Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 2 16:55:15 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47fd69ec |
7 |
|
8 |
sys-block/open-iscsi: bup to fix musl breakage |
9 |
|
10 |
Package-Manager: portage-2.3.0 |
11 |
|
12 |
sys-block/open-iscsi/files/musl-fixes.patch | 64 ++++++++++++ |
13 |
sys-block/open-iscsi/open-iscsi-2.0.873-r3.ebuild | 115 ++++++++++++++++++++++ |
14 |
2 files changed, 179 insertions(+) |
15 |
|
16 |
diff --git a/sys-block/open-iscsi/files/musl-fixes.patch b/sys-block/open-iscsi/files/musl-fixes.patch |
17 |
new file mode 100644 |
18 |
index 00000000..f101eda |
19 |
--- /dev/null |
20 |
+++ b/sys-block/open-iscsi/files/musl-fixes.patch |
21 |
@@ -0,0 +1,64 @@ |
22 |
+--- ./utils/open-isns/isns.h.orig |
23 |
++++ ./utils/open-isns/isns.h |
24 |
+@@ -13,6 +13,7 @@ |
25 |
+ #include <sys/socket.h> |
26 |
+ #include <netinet/in.h> |
27 |
+ #include <stdio.h> |
28 |
++#include <time.h> |
29 |
+ |
30 |
+ #include <isns-proto.h> |
31 |
+ #include "types.h" |
32 |
+--- ./utils/fwparam_ibft/fwparam_ppc.c.orig |
33 |
++++ ./utils/fwparam_ibft/fwparam_ppc.c |
34 |
+@@ -356,7 +356,7 @@ |
35 |
+ * Sort the nics into "natural" order. The proc fs |
36 |
+ * device-tree has them in somewhat random, or reversed order. |
37 |
+ */ |
38 |
+- qsort(niclist, nic_count, sizeof(char *), (__compar_fn_t)nic_cmp); |
39 |
++ qsort(niclist, nic_count, sizeof(char *), (int (*)(const void *, const void *))nic_cmp); |
40 |
+ |
41 |
+ snprintf(prefix, sizeof(prefix), "%s/%s", devtree, "aliases"); |
42 |
+ dev_count = 0; |
43 |
+--- ./usr/idbm.c.orig |
44 |
++++ ./usr/idbm.c |
45 |
+@@ -25,6 +25,7 @@ |
46 |
+ #include <stdlib.h> |
47 |
+ #include <string.h> |
48 |
+ #include <errno.h> |
49 |
++#include <fcntl.h> |
50 |
+ #include <dirent.h> |
51 |
+ #include <limits.h> |
52 |
+ #include <sys/stat.h> |
53 |
+--- ./usr/iscsiadm.c.orig 2012-05-21 02:59:24.000000000 +0200 |
54 |
++++ ./usr/iscsiadm.c 2016-07-20 22:00:54.430451701 +0200 |
55 |
+@@ -2403,6 +2403,7 @@ main(int argc, char **argv) |
56 |
+ int tpgt = PORTAL_GROUP_TAG_UNKNOWN, killiscsid=-1, do_show=0; |
57 |
+ int packet_size=32, ping_count=1, ping_interval=0; |
58 |
+ int do_discover = 0, sub_mode = -1; |
59 |
++ int argerror = 0; |
60 |
+ struct sigaction sa_old; |
61 |
+ struct sigaction sa_new; |
62 |
+ struct list_head ifaces; |
63 |
+@@ -2553,7 +2554,11 @@ main(int argc, char **argv) |
64 |
+ return 0; |
65 |
+ case 'h': |
66 |
+ usage(0); |
67 |
+- } |
68 |
++ |
69 |
++ case '?': |
70 |
++ log_error("unrecognized character '%c'", optopt); |
71 |
++ argerror = 1; |
72 |
++ } |
73 |
+ |
74 |
+ if (name && value) { |
75 |
+ param = idbm_alloc_user_param(name, value); |
76 |
+@@ -2568,8 +2573,7 @@ main(int argc, char **argv) |
77 |
+ } |
78 |
+ } |
79 |
+ |
80 |
+- if (optopt) { |
81 |
+- log_error("unrecognized character '%c'", optopt); |
82 |
++ if (argerror) { |
83 |
+ rc = ISCSI_ERR_INVAL; |
84 |
+ goto free_ifaces; |
85 |
+ |
86 |
|
87 |
diff --git a/sys-block/open-iscsi/open-iscsi-2.0.873-r3.ebuild b/sys-block/open-iscsi/open-iscsi-2.0.873-r3.ebuild |
88 |
new file mode 100644 |
89 |
index 00000000..9581963 |
90 |
--- /dev/null |
91 |
+++ b/sys-block/open-iscsi/open-iscsi-2.0.873-r3.ebuild |
92 |
@@ -0,0 +1,115 @@ |
93 |
+# Copyright 1999-2017 Gentoo Foundation |
94 |
+# Distributed under the terms of the GNU General Public License v2 |
95 |
+# $Id$ |
96 |
+ |
97 |
+EAPI=5 |
98 |
+ |
99 |
+inherit versionator linux-info eutils flag-o-matic toolchain-funcs udev |
100 |
+ |
101 |
+MY_P="${PN}-$(replace_version_separator 2 "-")" |
102 |
+ |
103 |
+DESCRIPTION="Open-iSCSI is a high performance, transport independent, multi-platform implementation of RFC3720" |
104 |
+HOMEPAGE="http://www.open-iscsi.org/" |
105 |
+SRC_URI="http://www.open-iscsi.org/bits/${MY_P}.tar.gz" |
106 |
+ |
107 |
+LICENSE="GPL-2" |
108 |
+SLOT="0" |
109 |
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" |
110 |
+IUSE="debug slp +tcp infiniband rdma" |
111 |
+ |
112 |
+DEPEND="slp? ( net-libs/openslp ) infiniband? ( sys-fabric/ofed )" |
113 |
+RDEPEND="${DEPEND} |
114 |
+ sys-fs/lsscsi |
115 |
+ sys-apps/util-linux" |
116 |
+REQUIRED_USE="infiniband? ( rdma ) || ( rdma tcp )" |
117 |
+S="${WORKDIR}/${MY_P}" |
118 |
+ |
119 |
+pkg_setup() { |
120 |
+ linux-info_pkg_setup |
121 |
+ |
122 |
+ if kernel_is -lt 2 6 16; then |
123 |
+ die "Sorry, your kernel must be 2.6.16-rc5 or newer!" |
124 |
+ fi |
125 |
+ |
126 |
+ # Needs to be done, as iscsid currently only starts, when having the iSCSI |
127 |
+ # support loaded as module. Kernel builtin options don't work. See this for |
128 |
+ # more information: |
129 |
+ # https://groups.google.com/group/open-iscsi/browse_thread/thread/cc10498655b40507/fd6a4ba0c8e91966 |
130 |
+ # If there's a new release, check whether this is still valid! |
131 |
+ TCP_MODULES="SCSI_ISCSI_ATTRS ISCSI_TCP" |
132 |
+ RDMA_MODULES="INFINIBAND_ISER" |
133 |
+ INFINIBAND_MODULES="INFINIBAND_IPOIB INIBAND_USER_MAD INFINIBAND_USER_ACCESS" |
134 |
+ CONFIG_CHECK_MODULES="tcp? ( ${TCP_MODULES} ) rdma? ( ${RDMA_MODULES} ) infiniband? ( ${INFINIBAND_MODULES} )" |
135 |
+ if linux_config_exists; then |
136 |
+ if use tcp; then |
137 |
+ for module in ${TCP_MODULES}; do |
138 |
+ linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)" |
139 |
+ done |
140 |
+ fi |
141 |
+ if use infiniband; then |
142 |
+ for module in ${INFINIBAND_MODULES}; do |
143 |
+ linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)" |
144 |
+ done |
145 |
+ fi |
146 |
+ if use rdma; then |
147 |
+ for module in ${RDMA_MODULES}; do |
148 |
+ linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)"$ |
149 |
+ done |
150 |
+ fi |
151 |
+ fi |
152 |
+} |
153 |
+ |
154 |
+src_prepare() { |
155 |
+ epatch "${FILESDIR}"/${P}-Makefiles.patch |
156 |
+ epatch "${FILESDIR}"/${P}-memset.patch |
157 |
+ epatch "${FILESDIR}"/musl-fixes.patch |
158 |
+ |
159 |
+ epatch_user |
160 |
+ |
161 |
+ sed -i -e 's:^\(iscsid.startup\)\s*=.*:\1 = /usr/sbin/iscsid:' etc/iscsid.conf || die |
162 |
+} |
163 |
+ |
164 |
+src_configure() { |
165 |
+ use debug && append-cppflags -DDEBUG_TCP -DDEBUG_SCSI |
166 |
+ append-lfs-flags |
167 |
+ |
168 |
+ cd utils/open-isns || die |
169 |
+ |
170 |
+ # SSL (--with-security) is broken |
171 |
+ econf $(use_with slp) \ |
172 |
+ --without-security |
173 |
+} |
174 |
+ |
175 |
+src_compile() { |
176 |
+ # Stuffing CPPFLAGS into CFLAGS isn't entirely correct, but the build |
177 |
+ # is messed up already here, so it's not making it that much worse. |
178 |
+ KSRC="${KV_DIR}" CFLAGS="" \ |
179 |
+ emake \ |
180 |
+ OPTFLAGS="${CFLAGS} ${CPPFLAGS}" \ |
181 |
+ AR="$(tc-getAR)" CC="$(tc-getCC)" \ |
182 |
+ user |
183 |
+} |
184 |
+ |
185 |
+src_install() { |
186 |
+ emake DESTDIR="${ED}" sbindir="/usr/sbin" install |
187 |
+ |
188 |
+ dodoc README THANKS |
189 |
+ |
190 |
+ docinto test/ |
191 |
+ dodoc test/* |
192 |
+ |
193 |
+ insinto /etc/iscsi |
194 |
+ newins "${FILESDIR}"/initiatorname.iscsi initiatorname.iscsi.example |
195 |
+ |
196 |
+ # udev pieces |
197 |
+ udev_dorules "${FILESDIR}"/99-iscsi.rules |
198 |
+ exeinto /etc/udev/scripts |
199 |
+ doexe "${FILESDIR}"/iscsidev.sh |
200 |
+ |
201 |
+ newconfd "${FILESDIR}"/iscsid-conf.d iscsid |
202 |
+ newinitd "${FILESDIR}"/iscsid-init.d iscsid |
203 |
+ |
204 |
+ keepdir /var/db/iscsi |
205 |
+ fperms 700 /var/db/iscsi |
206 |
+ fperms 600 /etc/iscsi/iscsid.conf |
207 |
+} |