sys-block/open-iscsi: Sync with Gentoo upstream

Gentoo ref: 34d68f5bbe

Signed-off-by: Sayan Chowdhury <sayan@kinvolk.io>
This commit is contained in:
Sayan Chowdhury 2021-03-23 13:15:37 +05:30
parent 4fe9f58926
commit d9ff0c33ee
4 changed files with 65 additions and 37 deletions

View File

@ -1,5 +1,4 @@
DIST open-iscsi-2.0-873.tar.gz 667069 BLAKE2B edb427f8483c31499cdde644bbf8d658952952fa8d52a232537e7e6ec71d2d237dcd4e8759de21b65cac757678c7d71c22bd2fe71ed1e7ac152ae8396f080061 SHA512 4e67116cb7dd49381c9279645e5a661f05596ae6be3b832772089828b3764ca2d04b5dea1bcc337071efb52c3c75a6fb943136c659ee59500f3a198ed0dcea6b DIST open-iscsi-2.0-873.tar.gz 667069 BLAKE2B edb427f8483c31499cdde644bbf8d658952952fa8d52a232537e7e6ec71d2d237dcd4e8759de21b65cac757678c7d71c22bd2fe71ed1e7ac152ae8396f080061 SHA512 4e67116cb7dd49381c9279645e5a661f05596ae6be3b832772089828b3764ca2d04b5dea1bcc337071efb52c3c75a6fb943136c659ee59500f3a198ed0dcea6b
DIST open-iscsi-2.0.875.tar.gz 635121 BLAKE2B 34a7083087c53ed0e59d293d26efe166b09c5ea18b6022869cc9ff3d2edb2fb8b69e2c1ce6c9011bd20fc590b02dafd6d7c13d8bfa1eae6408c4bace13992e5e SHA512 1709011d7d12d3dd9278a0d775af064d5f7da37357f35d6d5c5b3aa8ec16385c28b201b1261f4581dbbbbca3d815015ed8696e1694aa19f3231132f90d1e5b36 DIST open-iscsi-2.0.875.tar.gz 635121 BLAKE2B 34a7083087c53ed0e59d293d26efe166b09c5ea18b6022869cc9ff3d2edb2fb8b69e2c1ce6c9011bd20fc590b02dafd6d7c13d8bfa1eae6408c4bace13992e5e SHA512 1709011d7d12d3dd9278a0d775af064d5f7da37357f35d6d5c5b3aa8ec16385c28b201b1261f4581dbbbbca3d815015ed8696e1694aa19f3231132f90d1e5b36
DIST open-iscsi-2.1.1.tar.gz 616859 BLAKE2B 7004b0866e55837f06cfe9e45f49f6a482932fda8a2c21c55819d658fb96113f1913290d490f28baccea86ceb755c63b73bd010b201f974c9803d39fbf5d0672 SHA512 88dbea433fe5266714c5c73ce4b60dfb8ddeffcaad4ff77abbdda2a865d29d4307ca51b8f45376f54542b19baed30d5f2f1836a8c136eb0af840f489f47e4fb3
DIST open-iscsi-2.1.2.tar.gz 617407 BLAKE2B 13a8c70d8a4618262c746cce3f2c66c04b577b35918d993c29fff041d292ef9e60b4d39c6d6a308d306b8303d08e7aac81b9927157361eaf47e694e9ae1e365a SHA512 a0b1fc4aa2acadbf3a69fa636a47fec527fff75748fccfa83c9540f3ac05c71835a406503b15480ed25fe4fb780e58e0dd21760cccc7f7ef07128d1aef8ee2e3
DIST open-iscsi-2.1.3.tar.gz 619746 BLAKE2B 884e24ae6e16578f3cbd8ccea2557e820d4bf4d20c7f88890100ca93f48df88dc7284cc4eca19d93187516fd21a2c5b71eb53f0d8fe395d2ce42fd202dc355d6 SHA512 0de417dc45b765458c5a1f09029b5df9b5c18d45d7a8fb6b38d539b7013f512a3c8731d5046f554611eccc77b93fea0df30fe4932d79cea44776ac944c398a52 DIST open-iscsi-2.1.3.tar.gz 619746 BLAKE2B 884e24ae6e16578f3cbd8ccea2557e820d4bf4d20c7f88890100ca93f48df88dc7284cc4eca19d93187516fd21a2c5b71eb53f0d8fe395d2ce42fd202dc355d6 SHA512 0de417dc45b765458c5a1f09029b5df9b5c18d45d7a8fb6b38d539b7013f512a3c8731d5046f554611eccc77b93fea0df30fe4932d79cea44776ac944c398a52
DIST open-iscsi-2.1.4.tar.gz 621247 BLAKE2B 043a999b2f397a6c740d61654079d7ab966caee6cf6cfb244ddd70eae4f5201045b371ce5fbe244216a2a210a5379c92e8c3fbe62d33707cf05e7a4a20a13a91 SHA512 ae0663a964d86e6a4c19203598b859173c93ecce550f9bc9855ff735dd51a3c45822f2bc1cc99e6891c56ef1d16c42223803f07a961558fe6e38ead2164faef3

View File

@ -1,4 +1,4 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata> <pkgmetadata>
<maintainer type="project"> <maintainer type="project">

View File

@ -1,4 +1,4 @@
# Copyright 1999-2020 Gentoo Authors # Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
EAPI=7 EAPI=7
@ -11,7 +11,7 @@ SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-2" LICENSE="GPL-2"
SLOT="0/0.2" SLOT="0/0.2"
KEYWORDS="~alpha amd64 arm arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
IUSE="debug infiniband libressl +tcp rdma systemd" IUSE="debug infiniband libressl +tcp rdma systemd"
DEPEND=" DEPEND="
@ -37,9 +37,8 @@ PATCHES=(
pkg_setup() { pkg_setup() {
linux-info_pkg_setup linux-info_pkg_setup
# Flatcar: use ewarn instead of die
if kernel_is -lt 2 6 16; then if kernel_is -lt 2 6 16; then
ewarn "Sorry, your kernel must be 2.6.16-rc5 or newer!" die "Sorry, your kernel must be 2.6.16-rc5 or newer!"
fi fi
# Needs to be done, as iscsid currently only starts, when having the iSCSI # Needs to be done, as iscsid currently only starts, when having the iSCSI
@ -47,19 +46,34 @@ pkg_setup() {
# more information: # more information:
# https://groups.google.com/group/open-iscsi/browse_thread/thread/cc10498655b40507/fd6a4ba0c8e91966 # https://groups.google.com/group/open-iscsi/browse_thread/thread/cc10498655b40507/fd6a4ba0c8e91966
# If there's a new release, check whether this is still valid! # If there's a new release, check whether this is still valid!
CONFIG_MODULES="SCSI_ISCSI_ATTRS ISCSI_TCP" TCP_MODULES="SCSI_ISCSI_ATTRS ISCSI_TCP"
RDMA_MODULES="INFINIBAND_ISER"
INFINIBAND_MODULES="INFINIBAND_IPOIB INIBAND_USER_MAD INFINIBAND_USER_ACCESS"
CONFIG_CHECK_MODULES="tcp? ( ${TCP_MODULES} ) rdma? ( ${RDMA_MODULES} ) infiniband? ( ${INFINIBAND_MODULES} )"
if linux_config_exists; then if linux_config_exists; then
for module in ${CONFIG_CHECK_MODULES}; do if use tcp; then
for module in ${TCP_MODULES}; do
linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)" linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)"
done done
fi fi
if use infiniband; then
for module in ${INFINIBAND_MODULES}; do
linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)"
done
fi
if use rdma; then
for module in ${RDMA_MODULES}; do
linux_chkconfig_module ${module} || ewarn "${module} needs to be built as module (builtin doesn't work)"$
done
fi
fi
} }
src_prepare() { src_prepare() {
sed -e 's:^\(iscsid.startup\)\s*=.*:\1 = /usr/sbin/iscsid:' \ sed -e 's:^\(iscsid.startup\)\s*=.*:\1 = /usr/sbin/iscsid:' \
-i etc/iscsid.conf || die -i etc/iscsid.conf || die
sed -e 's:^node.startup = manual:node.startup = automatic:' \ sed -e '/[^usr]\/sbin/s@\(/sbin/\)@/usr\1@' \
-i etc/iscsid.conf || die -i etc/systemd/iscsi* || die
default default
pushd iscsiuio >/dev/null || die pushd iscsiuio >/dev/null || die
@ -73,9 +87,9 @@ src_configure() {
} }
src_compile() { src_compile() {
use debug && append-flags -DDEBUG_TCP -DDEBUG_SCSI # Stuffing CPPFLAGS into CFLAGS isn't entirely correct, but the build
# is messed up already here, so it's not making it that much worse.
CFLAGS="" \ KSRC="${KV_DIR}" CFLAGS="" \
emake \ emake \
OPTFLAGS="${CFLAGS} ${CPPFLAGS} $(usex systemd '' -DNO_SYSTEMD)" \ OPTFLAGS="${CFLAGS} ${CPPFLAGS} $(usex systemd '' -DNO_SYSTEMD)" \
AR="$(tc-getAR)" CC="$(tc-getCC)" \ AR="$(tc-getAR)" CC="$(tc-getCC)" \
@ -84,28 +98,43 @@ src_compile() {
} }
src_install() { src_install() {
emake DESTDIR="${D}" sbindir="/usr/sbin" install emake DESTDIR="${ED}" sbindir="/usr/sbin" install
# Upstream make is not deterministic, per bug #601514 # Upstream make is not deterministic, per bug #601514
rm -f "${D}"/etc/initiatorname.iscsi rm -f "${ED}"/etc/initiatorname.iscsi
dodoc README THANKS dodoc README THANKS
docinto test/ docinto test/
dodoc $(find test -maxdepth 1 -type f ! -name ".*") dodoc $(find test -maxdepth 1 -type f ! -name ".*")
insinto /etc/iscsi
newins "${FILESDIR}"/initiatorname.iscsi initiatorname.iscsi.example
newconfd "${FILESDIR}"/iscsid-conf.d iscsid
newinitd "${FILESDIR}"/iscsid-init.d iscsid
local unit local unit
local units=( local units=(
iscsi.service iscsi{,-init}.service
iscsid.{service,socket} iscsid.{service,socket}
iscsiuio.{service,socket} iscsiuio.{service,socket}
) )
for unit in ${units[@]} ; do for unit in ${units[@]} ; do
systemd_dounit etc/systemd/${unit} systemd_dounit etc/systemd/${unit}
done done
systemd_dounit "${FILESDIR}"/iscsi-init.service
systemd_dotmpfilesd "${FILESDIR}"/open-iscsi.conf
keepdir /var/db/iscsi
fperms 700 /var/db/iscsi
fperms 600 /etc/iscsi/iscsid.conf fperms 600 /etc/iscsi/iscsid.conf
rm "${D}"/etc/iscsi/initiatorname.iscsi }
mv "${D}"/etc/iscsi "${D}"/usr/share/iscsi
pkg_postinst() {
in='/etc/iscsi/initiatorname.iscsi'
if [[ ! -f "${EROOT}${in}" ]] && [[ -f "${EROOT}${in}.example" ]] ; then
{
cat "${EROOT}${in}.example"
echo "# InitiatorName generated by ${CATEGORY}/${PF} at $(date -uR)"
echo "InitiatorName=$(${ROOT}/usr/sbin/iscsi-iname)"
} >> "${EROOT}${in}.tmp" && mv -f "${EROOT}${in}.tmp" "${EROOT}${in}"
fi
} }