From 5b9f67f79efdb1f7a8fee172d485fb894bcced9f Mon Sep 17 00:00:00 2001 From: Robert Eckelmann Date: Wed, 1 Jul 2026 22:15:22 +0900 Subject: [PATCH] extra-repos/systemd: open-iscsi, open-isns new aports Signed-off-by: Robert Eckelmann [ci:skip-vercheck] Part-of: --- ...-make-shell-scripts-POSIX-compatible.patch | 181 ++++++++++ extra-repos/systemd/open-iscsi/APKBUILD | 55 +++ .../open-iscsi/add-missing-headers.patch | 62 ++++ .../systemd/open-iscsi/dont-use-lib64.patch | 15 + extra-repos/systemd/open-iscsi/iscsid.conf | 339 ++++++++++++++++++ .../systemd/open-iscsi/musl-fixes.patch | 33 ++ .../open-iscsi/open-iscsi.post-install | 10 + .../systemd/open-iscsi/remove-werror.patch | 13 + extra-repos/systemd/open-isns/APKBUILD | 38 ++ 9 files changed, 746 insertions(+) create mode 100644 extra-repos/systemd/open-iscsi/0001-make-shell-scripts-POSIX-compatible.patch create mode 100644 extra-repos/systemd/open-iscsi/APKBUILD create mode 100644 extra-repos/systemd/open-iscsi/add-missing-headers.patch create mode 100644 extra-repos/systemd/open-iscsi/dont-use-lib64.patch create mode 100644 extra-repos/systemd/open-iscsi/iscsid.conf create mode 100644 extra-repos/systemd/open-iscsi/musl-fixes.patch create mode 100644 extra-repos/systemd/open-iscsi/open-iscsi.post-install create mode 100644 extra-repos/systemd/open-iscsi/remove-werror.patch create mode 100644 extra-repos/systemd/open-isns/APKBUILD diff --git a/extra-repos/systemd/open-iscsi/0001-make-shell-scripts-POSIX-compatible.patch b/extra-repos/systemd/open-iscsi/0001-make-shell-scripts-POSIX-compatible.patch new file mode 100644 index 000000000..f1f7ee1c6 --- /dev/null +++ b/extra-repos/systemd/open-iscsi/0001-make-shell-scripts-POSIX-compatible.patch @@ -0,0 +1,181 @@ +From ff6e62ab9a4ca256525bff4126c3481be3ed8a86 Mon Sep 17 00:00:00 2001 +From: Leonardo Arena +Date: Mon, 14 Oct 2024 05:54:55 +0000 +Subject: [PATCH] make shell scripts POSIX compatible + +--- + iscsiuio/src/unix/build_date.sh | 32 +++++++++++------------ + utils/iscsi-gen-initiatorname.sh.template | 24 +++++++++-------- + utils/iscsi_discovery.sh | 4 +-- + utils/iscsi_fw_login.sh.template | 2 +- + utils/iscsi_offload.sh | 4 +-- + 5 files changed, 33 insertions(+), 33 deletions(-) + +diff --git a/iscsiuio/src/unix/build_date.sh b/iscsiuio/src/unix/build_date.sh +index 65888fe..f6252e7 100755 +--- a/iscsiuio/src/unix/build_date.sh ++++ b/iscsiuio/src/unix/build_date.sh +@@ -1,9 +1,4 @@ +-#!/bin/bash +-# +-# build the build_date.c and build_date.h files +-# +-# (bash required for getopts) +-# ++#!/bin/sh + + THIS_CMD=${0##*/} + +@@ -20,17 +15,20 @@ usage() + generate_source_file() + { + outfile="$1" +- if [ -n "$SOURCE_DATE_EPOCH" ] ; then +- echo 'char *build_date = "'`LC_ALL=C.UTF-8 date --date=@$SOURCE_DATE_EPOCH -u`'";' >"$outfile" ++ if [ -n "$SOURCE_DATE_EPOCH" ]; then ++ # Convert epoch to human-readable date; assume GNU date or fallback to awk. ++ build_date=$(date -u -d "@$SOURCE_DATE_EPOCH" 2>/dev/null || \ ++ awk -v epoch="$SOURCE_DATE_EPOCH" 'BEGIN { print strftime("%Y-%m-%d %H:%M:%S", epoch) }') ++ echo "char *build_date = \"$build_date\";" > "$outfile" + else +- echo 'char *build_date = "'`date`'";' >"$outfile" ++ echo "char *build_date = \"$(date)\";" > "$outfile" + fi + } + + generate_include_file() + { + outfile="$1" +- echo 'extern char *build_date;' >"$outfile" ++ echo 'extern char *build_date;' > "$outfile" + } + + do_source= +@@ -38,17 +36,17 @@ do_include= + + while getopts :c:i:S:h opt; do + case "$opt" in +- c) do_source="$OPTARG" ;; +- i) do_include="$OPTARG" ;; +- S) SOURCE_DATE_EPOCH="$OPTARG" ;; +- h) usage; exit 0 ;; +- ?) echo "unknown option" 1>&2; usage; exit 1 ;; ++ c) do_source="$OPTARG" ;; ++ i) do_include="$OPTARG" ;; ++ S) SOURCE_DATE_EPOCH="$OPTARG" ;; ++ h) usage; exit 0 ;; ++ ?) echo "unknown option" 1>&2; usage; exit 1 ;; + esac + done + + if [ -n "$do_source" ]; then +- generate_source_file $do_source ++ generate_source_file "$do_source" + fi + if [ -n "$do_include" ]; then +- generate_include_file $do_include ++ generate_include_file "$do_include" + fi +diff --git a/utils/iscsi-gen-initiatorname.sh.template b/utils/iscsi-gen-initiatorname.sh.template +index 5c2bfdf..474c0af 100644 +--- a/utils/iscsi-gen-initiatorname.sh.template ++++ b/utils/iscsi-gen-initiatorname.sh.template +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + # + # iscsi-gen-initiatorname + # +@@ -16,7 +16,7 @@ INAME_DIR="@HOMEDIR@" + INAME_FILE="$INAME_DIR/initiatorname.iscsi" + + # our default IQN prefix +-DEFAULT_IQN_PREFIX="iqn.1996-04.de.suse:01" ++DEFAULT_IQN_PREFIX="iqn.1996-04.org.alpinelinux:01" + + # + # set up comments for initiatorname files using variables +@@ -86,15 +86,17 @@ usage_and_exit() + # + # usage: INAME=$(kernel_supplied_initiatorname) + # +-kernel_supplied_initiatorname() +-{ +- kcl="$( /dev/null 2>&1 ; then + ioe_mac=$(iscsiadm -m iface -I $ioe_iface 2> /dev/null| sed -n "s/iface\.hwaddress = \(.*\)/\1/p") + ioe_mod=$(iscsiadm -m iface -I $ioe_iface 2> /dev/null| sed -n "s/iface\.transport_name = \(.*\)/\1/p") + ipaddr=$(iscsiadm -m iface -I $ioe_iface 2> /dev/null| sed -n "s/iface\.ipaddress = \(.*\)/\1/p") +- if [ "$ipaddr" == "" ] ; then ++ if [ "$ipaddr" = "" ] ; then + ipaddr= + fi + elif [ "$mod" = "be2iscsi" ] ; then +-- +2.46.2 + diff --git a/extra-repos/systemd/open-iscsi/APKBUILD b/extra-repos/systemd/open-iscsi/APKBUILD new file mode 100644 index 000000000..480f1bc2e --- /dev/null +++ b/extra-repos/systemd/open-iscsi/APKBUILD @@ -0,0 +1,55 @@ +# Forked from Alpine for providing a version with systemd +maintainer="Robert Eckelmann " +pkgname=open-iscsi +_pkgver=2.1.10 +pkgver=9999$_pkgver +pkgrel=4 +pkgdesc="High performance, transport independent, multi-platform iSCSI initiator" +url="https://www.open-iscsi.com" +arch="all" +license="GPL-2.0-only" +makedepends="cmake kmod-dev libmount linux-headers openssl-dev>3 + open-isns-dev util-linux-dev meson bash perl systemd-dev" +depends="systemd-libs" +options="!check" +subpackages="$pkgname-dev $pkgname-libs $pkgname-doc $pkgname-systemd $pkgname-udev" +install="$pkgname.post-install" +source="$pkgname-$_pkgver.tar.gz::https://github.com/open-iscsi/open-iscsi/archive/$_pkgver.tar.gz + iscsid.conf + musl-fixes.patch + add-missing-headers.patch + dont-use-lib64.patch + remove-werror.patch + 0001-make-shell-scripts-POSIX-compatible.patch + " +builddir="$srcdir/open-iscsi-$_pkgver" + +build() { + # musl doesn't have glob_onlydir but by spec it's also not guaranteed to return only dirs anyway + CFLAGS="$CFLAGS -DGLOB_ONLYDIR=0" \ + abuild-meson \ + -Db_lto=true \ + -Drulesdir="/usr/lib/udev/rules.d" \ + . output + meson compile -C output +} + +check() { + meson test --print-errorlogs -C output +} + +package() { + DESTDIR="$pkgdir" meson install --no-rebuild -C output + install -Dm644 "$srcdir"/iscsid.conf "$pkgdir"/etc/iscsi/iscsid.conf + rm "$pkgdir"/etc/iscsi/initiatorname.iscsi +} + +sha512sums=" +18b92d3e9a85d8de66734d95e9ca74a8acc5167a98830134c18ad5e226b29a00d358f952edfab67b643c454ec63c0a382c7ab7e7e76970f7574b46cea0d5c82d open-iscsi-2.1.10.tar.gz +4cc7c1923047616d908806aab96d468cb7b99ff9f8a9e02a039866b66db4ae856bd9f414854712d8a57c21614674f4468736bce26a4199c2ff054a165bca26e0 iscsid.conf +1b89ffd6de0dc7bb63fc2702a97e49df4369158c66ee609acfc041b1677c07fbd964b7a709f1f324fa51a9842d4d3e11611d9783e18d526372d468163c0ac8db musl-fixes.patch +104b559eb368459a7151657fbca63927b6b1032bda272e903a1633c8b9d3ed199f2c5cca0e6741bcd5fa6e860d1ff2d111caf58d60d9f0a736ad767e8ae0427b add-missing-headers.patch +86a9c4be4abd34821f156f9df586c530dc2b0efc96e961cb15fd22846856cc1e76aae85806e8d0eb9f3d3e3acd7f73fe8d2a1de8944903b503e256e6a99bb2dd dont-use-lib64.patch +d99ef789d1aab1e7ba81e3f2b334a9518f1174cd53b4600bfd7e866973cdfa87664b2161c994ae7c35526a7d9165e0e2b3036f7dacc139b90fa3d0a90b6f6599 remove-werror.patch +e0cdca47e4dd4ca6684ab7ccae49a06253a7bc3de722a8239f692ee84431d8a63d4411f8584976d13f2907911551bf0d5871a315bd4d9f72e61b9654b34cb29b 0001-make-shell-scripts-POSIX-compatible.patch +" diff --git a/extra-repos/systemd/open-iscsi/add-missing-headers.patch b/extra-repos/systemd/open-iscsi/add-missing-headers.patch new file mode 100644 index 000000000..589522488 --- /dev/null +++ b/extra-repos/systemd/open-iscsi/add-missing-headers.patch @@ -0,0 +1,62 @@ +diff --git a/iscsiuio/src/unix/libs/bnx2x.c b/iscsiuio/src/unix/libs/bnx2x.c +index c5e7b71..94d2663 100644 +--- a/iscsiuio/src/unix/libs/bnx2x.c ++++ b/iscsiuio/src/unix/libs/bnx2x.c +@@ -1,3 +1,4 @@ ++#include + /* + * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation +diff --git a/usr/idbm.c b/usr/idbm.c +index a0207e2..f347332 100644 +--- a/usr/idbm.c ++++ b/usr/idbm.c +@@ -1,3 +1,4 @@ ++#include + /* + * iSCSI Discovery Database Library + * +diff --git a/usr/iscsi_net_util.c b/usr/iscsi_net_util.c +index 6339082..2a75e62 100644 +--- a/usr/iscsi_net_util.c ++++ b/usr/iscsi_net_util.c +@@ -31,7 +31,7 @@ + #include + #include + #include +-#include ++#include + + #include "sysdeps.h" + #include "ethtool-copy.h" +--- a/iscsiuio/src/unix/libs/bnx2x.c ++++ b/iscsiuio/src/unix/libs/bnx2x.c +@@ -47,6 +47,7 @@ + #include + #include + #include ++#include + #include + #include + #include +--- a/iscsiuio/src/unix/libs/bnx2.c ++++ b/iscsiuio/src/unix/libs/bnx2.c +@@ -42,6 +42,7 @@ + #include + #include + #include ++#include + #include + #include + #include +--- a/iscsiuio/src/unix/libs/qedi.c.orig ++++ b/iscsiuio/src/unix/libs/qedi.c +@@ -46,6 +46,7 @@ + #include + #include + #include ++#include + #include + #include + #include + diff --git a/extra-repos/systemd/open-iscsi/dont-use-lib64.patch b/extra-repos/systemd/open-iscsi/dont-use-lib64.patch new file mode 100644 index 000000000..e1f60edde --- /dev/null +++ b/extra-repos/systemd/open-iscsi/dont-use-lib64.patch @@ -0,0 +1,15 @@ +diff --git a/libopeniscsiusr/Makefile b/libopeniscsiusr/Makefile +index bf7c96c..eb9da59 100644 +--- a/libopeniscsiusr/Makefile ++++ b/libopeniscsiusr/Makefile +@@ -13,8 +13,8 @@ prefix ?= /usr + INSTALL ?= install + + ifndef LIB_DIR +- ifeq ($(shell test -d /lib64 && echo 1),1) +- LIB_DIR=$(prefix)/lib64 ++ ifeq ($(shell test -d /lib && echo 1),1) ++ LIB_DIR=$(prefix)/lib + else + LIB_DIR=$(prefix)/lib + endif diff --git a/extra-repos/systemd/open-iscsi/iscsid.conf b/extra-repos/systemd/open-iscsi/iscsid.conf new file mode 100644 index 000000000..78e1b9425 --- /dev/null +++ b/extra-repos/systemd/open-iscsi/iscsid.conf @@ -0,0 +1,339 @@ +# +# Open-iSCSI default configuration. +# Could be located at /etc/iscsi/iscsid.conf or ~/.iscsid.conf +# +# Note: To set any of these values for a specific node/session run +# the iscsiadm --mode node --op command for the value. See the README +# and man page for iscsiadm for details on the --op command. +# + +###################### +# iscsid daemon config +###################### +# +# If you want iscsid to start the first time an iscsi tool +# needs to access it, instead of starting it when the init +# scripts run, set the iscsid startup command here. This +# should normally only need to be done by distro package +# maintainers. If you leave the iscsid daemon running all +# the time then leave this attribute commented out. +# + +# Alpine startup + iscsid.startup = /etc/init.d/iscsid start +# +# Default for Fedora and RHEL. (uncomment to activate). +# iscsid.startup = /bin/systemctl start iscsid.socket iscsiuio.socket +# +# Default if you are not using systemd (uncomment to activate) +# iscsid.startup = /usr/bin/service start iscsid + +# Check for active mounts on devices reachable through a session +# and refuse to logout if there are any. Defaults to "No". +# iscsid.safe_logout = Yes + +############################# +# NIC/HBA and driver settings +############################# +# open-iscsi can create a session and bind it to a NIC/HBA. +# To set this up see the example iface config file. + +#***************** +# Startup settings +#***************** + +# To request that the iscsi initd scripts startup a session set to "automatic". +# node.startup = automatic +# +# To manually startup the session set to "manual". The default is manual. +node.startup = manual + +# For "automatic" startup nodes, setting this to "Yes" will try logins on each +# available iface until one succeeds, and then stop. The default "No" will try +# logins on all available ifaces simultaneously. +node.leading_login = No + +# ************* +# CHAP Settings +# ************* + +# To enable CHAP authentication set node.session.auth.authmethod +# to CHAP. The default is None. +#node.session.auth.authmethod = CHAP + +# To configure which CHAP algorithms to enable set +# node.session.auth.chap_algs to a comma seperated list. +# The algorithms should be listen with most prefered first. +# Valid values are MD5, SHA1, SHA256, and SHA3-256. +# The default is MD5. +#node.session.auth.chap_algs = SHA3-256,SHA256,SHA1,MD5 + +# To set a CHAP username and password for initiator +# authentication by the target(s), uncomment the following lines: +#node.session.auth.username = username +#node.session.auth.password = password + +# To set a CHAP username and password for target(s) +# authentication by the initiator, uncomment the following lines: +#node.session.auth.username_in = username_in +#node.session.auth.password_in = password_in + +# To enable CHAP authentication for a discovery session to the target +# set discovery.sendtargets.auth.authmethod to CHAP. The default is None. +#discovery.sendtargets.auth.authmethod = CHAP + +# To set a discovery session CHAP username and password for the initiator +# authentication by the target(s), uncomment the following lines: +#discovery.sendtargets.auth.username = username +#discovery.sendtargets.auth.password = password + +# To set a discovery session CHAP username and password for target(s) +# authentication by the initiator, uncomment the following lines: +#discovery.sendtargets.auth.username_in = username_in +#discovery.sendtargets.auth.password_in = password_in + +# ******** +# Timeouts +# ******** +# +# See the iSCSI README's Advanced Configuration section for tips +# on setting timeouts when using multipath or doing root over iSCSI. +# +# To specify the length of time to wait for session re-establishment +# before failing SCSI commands back to the application when running +# the Linux SCSI Layer error handler, edit the line. +# The value is in seconds and the default is 120 seconds. +# Special values: +# - If the value is 0, IO will be failed immediately. +# - If the value is less than 0, IO will remain queued until the session +# is logged back in, or until the user runs the logout command. +node.session.timeo.replacement_timeout = 120 + +# To specify the time to wait for login to complete, edit the line. +# The value is in seconds and the default is 15 seconds. +node.conn[0].timeo.login_timeout = 15 + +# To specify the time to wait for logout to complete, edit the line. +# The value is in seconds and the default is 15 seconds. +node.conn[0].timeo.logout_timeout = 15 + +# Time interval to wait for on connection before sending a ping. +node.conn[0].timeo.noop_out_interval = 5 + +# To specify the time to wait for a Nop-out response before failing +# the connection, edit this line. Failing the connection will +# cause IO to be failed back to the SCSI layer. If using dm-multipath +# this will cause the IO to be failed to the multipath layer. +node.conn[0].timeo.noop_out_timeout = 5 + +# To specify the time to wait for abort response before +# failing the operation and trying a logical unit reset edit the line. +# The value is in seconds and the default is 15 seconds. +node.session.err_timeo.abort_timeout = 15 + +# To specify the time to wait for a logical unit response +# before failing the operation and trying session re-establishment +# edit the line. +# The value is in seconds and the default is 30 seconds. +node.session.err_timeo.lu_reset_timeout = 30 + +# To specify the time to wait for a target response +# before failing the operation and trying session re-establishment +# edit the line. +# The value is in seconds and the default is 30 seconds. +node.session.err_timeo.tgt_reset_timeout = 30 + + +#****** +# Retry +#****** + +# To specify the number of times iscsid should retry a login +# if the login attempt fails due to the node.conn[0].timeo.login_timeout +# expiring modify the following line. Note that if the login fails +# quickly (before node.conn[0].timeo.login_timeout fires) because the network +# layer or the target returns an error, iscsid may retry the login more than +# node.session.initial_login_retry_max times. +# +# This retry count along with node.conn[0].timeo.login_timeout +# determines the maximum amount of time iscsid will try to +# establish the initial login. node.session.initial_login_retry_max is +# multiplied by the node.conn[0].timeo.login_timeout to determine the +# maximum amount. +# +# The default node.session.initial_login_retry_max is 8 and +# node.conn[0].timeo.login_timeout is 15 so we have: +# +# node.conn[0].timeo.login_timeout * node.session.initial_login_retry_max = +# 120 seconds +# +# Valid values are any integer value. This only +# affects the initial login. Setting it to a high value can slow +# down the iscsi service startup. Setting it to a low value can +# cause a session to not get logged into, if there are distuptions +# during startup or if the network is not ready at that time. +node.session.initial_login_retry_max = 8 + +################################ +# session and device queue depth +################################ + +# To control how many commands the session will queue set +# node.session.cmds_max to an integer between 2 and 2048 that is also +# a power of 2. The default is 128. +node.session.cmds_max = 128 + +# To control the device's queue depth set node.session.queue_depth +# to a value between 1 and 1024. The default is 32. +node.session.queue_depth = 32 + +################################## +# MISC SYSTEM PERFORMANCE SETTINGS +################################## + +# For software iscsi (iscsi_tcp) and iser (ib_iser) each session +# has a thread used to transmit or queue data to the hardware. For +# cxgb3i you will get a thread per host. +# +# Setting the thread's priority to a lower value can lead to higher throughput +# and lower latencies. The lowest value is -20. Setting the priority to +# a higher value, can lead to reduced IO performance, but if you are seeing +# the iscsi or scsi threads dominate the use of the CPU then you may want +# to set this value higher. +# +# Note: For cxgb3i you must set all sessions to the same value, or the +# behavior is not defined. +# +# The default value is -20. The setting must be between -20 and 20. +node.session.xmit_thread_priority = -20 + + +#*************** +# iSCSI settings +#*************** + +# To enable R2T flow control (i.e., the initiator must wait for an R2T +# command before sending any data), uncomment the following line: +# +#node.session.iscsi.InitialR2T = Yes +# +# To disable R2T flow control (i.e., the initiator has an implied +# initial R2T of "FirstBurstLength" at offset 0), uncomment the following line: +# +# The defaults is No. +node.session.iscsi.InitialR2T = No + +# +# To disable immediate data (i.e., the initiator does not send +# unsolicited data with the iSCSI command PDU), uncomment the following line: +# +#node.session.iscsi.ImmediateData = No +# +# To enable immediate data (i.e., the initiator sends unsolicited data +# with the iSCSI command packet), uncomment the following line: +# +# The default is Yes +node.session.iscsi.ImmediateData = Yes + +# To specify the maximum number of unsolicited data bytes the initiator +# can send in an iSCSI PDU to a target, edit the following line. +# +# The value is the number of bytes in the range of 512 to (2^24-1) and +# the default is 262144 +node.session.iscsi.FirstBurstLength = 262144 + +# To specify the maximum SCSI payload that the initiator will negotiate +# with the target for, edit the following line. +# +# The value is the number of bytes in the range of 512 to (2^24-1) and +# the defauls it 16776192 +node.session.iscsi.MaxBurstLength = 16776192 + +# To specify the maximum number of data bytes the initiator can receive +# in an iSCSI PDU from a target, edit the following line. +# +# The value is the number of bytes in the range of 512 to (2^24-1) and +# the default is 262144 +node.conn[0].iscsi.MaxRecvDataSegmentLength = 262144 + +# To specify the maximum number of data bytes the initiator will send +# in an iSCSI PDU to the target, edit the following line. +# +# The value is the number of bytes in the range of 512 to (2^24-1). +# Zero is a special case. If set to zero, the initiator will use +# the target's MaxRecvDataSegmentLength for the MaxXmitDataSegmentLength. +# The default is 0. +node.conn[0].iscsi.MaxXmitDataSegmentLength = 0 + +# To specify the maximum number of data bytes the initiator can receive +# in an iSCSI PDU from a target during a discovery session, edit the +# following line. +# +# The value is the number of bytes in the range of 512 to (2^24-1) and +# the default is 32768 +# +discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768 + +# To allow the targets to control the setting of the digest checking, +# with the initiator requesting a preference of enabling the checking, uncomment# one or both of the following lines: +#node.conn[0].iscsi.HeaderDigest = CRC32C,None +#node.conn[0].iscsi.DataDigest = CRC32C,None +# +# To allow the targets to control the setting of the digest checking, +# with the initiator requesting a preference of disabling the checking, +# uncomment one or both of the following lines: +#node.conn[0].iscsi.HeaderDigest = None,CRC32C +#node.conn[0].iscsi.DataDigest = None,CRC32C +# +# To enable CRC32C digest checking for the header and/or data part of +# iSCSI PDUs, uncomment one or both of the following lines: +#node.conn[0].iscsi.HeaderDigest = CRC32C +#node.conn[0].iscsi.DataDigest = CRC32C +# +# To disable digest checking for the header and/or data part of +# iSCSI PDUs, uncomment one or both of the following lines: +#node.conn[0].iscsi.HeaderDigest = None +#node.conn[0].iscsi.DataDigest = None +# +# The default is to never use DataDigests or HeaderDigests. +# + +# For multipath configurations, you may want more than one session to be +# created on each iface record. If node.session.nr_sessions is greater +# than 1, performing a 'login' for that node will ensure that the +# appropriate number of sessions is created. +node.session.nr_sessions = 1 + +# When iscsid starts up it recovers existing sessions, if possible. +# If the target for a session has gone away when this occurs, the +# iscsid daemon normally tries to reestablish each session, +# in succession, in the background, by trying again every two +# seconds, until all sessions are restored. This configuration +# variable can limits the number of retries for each session. +# For example, setting reopen_max=150 would mean that each session +# recovery was limited to about five minutes. +# +node.session.reopen_max = 0 + +#************ +# Workarounds +#************ + +# Some targets like IET prefer after an initiator has sent a task +# management function like an ABORT TASK or LOGICAL UNIT RESET, that +# it does not respond to PDUs like R2Ts. To enable this behavior uncomment +# the following line (The default behavior is Yes): +node.session.iscsi.FastAbort = Yes + +# Some targets like Equalogic prefer that after an initiator has sent +# a task management function like an ABORT TASK or LOGICAL UNIT RESET, that +# it continue to respond to R2Ts. To enable this uncomment this line +# node.session.iscsi.FastAbort = No + +# To prevent doing automatic scans that would add unwanted luns to the system +# we can disable them and have sessions only do manually requested scans. +# Automatic scans are performed on startup, on login, and on AEN/AER reception +# on devices supporting it. For HW drivers all sessions will use the value +# defined in the configuration file. This configuration option is independent +# of scsi_mod scan parameter. (The default behavior is auto): +node.session.scan = auto diff --git a/extra-repos/systemd/open-iscsi/musl-fixes.patch b/extra-repos/systemd/open-iscsi/musl-fixes.patch new file mode 100644 index 000000000..d5176f80b --- /dev/null +++ b/extra-repos/systemd/open-iscsi/musl-fixes.patch @@ -0,0 +1,33 @@ +--- a/usr/iscsiadm.c 2016-09-29 20:33:24.000000000 +0200 ++++ b/usr/iscsiadm.c 2017-01-08 03:03:20.648496369 +0100 +@@ -3263,7 +3263,8 @@ + int packet_size=32, ping_count=1, ping_interval=0; + int do_discover = 0, sub_mode = -1; + int portal_type = -1; + int timeout = ISCSID_REQ_TIMEOUT; ++ int argerror = 0; + struct sigaction sa_old; + struct sigaction sa_new; + struct list_head ifaces; +@@ -3426,6 +3427,11 @@ + break; + case 'h': + usage(0); ++ break; ++ case '?': ++ log_error("unrecognized character '%c'", optopt); ++ argerror = 1; ++ break; + } + + if (name && value) { +@@ -3441,8 +3446,7 @@ + } + } + +- if (optopt) { +- log_error("unrecognized character '%c'", optopt); ++ if (argerror) { + rc = ISCSI_ERR_INVAL; + goto free_ifaces; + } diff --git a/extra-repos/systemd/open-iscsi/open-iscsi.post-install b/extra-repos/systemd/open-iscsi/open-iscsi.post-install new file mode 100644 index 000000000..0ac06aaad --- /dev/null +++ b/extra-repos/systemd/open-iscsi/open-iscsi.post-install @@ -0,0 +1,10 @@ +#!/bin/sh + +iscsi-gen-initiatorname &>/dev/null + +cat >&2 <<-EOF + * + * A default initiator name has been generated in + * /etc/iscsi/initiatorname.iscsi + * +EOF diff --git a/extra-repos/systemd/open-iscsi/remove-werror.patch b/extra-repos/systemd/open-iscsi/remove-werror.patch new file mode 100644 index 000000000..173a5403a --- /dev/null +++ b/extra-repos/systemd/open-iscsi/remove-werror.patch @@ -0,0 +1,13 @@ +diff --git a/libopeniscsiusr/Makefile b/libopeniscsiusr/Makefile +index 6757527..7715344 100644 +--- a/libopeniscsiusr/Makefile ++++ b/libopeniscsiusr/Makefile +@@ -44,7 +44,7 @@ EXTRA_MAN_FILES = libopeniscsiusr.h.3 + OBJS = context.o misc.o session.o sysfs.o iface.o idbm.o node.o default.o + + CFLAGS ?= -O2 -g +-CFLAGS += -Wall -Werror -Wextra -fvisibility=hidden -fPIC ++CFLAGS += -Wall -Wextra -fvisibility=hidden -fPIC + CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod) + + LDFLAGS += $(shell $(PKG_CONFIG) --libs libkmod) diff --git a/extra-repos/systemd/open-isns/APKBUILD b/extra-repos/systemd/open-isns/APKBUILD new file mode 100644 index 000000000..e2bfbab83 --- /dev/null +++ b/extra-repos/systemd/open-isns/APKBUILD @@ -0,0 +1,38 @@ +# Forked from Alpine for providing a version with systemd +maintainer="Robert Eckelmann " +pkgname=open-isns +_pkgver=0.102 +pkgver=9999$_pkgver +pkgrel=2 +pkgdesc="iSNS server and client for Linux" +url="https://github.com/open-iscsi/open-isns" +arch="all" +license="LGPL-2.1-or-later" +makedepends="meson openssl-dev>3 musl-dev" +options="!check" +subpackages="$pkgname-dev $pkgname-doc $pkgname-lib $pkgname-systemd" +source="$pkgname-$_pkgver.tar.gz::https://github.com/open-iscsi/open-isns/archive/v$_pkgver.tar.gz + " +builddir="$srcdir/open-isns-$_pkgver" + + +build() { + abuild-meson \ + -Dsecurity=enabled \ + . output + meson compile -C output +} + +package() { + DESTDIR="$pkgdir" meson install --no-rebuild -C output + + mkdir -p "$pkgdir"/usr/lib/systemd/system +} + +lib() { + amove usr/lib/lib*.so.* +} + +sha512sums=" +f5ae8af89b85565181c2f6def9834d9dab0a15d5d9b28721cce116c5580173ed9adba219e1ede48988cb57f047578db4ece458c4a7db598412c7583e56393d2b open-isns-0.102.tar.gz +"