diff --git a/0001-add-ISCSI_VERSION_STR-define.patch b/0001-add-ISCSI_VERSION_STR-define.patch deleted file mode 100644 index 3427db4b681f36b5993d3fcbdb31d890d4a7270c..0000000000000000000000000000000000000000 --- a/0001-add-ISCSI_VERSION_STR-define.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 3518aebee85edf2da8df1cbcad1bc0f3588405a5 Mon Sep 17 00:00:00 2001 -From: happy_orange -Date: Fri, 10 Mar 2023 17:27:55 +0800 -Subject: [PATCH 1/1] add ISCSI_VERSION_STR define - ---- - usr/version.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/usr/version.h b/usr/version.h -index f8be671..328d650 100644 ---- a/usr/version.h -+++ b/usr/version.h -@@ -9,7 +9,7 @@ - * Version string should be set by the build system, else we have problems - */ - #ifndef ISCSI_VERSION_STR --#error Must set ISCSI_VERSION_STR -+#define ISCSI_VERSION_STR "2.1.8" - #endif - #define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version" - --- -2.31.1 - diff --git a/0001-meson-don-t-hide-things-with-Wno-all.patch b/0001-meson-don-t-hide-things-with-Wno-all.patch new file mode 100644 index 0000000000000000000000000000000000000000..e1601ae36427473649260160e20bb985a9ade575 --- /dev/null +++ b/0001-meson-don-t-hide-things-with-Wno-all.patch @@ -0,0 +1,32 @@ +From 51833a7ba053a0219e9e41f4b4c8c4b2f6860ff2 Mon Sep 17 00:00:00 2001 +From: Chris Leech +Date: Sat, 15 Apr 2023 16:01:15 -0700 +Subject: [PATCH 1/6] meson: don't hide things with -Wno-all + +It's breaking the build when platform defaults set +-Werror=format-security +--- + meson.build | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/meson.build b/meson.build +index 7537ea5..f352907 100644 +--- a/meson.build ++++ b/meson.build +@@ -102,11 +102,10 @@ endif + # do not depend on anything local + # + libsysdeps = static_library('sysdeps', sysdeps_files, +- include_directories: [usr_inc, main_inc, lib_inc], +- c_args: '-Wno-all') ++ include_directories: [usr_inc, main_inc, lib_inc]) + libfwparam = static_library('fwparam', fwparam_files, + include_directories: [usr_inc, main_inc, lib_inc], +- c_args: [genl_cargs, '-Wno-all']) ++ c_args: genl_cargs) + + # + # build libopeniscsiusr, since it does not +-- +2.39.2 + diff --git a/0001-unit-file-tweaks.patch b/0001-unit-file-tweaks.patch deleted file mode 100644 index c800c87ee08403e1db8f5f6a72cbc0670d1a0895..0000000000000000000000000000000000000000 --- a/0001-unit-file-tweaks.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 7a88111c7f32b1dcbb4b0d49790ac059514fa5cf Mon Sep 17 00:00:00 2001 -From: happy_orange -Date: Thu, 9 Mar 2023 16:08:09 +0800 -Subject: [PATCH 1/1] unit file tweaks - ---- - etc/systemd/iscsi-init.service.template | 2 +- - etc/systemd/iscsi.service.template | 16 ++++++++-------- - etc/systemd/iscsid.service.template | 3 +-- - etc/systemd/iscsiuio.service.template | 4 +--- - 4 files changed, 11 insertions(+), 14 deletions(-) - -diff --git a/etc/systemd/iscsi-init.service.template b/etc/systemd/iscsi-init.service.template -index 8f9a8aa..51dd052 100644 ---- a/etc/systemd/iscsi-init.service.template -+++ b/etc/systemd/iscsi-init.service.template -@@ -16,4 +16,4 @@ WantedBy=systemd-remount-fs.service - [Service] - Type=oneshot - RemainAfterExit=no --ExecStart=/usr/bin/sh -c 'echo "InitiatorName=`@SBINDIR@/iscsi-iname`" > /etc/iscsi/initiatorname.iscsi' -+ExecStart=/usr/bin/sh -c 'echo "InitiatorName=`/usr/sbin/iscsi-iname`" > /etc/iscsi/initiatorname.iscsi' -diff --git a/etc/systemd/iscsi.service.template b/etc/systemd/iscsi.service.template -index 6becab4..125d225 100644 ---- a/etc/systemd/iscsi.service.template -+++ b/etc/systemd/iscsi.service.template -@@ -1,17 +1,17 @@ - [Unit] - Description=Login and scanning of iSCSI devices - Documentation=man:iscsiadm(8) man:iscsid(8) --Before=remote-fs.target --After=network-online.target iscsid.service --Requires=iscsid.socket iscsi-init.service --Wants=network-online.target -+DefaultDependencies=no -+Before=remote-fs-pre.target -+After=network.target network-online.target iscsid.service iscsiuio.service systemd-remount-fs.service -+Wants=remote-fs-pre.target iscsi-shutdown.service -+ConditionDirectoryNotEmpty=/var/lib/iscsi/nodes - - [Service] - Type=oneshot --ExecStart=@SBINDIR@/iscsiadm -m node --loginall=automatic -W --ExecStop=@SBINDIR@/iscsiadm -m node --logoutall=automatic --ExecStop=@SBINDIR@/iscsiadm -m node --logoutall=manual --SuccessExitStatus=21 15 -+ExecStart=-/usr/sbin/iscsiadm -m node --loginall=automatic -+ExecReload=-/usr/sbin/iscsiadm -m node --loginall=automatic -+SuccessExitStatus=21 - RemainAfterExit=true - - [Install] -diff --git a/etc/systemd/iscsid.service.template b/etc/systemd/iscsid.service.template -index e2a50d3..324c593 100644 ---- a/etc/systemd/iscsid.service.template -+++ b/etc/systemd/iscsid.service.template -@@ -4,13 +4,12 @@ Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8) - DefaultDependencies=no - After=network-online.target iscsiuio.service iscsi-init.service - Before=remote-fs-pre.target --Wants=remote-fs-pre.target - Requires=iscsi-init.service - - [Service] - Type=notify - NotifyAccess=main --ExecStart=@SBINDIR@/iscsid -f -+ExecStart=/usr/sbin/iscsid -f - KillMode=mixed - Restart=on-failure - -diff --git a/etc/systemd/iscsiuio.service.template b/etc/systemd/iscsiuio.service.template -index 2e721fe..fc0be93 100644 ---- a/etc/systemd/iscsiuio.service.template -+++ b/etc/systemd/iscsiuio.service.template -@@ -2,17 +2,15 @@ - Description=iSCSI UserSpace I/O driver - Documentation=man:iscsiuio(8) - DefaultDependencies=no --Conflicts=shutdown.target - Requires=iscsid.service - BindTo=iscsid.service - After=network.target - Before=remote-fs-pre.target iscsid.service --Wants=remote-fs-pre.target - - [Service] - Type=notify - NotifyAccess=main --ExecStart=@SBINDIR@/iscsiuio -f -+ExecStart=/usr/sbin/iscsiuio -f - KillMode=mixed - Restart=on-failure - --- -2.31.1 - diff --git a/0015-try-not-to-require-network-online.patch b/0002-Currently-when-iscsi.service-is-installed-it-creates.patch similarity index 40% rename from 0015-try-not-to-require-network-online.patch rename to 0002-Currently-when-iscsi.service-is-installed-it-creates.patch index c8a30b1a5950eec9e0bdb064f22d0a926d330e54..795c767c82b0b1a8a98a47246c541c71e5f86ec1 100644 --- a/0015-try-not-to-require-network-online.patch +++ b/0002-Currently-when-iscsi.service-is-installed-it-creates.patch @@ -1,30 +1,36 @@ -From 96cde94de6794b9129c2cbb05cea3bce4f032c75 Mon Sep 17 00:00:00 2001 -Date: Fri, 10 Mar 2023 11:11:23 +0800 -Subject: [PATCH 1/1] try not to require network online +From 295bab75dfbb50904def98b46abd463a050a6e29 Mon Sep 17 00:00:00 2001 +From: Gordon Messmer +Date: Sat, 4 Feb 2023 11:17:20 -0800 +Subject: [PATCH 2/6] Currently, when iscsi.service is installed, it creates an + ordering dependency that forces network-online to start before + remote-fs-pre.target, which delays boot even when /var/lib/iscsi/nodes is + empty and the iscsi.service won't be started. This change moves the logic + that determines whether iscsi will be started to an external service file so + that the boot order dependency exists only when iscsi.service will be + started. --- - etc/Makefile | 3 ++- + etc/Makefile | 1 + etc/systemd/iscsi-starter.service.template | 13 +++++++++++++ - 2 files changed, 15 insertions(+), 1 deletion(-) + etc/systemd/iscsi.service.template | 2 +- + 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 etc/systemd/iscsi-starter.service.template diff --git a/etc/Makefile b/etc/Makefile -index 6dd6a41..a539bed 100644 +index 6dd6a41..3f92054 100644 --- a/etc/Makefile +++ b/etc/Makefile -@@ -27,7 +27,8 @@ SYSTEMD_SOURCES = $(addprefix systemd/,$(SYSTEMD_SOURCE_FILES)) +@@ -27,6 +27,7 @@ SYSTEMD_SOURCES = $(addprefix systemd/,$(SYSTEMD_SOURCE_FILES)) SYSTEMD_TEMPLATE_FILES = iscsi-init.service.template \ iscsid.service.template \ iscsi.service.template \ -- iscsiuio.service.template -+ iscsiuio.service.template \ -+ iscsi-starter.service.template ++ iscsi-starter.service.template \ + iscsiuio.service.template SYSTEMD_TEMPLATES = $(addprefix systemd/,$(SYSTEMD_TEMPLATE_FILES)) SYSTEMD_RULES_FILES = ibft-rule-generator - SYSTEMD_RULES_SOURCES = $(addprefix systemd/,$(SYSTEMD_RULES_FILES)) diff --git a/etc/systemd/iscsi-starter.service.template b/etc/systemd/iscsi-starter.service.template new file mode 100644 -index 0000000..db24e5e +index 0000000..5e97941 --- /dev/null +++ b/etc/systemd/iscsi-starter.service.template @@ -0,0 +1,13 @@ @@ -37,10 +43,20 @@ index 0000000..db24e5e +[Service] +Type=oneshot +RemainAfterExit=true -+ExecStart=systemctl start --no-block --job-mode=fail iscsi.service ++ExecStart=@SBINDIR@/systemctl start --no-block --job-mode=fail iscsi.service + +[Install] +WantedBy=sysinit.target +diff --git a/etc/systemd/iscsi.service.template b/etc/systemd/iscsi.service.template +index 6becab4..8a4de9b 100644 +--- a/etc/systemd/iscsi.service.template ++++ b/etc/systemd/iscsi.service.template +@@ -15,4 +15,4 @@ SuccessExitStatus=21 15 + RemainAfterExit=true + + [Install] +-WantedBy=remote-fs.target ++Also=iscsi-starter.service -- -2.31.1 +2.39.2 diff --git a/0002-idmb_rec_write-check-for-tpgt-first.patch b/0002-idmb_rec_write-check-for-tpgt-first.patch deleted file mode 100644 index c8e216b23f80c27aafea4a55911e7997de0d07f5..0000000000000000000000000000000000000000 --- a/0002-idmb_rec_write-check-for-tpgt-first.patch +++ /dev/null @@ -1,55 +0,0 @@ -From fd18e6ee693d96e8f76abd49623ead80fbc53994 Mon Sep 17 00:00:00 2001 -From: Chris Leech -Date: Tue, 13 Aug 2013 10:59:44 -0700 -Subject: [PATCH] idmb_rec_write, check for tpgt first - -Factor out the check for a tpgt to a single place, before going crazy on -the rec files. Makes flow of this function easier to follow, and preps -for splitting it up. - ---- - usr/idbm.c | 18 +++++------------- - 1 file changed, 5 insertions(+), 13 deletions(-) - -diff --git a/usr/idbm.c b/usr/idbm.c -index 90bc142..0abcea5 100644 ---- a/usr/idbm.c -+++ b/usr/idbm.c -@@ -2200,6 +2200,10 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock) - goto free_portal; - } - -+ if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN) -+ /* drop down to old style portal as config */ -+ goto open_conf; -+ - rc = stat(portal, &statb); - if (rc) { - rc = 0; -@@ -2208,22 +2212,10 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock) - * set the tgpt. In new versions you must pass all the info in - * from the start - */ -- if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN) -- /* drop down to old style portal as config */ -- goto open_conf; -- else -- goto mkdir_portal; -+ goto mkdir_portal; - } - - if (!S_ISDIR(statb.st_mode)) { -- /* -- * older iscsiadm versions had you create the config then set -- * set the tgpt. In new versions you must pass all the info in -- * from the start -- */ -- if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN) -- /* drop down to old style portal as config */ -- goto open_conf; - /* - * Old style portal as a file, but with tpgt. Let's update it. - */ --- -2.31.1 - diff --git a/0003-Use-DBROOT-in-iscsi-starter.-Include-iscsi-starter-i.patch b/0003-Use-DBROOT-in-iscsi-starter.-Include-iscsi-starter-i.patch new file mode 100644 index 0000000000000000000000000000000000000000..037835786b59a560bea0810ffe5fd4fc68dd55d9 --- /dev/null +++ b/0003-Use-DBROOT-in-iscsi-starter.-Include-iscsi-starter-i.patch @@ -0,0 +1,56 @@ +From 0f90d4440047a3c62bdf09d876787000d0fa5b7e Mon Sep 17 00:00:00 2001 +From: Gordon Messmer +Date: Sat, 4 Feb 2023 14:13:12 -0800 +Subject: [PATCH 3/6] Use DBROOT in iscsi-starter. Include iscsi-starter in + meson build. + +--- + etc/Makefile | 2 +- + etc/systemd/iscsi-starter.service.template | 4 ++-- + etc/systemd/meson.build | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/etc/Makefile b/etc/Makefile +index 3f92054..6ec846f 100644 +--- a/etc/Makefile ++++ b/etc/Makefile +@@ -46,7 +46,7 @@ INAME_DEST_FILE = $(DESTDIR)$(HOMEDIR)/initiatorname.iscsi + all: $(SYSTEMD_SOURCES) $(SYSTEMD_GENERATED_SERVICE_FILES) + + $(SYSTEMD_GENERATED_SERVICE_FILES): systemd/%.service: systemd/%.service.template +- $(SED) -e 's:@SBINDIR@:$(SBINDIR):' $? > $@ ++ $(SED) -e 's:@SBINDIR@:$(SBINDIR):; s:@DBROOT@:$(DBROOT):' $? > $@ + + install: install_systemd install_iface install_etc + +diff --git a/etc/systemd/iscsi-starter.service.template b/etc/systemd/iscsi-starter.service.template +index 5e97941..d3ea7cd 100644 +--- a/etc/systemd/iscsi-starter.service.template ++++ b/etc/systemd/iscsi-starter.service.template +@@ -1,8 +1,8 @@ + [Unit] + DefaultDependencies=no + Before=sysinit.target iscsi.service +-RequiresMountsFor=/var/lib/iscsi/nodes +-ConditionDirectoryNotEmpty=/var/lib/iscsi/nodes ++RequiresMountsFor=@DBROOT@/nodes ++ConditionDirectoryNotEmpty=@DBROOT@/nodes + + [Service] + Type=oneshot +diff --git a/etc/systemd/meson.build b/etc/systemd/meson.build +index 90082c7..1470a53 100644 +--- a/etc/systemd/meson.build ++++ b/etc/systemd/meson.build +@@ -3,7 +3,7 @@ + # + + # templated systemd service files +-iscsi_etc_systemd_service_units = ['iscsi-init', 'iscsid', 'iscsi', 'iscsiuio'] ++iscsi_etc_systemd_service_units = ['iscsi-init', 'iscsid', 'iscsi', 'iscsi-starter', 'iscsiuio'] + iscsi_etc_systemd_service_units_arr = {} + foreach u: iscsi_etc_systemd_service_units + iscsi_etc_systemd_service_units_arr += {u + '.service': files(u + '.service.template')} +-- +2.39.2 + diff --git a/0003-idbm_rec_write-seperate-old-and-new-style-writes.patch b/0003-idbm_rec_write-seperate-old-and-new-style-writes.patch deleted file mode 100644 index 00d72a3bcdb3e25ca02cdaf5b90f3e9c9721adbc..0000000000000000000000000000000000000000 --- a/0003-idbm_rec_write-seperate-old-and-new-style-writes.patch +++ /dev/null @@ -1,193 +0,0 @@ -From 0bb22b50dbaa7ac44e8eb244a73a66efbd98632c Mon Sep 17 00:00:00 2001 -From: Chris Leech -Date: Tue, 13 Aug 2013 11:34:31 -0700 -Subject: [PATCH 1/1] idbm_rec_write, seperate old and new style writes - -Duplicates a small bit of code, but easier to understand and extened. ---- - usr/idbm.c | 129 +++++++++++++++++++++++++++++++++++------------------ - 1 file changed, 86 insertions(+), 43 deletions(-) - -diff --git a/usr/idbm.c b/usr/idbm.c -index efdda75..307a01a 100644 ---- a/usr/idbm.c -+++ b/usr/idbm.c -@@ -2152,12 +2152,7 @@ mkdir_portal: - return f; - } - --/* -- * When the disable_lock param is true, the idbm_lock/idbm_unlock needs -- * to be holt by the caller, this will avoid overwriting each other in -- * case of updating(read-modify-write) the recs in parallel. -- */ --static int idbm_rec_write(node_rec_t *rec, bool disable_lock) -+static int idbm_rec_write_new(node_rec_t *rec) - { - struct stat statb; - FILE *f; -@@ -2170,39 +2165,8 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock) - return ISCSI_ERR_NOMEM; - } - -- snprintf(portal, PATH_MAX, "%s", NODE_CONFIG_DIR); -- if (access(portal, F_OK) != 0) { -- if (mkdir(portal, 0770) != 0) { -- log_error("Could not make %s: %s", portal, -- strerror(errno)); -- rc = ISCSI_ERR_IDBM; -- goto free_portal; -- } -- } -- -- snprintf(portal, PATH_MAX, "%s/%s", NODE_CONFIG_DIR, rec->name); -- if (access(portal, F_OK) != 0) { -- if (mkdir(portal, 0770) != 0) { -- log_error("Could not make %s: %s", portal, -- strerror(errno)); -- rc = ISCSI_ERR_IDBM; -- goto free_portal; -- } -- } -- - snprintf(portal, PATH_MAX, "%s/%s/%s,%d", NODE_CONFIG_DIR, - rec->name, rec->conn[0].address, rec->conn[0].port); -- log_debug(5, "Looking for config file %s", portal); -- -- if (!disable_lock) { -- rc = idbm_lock(); -- if (rc) -- goto free_portal; -- } -- -- if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN) -- /* drop down to old style portal as config */ -- goto open_conf; - - rc = stat(portal, &statb); - if (rc) { -@@ -2223,11 +2187,11 @@ static int idbm_rec_write(node_rec_t *rec, bool disable_lock) - log_error("Could not convert %s: %s", portal, - strerror(errno)); - rc = ISCSI_ERR_IDBM; -- goto unlock; -+ goto free_portal; - } - } else { - rc = ISCSI_ERR_INVAL; -- goto unlock; -+ goto free_portal; - } - - mkdir_portal: -@@ -2238,24 +2202,103 @@ mkdir_portal: - log_error("Could not make dir %s: %s", - portal, strerror(errno)); - rc = ISCSI_ERR_IDBM; -- goto unlock; -+ goto free_portal; - } - } - - snprintf(portal, PATH_MAX, "%s/%s/%s,%d,%d/%s", NODE_CONFIG_DIR, - rec->name, rec->conn[0].address, rec->conn[0].port, rec->tpgt, - rec->iface.name); --open_conf: -+ - f = fopen(portal, "w"); - if (!f) { - log_error("Could not open %s: %s", portal, strerror(errno)); - rc = ISCSI_ERR_IDBM; -- goto unlock; -+ goto free_portal; - } - - idbm_print(IDBM_PRINT_TYPE_NODE, rec, 1, f); - fclose(f); --unlock: -+free_portal: -+ free(portal); -+ return rc; -+} -+ -+static int idbm_rec_write_old(node_rec_t *rec) -+{ -+ FILE *f; -+ char *portal; -+ int rc = 0; -+ -+ portal = malloc(PATH_MAX); -+ if (!portal) { -+ log_error("Could not alloc portal"); -+ return ISCSI_ERR_NOMEM; -+ } -+ snprintf(portal, PATH_MAX, "%s/%s/%s,%d", NODE_CONFIG_DIR, -+ rec->name, rec->conn[0].address, rec->conn[0].port); -+ -+ f = fopen(portal, "w"); -+ if (!f) { -+ log_error("Could not open %s: %sd", portal, strerror(errno)); -+ rc = ISCSI_ERR_IDBM; -+ goto free_portal; -+ } -+ idbm_print(IDBM_PRINT_TYPE_NODE, rec, 1, f); -+ fclose(f); -+free_portal: -+ free(portal); -+ return rc; -+} -+ -+/* -+ * When the disable_lock param is true, the idbm_lock/idbm_unlock needs -+ * to be holt by the caller, this will avoid overwriting each other in -+ * case of updating(read-modify-write) the recs in parallel. -+ */ -+static int idbm_rec_write(node_rec_t *rec, bool disable_lock) -+{ -+ char *portal; -+ int rc = 0; -+ -+ portal = malloc(PATH_MAX); -+ if (!portal) { -+ log_error("Could not alloc portal"); -+ return ISCSI_ERR_NOMEM; -+ } -+ -+ snprintf(portal, PATH_MAX, "%s", NODE_CONFIG_DIR); -+ if (access(portal, F_OK) != 0) { -+ if (mkdir(portal, 0660) != 0) { -+ log_error("Could not make %s: %s", portal, -+ strerror(errno)); -+ rc = ISCSI_ERR_IDBM; -+ goto free_portal; -+ } -+ } -+ -+ snprintf(portal, PATH_MAX, "%s/%s", NODE_CONFIG_DIR, rec->name); -+ if (access(portal, F_OK) != 0) { -+ if (mkdir(portal, 0660) != 0) { -+ log_error("Could not make %s: %s", portal, -+ strerror(errno)); -+ rc = ISCSI_ERR_IDBM; -+ goto free_portal; -+ } -+ } -+ -+ if (!disable_lock) { -+ rc = idbm_lock(); -+ if (rc) -+ goto free_portal; -+ } -+ -+ if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN) -+ /* old style portal as config */ -+ rc = idbm_rec_write_old(rec); -+ else -+ rc = idbm_rec_write_new(rec); -+ - if (!disable_lock) - idbm_unlock(); - free_portal: --- -2.26.3 - diff --git a/0004-fix-systemctl-path-in-iscsi-starter.service.patch b/0004-fix-systemctl-path-in-iscsi-starter.service.patch new file mode 100644 index 0000000000000000000000000000000000000000..da80ffed71fa22fbea9c818753659556bd816f1f --- /dev/null +++ b/0004-fix-systemctl-path-in-iscsi-starter.service.patch @@ -0,0 +1,25 @@ +From 1df58cafc3b5d2dea5dd53a539a0014b10664f51 Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Mon, 3 Jul 2023 18:22:14 -0700 +Subject: [PATCH 1/1] fix systemctl path in iscsi-starter.service + +--- + etc/systemd/iscsi-starter.service.template | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/etc/systemd/iscsi-starter.service.template b/etc/systemd/iscsi-starter.service.template +index d3ea7cd..466ddf0 100644 +--- a/etc/systemd/iscsi-starter.service.template ++++ b/etc/systemd/iscsi-starter.service.template +@@ -7,7 +7,7 @@ ConditionDirectoryNotEmpty=@DBROOT@/nodes + [Service] + Type=oneshot + RemainAfterExit=true +-ExecStart=@SBINDIR@/systemctl start --no-block --job-mode=fail iscsi.service ++ExecStart=/usr/bin/systemctl start --no-block --job-mode=fail iscsi.service + + [Install] + WantedBy=sysinit.target +-- +2.40.1 + diff --git a/0004-idbw_rec_write-pick-tpgt-from-existing-record.patch b/0004-idbw_rec_write-pick-tpgt-from-existing-record.patch deleted file mode 100644 index 4a31b2abe9a55762d84d60156c33bda23fb26efe..0000000000000000000000000000000000000000 --- a/0004-idbw_rec_write-pick-tpgt-from-existing-record.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 2b1c0c5f1f2dbc516a9b51950a82eac091dbce2c Mon Sep 17 00:00:00 2001 -From: Chris Leech -Date: Tue, 13 Aug 2013 12:39:07 -0700 -Subject: [PATCH] idbw_rec_write, pick tpgt from existing record - -On a static add (-m node -o new) without a user specified tpgt, looks -for existing new style records with tpgt before creating an old style -record without. If one exists, take the tpgt from it an write an -updated new style record instead. ---- - usr/idbm.c | 40 ++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 40 insertions(+) - -diff --git a/usr/idbm.c b/usr/idbm.c -index bc51388..f1e5c88 100644 ---- a/usr/idbm.c -+++ b/usr/idbm.c -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -203,6 +204,8 @@ static struct int_list_tbl { - { "SHA3-256", AUTH_CHAP_ALG_SHA3_256 }, - }; - -+static int idbm_remove_disc_to_node_link(node_rec_t *rec, char *portal); -+ - static void - idbm_recinfo_discovery(discovery_rec_t *r, recinfo_t *ri) - { -@@ -2207,12 +2210,49 @@ static int idbm_rec_write_old(node_rec_t *rec) - FILE *f; - char *portal; - int rc = 0; -+ glob_t globbuf; -+ size_t i; -+ int tpgt = PORTAL_GROUP_TAG_UNKNOWN; - - portal = malloc(PATH_MAX); - if (!portal) { - log_error("Could not alloc portal"); - return ISCSI_ERR_NOMEM; - } -+ -+ /* check for newer portal dir with tpgt */ -+ snprintf(portal, PATH_MAX, "%s/%s/%s,%d,*", NODE_CONFIG_DIR, -+ rec->name, rec->conn[0].address, rec->conn[0].port); -+ rc = glob(portal, GLOB_ONLYDIR, NULL, &globbuf); -+ if (!rc) { -+ if (globbuf.gl_pathc > 1) -+ log_warning("multiple tpg records for portal " -+ "%s/%s:%d found", rec->name, -+ rec->conn[0].address, rec->conn[0].port); -+ /* set pattern for sscanf matching of tpgt */ -+ snprintf(portal, PATH_MAX, "%s/%s/%s,%d,%%u", NODE_CONFIG_DIR, -+ rec->name, rec->conn[0].address, rec->conn[0].port); -+ for (i = 0; i < globbuf.gl_pathc; i++) { -+ rc = sscanf(globbuf.gl_pathv[i], portal, &tpgt); -+ if (rc == 1) -+ break; -+ } -+ if (tpgt == PORTAL_GROUP_TAG_UNKNOWN) -+ log_warning("glob match on existing records, " -+ "but no valid tpgt found"); -+ } -+ globfree(&globbuf); -+ rc = 0; -+ -+ /* if a tpgt was selected from an old record, write entry in new format */ -+ if (tpgt != PORTAL_GROUP_TAG_UNKNOWN) { -+ log_warning("using tpgt %u from existing record", tpgt); -+ rec->tpgt = tpgt; -+ rc = idbm_remove_disc_to_node_link(rec, portal); -+ free(portal); -+ return idbm_rec_write_new(rec); -+ } -+ - snprintf(portal, PATH_MAX, "%s/%s/%s,%d", NODE_CONFIG_DIR, - rec->name, rec->conn[0].address, rec->conn[0].port); - --- -2.26.2 - diff --git a/0016-add-some-service-in-system.patch b/0005-improved-onboot-and-shutdown-services.patch similarity index 47% rename from 0016-add-some-service-in-system.patch rename to 0005-improved-onboot-and-shutdown-services.patch index 7fb2e03341d08f4ef7ab8edf628bfb0b858e0c84..3a5ca1f57774cf5dd392ac3414e36e5c913b33ea 100644 --- a/0016-add-some-service-in-system.patch +++ b/0005-improved-onboot-and-shutdown-services.patch @@ -1,41 +1,29 @@ -From a29ea3e4f2f8b31a71ef14509dbf12a50c5a4f85 Mon Sep 17 00:00:00 2001 -Date: Fri, 10 Mar 2023 11:30:25 +0800 -Subject: [PATCH 1/1] add some service in system +From 5a62fe2c3c36b9d14b433edb8cbccbed7af4e2b7 Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Tue, 18 Apr 2023 15:53:33 -0700 +Subject: [PATCH 4/6] improved onboot and shutdown services --- - etc/Makefile | 4 ++- - etc/systemd/iscsi-mark-root-nodes | 35 +++++++++++++++++++++ + etc/systemd/iscsi-mark-root-nodes | 34 +++++++++++++++++++++ etc/systemd/iscsi-onboot.service.template | 15 +++++++++ etc/systemd/iscsi-shutdown.service.template | 15 +++++++++ - 4 files changed, 68 insertions(+), 1 deletion(-) - create mode 100644 etc/systemd/iscsi-mark-root-nodes + etc/systemd/iscsi.service.template | 3 +- + etc/systemd/iscsid.service.template | 2 +- + etc/systemd/meson.build | 2 +- + 6 files changed, 67 insertions(+), 4 deletions(-) + create mode 100755 etc/systemd/iscsi-mark-root-nodes create mode 100644 etc/systemd/iscsi-onboot.service.template create mode 100644 etc/systemd/iscsi-shutdown.service.template -diff --git a/etc/Makefile b/etc/Makefile -index a539bed..f327f27 100644 ---- a/etc/Makefile -+++ b/etc/Makefile -@@ -28,7 +28,9 @@ SYSTEMD_TEMPLATE_FILES = iscsi-init.service.template \ - iscsid.service.template \ - iscsi.service.template \ - iscsiuio.service.template \ -- iscsi-starter.service.template -+ iscsi-starter.service.template \ -+ iscsi-onboot.service.template \ -+ iscsi-shutdown.service.template - SYSTEMD_TEMPLATES = $(addprefix systemd/,$(SYSTEMD_TEMPLATE_FILES)) - SYSTEMD_RULES_FILES = ibft-rule-generator - SYSTEMD_RULES_SOURCES = $(addprefix systemd/,$(SYSTEMD_RULES_FILES)) diff --git a/etc/systemd/iscsi-mark-root-nodes b/etc/systemd/iscsi-mark-root-nodes -new file mode 100644 -index 0000000..a083ea6 +new file mode 100755 +index 0000000..9d48805 --- /dev/null +++ b/etc/systemd/iscsi-mark-root-nodes -@@ -0,0 +1,35 @@ -++#!/bin/bash +@@ -0,0 +1,34 @@ ++#!/bin/bash + -+SCSIADM=/usr/sbin/iscsiadm ++ISCSIADM=/usr/sbin/iscsiadm +start_iscsid=0 +start_iscsiuio=0 + @@ -52,21 +40,20 @@ index 0000000..a083ea6 + + start_iscsid=1 + -+ if [ "$transport" = bnx2i ] || [ "$transport" = qedi ]; then ++ if [ "$transport" = bnx2i ] || [ "$transport" = qedi ]; then + start_iscsiuio=1 + fi -+done < <( $ISCSIADM -m session ) ++done < <( $ISCSIADM -m session ) + +# force iscsid and iscsiuio to start if needed for +# recovering sessions created in the initrd + -+if [ "$start_iscsid" -eq 1 ]; then ++if [ "$start_iscsid" -eq 1 ]; then + systemctl --no-block start iscsid.service +fi -+if [ "$start_iscsiuio" -eq 1 ]; then ++if [ "$start_iscsiuio" -eq 1 ]; then + systemctl --no-block start iscsiuio.service +fi -+i]} + diff --git a/etc/systemd/iscsi-onboot.service.template b/etc/systemd/iscsi-onboot.service.template new file mode 100644 @@ -91,7 +78,7 @@ index 0000000..42ced68 +WantedBy=sysinit.target diff --git a/etc/systemd/iscsi-shutdown.service.template b/etc/systemd/iscsi-shutdown.service.template new file mode 100644 -index 0000000..caee933 +index 0000000..fe5d5cd --- /dev/null +++ b/etc/systemd/iscsi-shutdown.service.template @@ -0,0 +1,15 @@ @@ -109,7 +96,47 @@ index 0000000..caee933 +Type=oneshot +RemainAfterExit=true +ExecStart=-/usr/bin/true -+ExecStop=-/usr/sbin/iscsiadm -m node --logoutall=all ++ExecStop=-@SBINDIR@/iscsiadm -m node --logoutall=all +diff --git a/etc/systemd/iscsi.service.template b/etc/systemd/iscsi.service.template +index 8a4de9b..17153a1 100644 +--- a/etc/systemd/iscsi.service.template ++++ b/etc/systemd/iscsi.service.template +@@ -9,8 +9,7 @@ Wants=network-online.target + [Service] + Type=oneshot + ExecStart=@SBINDIR@/iscsiadm -m node --loginall=automatic -W +-ExecStop=@SBINDIR@/iscsiadm -m node --logoutall=automatic +-ExecStop=@SBINDIR@/iscsiadm -m node --logoutall=manual ++ExecReload=@SBINDIR@/iscsiadm -m node --loginall=automatic -W + SuccessExitStatus=21 15 + RemainAfterExit=true + +diff --git a/etc/systemd/iscsid.service.template b/etc/systemd/iscsid.service.template +index e2a50d3..8987299 100644 +--- a/etc/systemd/iscsid.service.template ++++ b/etc/systemd/iscsid.service.template +@@ -5,7 +5,7 @@ DefaultDependencies=no + After=network-online.target iscsiuio.service iscsi-init.service + Before=remote-fs-pre.target + Wants=remote-fs-pre.target +-Requires=iscsi-init.service ++Requires=iscsi-init.service iscsi-shutdown.service + + [Service] + Type=notify +diff --git a/etc/systemd/meson.build b/etc/systemd/meson.build +index 1470a53..adcc6a1 100644 +--- a/etc/systemd/meson.build ++++ b/etc/systemd/meson.build +@@ -3,7 +3,7 @@ + # + + # templated systemd service files +-iscsi_etc_systemd_service_units = ['iscsi-init', 'iscsid', 'iscsi', 'iscsi-starter', 'iscsiuio'] ++iscsi_etc_systemd_service_units = ['iscsi-init', 'iscsid', 'iscsi', 'iscsi-starter', 'iscsiuio', 'iscsi-onboot', 'iscsi-shutdown'] + iscsi_etc_systemd_service_units_arr = {} + foreach u: iscsi_etc_systemd_service_units + iscsi_etc_systemd_service_units_arr += {u + '.service': files(u + '.service.template')} -- -2.31.1 +2.39.2 diff --git a/0005-update-initscripts-and-docs.patch b/0005-update-initscripts-and-docs.patch deleted file mode 100644 index c842d36f0a25d566e13b9ba27c174a6be3735493..0000000000000000000000000000000000000000 --- a/0005-update-initscripts-and-docs.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 0123e714ef4a4974ddea8dd2fa7f10fc7eacda05 Mon Sep 17 00:00:00 2001 -From: Chris Leech -Date: Mon, 19 Nov 2012 16:37:13 -0800 -Subject: [PATCH] update initscripts and docs - ---- - README | 9 ++++++--- - etc/iscsid.conf | 9 ++++++--- - usr/idbm.c | 3 +++ - 3 files changed, 15 insertions(+), 6 deletions(-) - -diff --git a/README b/README -index 118f001..23c5fe4 100644 ---- a/README -+++ b/README -@@ -1260,15 +1260,15 @@ to start the daemon and log into the targets manually. - 7.1.1 iSCSI startup using the init script - ========================================= - --Red Hat or Fedora: -+Red Hat or Fedora or Anolis: - ----------------- - To start Open-iSCSI in Red Hat/Fedora you can do: - -- systemctl start open-iscsi -+ systemctl start iscsi - - To get Open-iSCSI to automatically start at run time you may have to - run: -- systemctl enable open-iscsi -+ systemctl enable iscsi - - And, to automatically mount a file system during startup - you must have the partition entry in /etc/fstab marked with the "_netdev" -@@ -1276,6 +1276,9 @@ option. For example this would mount an iSCSI disk sdb: - - /dev/sdb /mnt/iscsi ext3 _netdev 0 0 - -+To set the startup value, so that nodes are not logged into automatically -+use the value "manual". -+ - SUSE or Debian: - --------------- - The Open-iSCSI service is socket activated, so there is no need to -diff --git a/etc/iscsid.conf b/etc/iscsid.conf -index 79d8127..0c2f57e 100644 ---- a/etc/iscsid.conf -+++ b/etc/iscsid.conf -@@ -18,8 +18,8 @@ - # maintainers. If you leave the iscsid daemon running all - # the time then leave this attribute commented out. - # --# Default for Fedora and RHEL. Uncomment to activate. --# iscsid.startup = /bin/systemctl start iscsid.socket iscsiuio.socket -+# Default for Fedora and RHEL and Anolis.Uncomment to activate. -+iscsid.startup = /bin/systemctl start iscsid.socket iscsiuio.socket - # - # Default for Debian and Ubuntu. Uncomment to activate. - # iscsid.startup = /bin/systemctl start iscsid.socket -@@ -286,6 +286,8 @@ 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: -+# with the initiator requesting a preference of enabling the checking, uncomment -+# the following lines (Data digests are not supported.):# - #node.conn[0].iscsi.HeaderDigest = CRC32C,None - #node.conn[0].iscsi.DataDigest = CRC32C,None - # -@@ -298,7 +300,7 @@ discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768 - # 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: -@@ -307,6 +309,7 @@ discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768 - # - # The default is to never use DataDigests or HeaderDigests. - # -+node.conn[0].iscsi.HeaderDigest = None - - # For multipath configurations, you may want more than one session to be - # created on each iface record. If node.session.nr_sessions is greater -diff --git a/usr/idbm.c b/usr/idbm.c -index 3092fe0..38cf5be 100644 ---- a/usr/idbm.c -+++ b/usr/idbm.c -@@ -566,9 +566,12 @@ idbm_recinfo_node(node_rec_t *r, recinfo_t *ri) - IDBM_SHOW, "None", "CRC32C", "CRC32C,None", - "None,CRC32C", num, 1); - sprintf(key, CONN_DATA_DIGEST, i); -+#if 0 -+//We do not support data digests - __recinfo_int_o4(key, ri, r, conn[i].iscsi.DataDigest, IDBM_SHOW, - "None", "CRC32C", "CRC32C,None", - "None,CRC32C", num, 1); -+#endif - sprintf(key, CONN_IFMARKER, i); - __recinfo_int_o2(key, ri, r, conn[i].iscsi.IFMarker, IDBM_SHOW, - "No", "Yes", num, 1); --- -2.31.1 - diff --git a/0006-iscsid.conf-Fedora-Red-Hat-defaults.patch b/0006-iscsid.conf-Fedora-Red-Hat-defaults.patch new file mode 100644 index 0000000000000000000000000000000000000000..f14dccd7c9cce99a1c989acd42e56dd993c73922 --- /dev/null +++ b/0006-iscsid.conf-Fedora-Red-Hat-defaults.patch @@ -0,0 +1,34 @@ +From f3b8f65a16e6e8414f8dedca4330fc0dced113db Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Tue, 18 Apr 2023 16:00:44 -0700 +Subject: [PATCH 5/6] iscsid.conf Fedora / Red Hat defaults + +--- + etc/iscsid.conf | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/etc/iscsid.conf b/etc/iscsid.conf +index ca29e43..ec4d4df 100644 +--- a/etc/iscsid.conf ++++ b/etc/iscsid.conf +@@ -18,7 +18,7 @@ + # the time then leave this attribute commented out. + # + # Default for Fedora and RHEL. Uncomment to activate. +-# iscsid.startup = /bin/systemctl start iscsid.socket iscsiuio.socket ++iscsid.startup = /bin/systemctl start iscsid.socket iscsiuio.socket + # + # Default for Debian and Ubuntu. Uncomment to activate. + # iscsid.startup = /bin/systemctl start iscsid.socket +@@ -51,7 +51,7 @@ + # node.startup = automatic + # + # To manually startup the session, use "manual". The default is manual. +-node.startup = manual ++node.startup = automatic + + # 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 +-- +2.39.2 + diff --git a/0006-use-var-for-config.patch b/0006-use-var-for-config.patch deleted file mode 100644 index 7fa2f2e92b2b3eeab43fa1680ad98edc1356e8ce..0000000000000000000000000000000000000000 --- a/0006-use-var-for-config.patch +++ /dev/null @@ -1,169 +0,0 @@ -From 3396cb9ae6dd1329e88ade8c9ba74809c1e5971d Mon Sep 17 00:00:00 2001 -From: Chris Leech -Date: Thu, 9 Mar 2023 16:51:43 +0800 -Subject: [PATCH 1/1] usr var for config - ---- - README | 32 +++++++++++++++----------------- - libopeniscsiusr/idbm.h | 2 +- - usr/idbm.h | 1 + - usr/iface.h | 1 + - 4 files changed, 18 insertions(+), 18 deletions(-) - -diff --git a/README b/README -index 23c5fe4..be0b052 100644 ---- a/README -+++ b/README -@@ -198,9 +198,7 @@ Usage: iscsid [OPTION] - - Open-iSCSI persistent configuration is stored in a number of - directories under a configuration root directory, using a flat-file --format. This configuration root directory is /etc/iscsi by default, --but may also commonly be in /var/lib/iscsi (see "dbroot" in the meson --options discussed earlier). -+format. This configuration root directory is /etc/iscsi by default. - - Configuration is contained in directories for: - -@@ -608,7 +606,7 @@ a scsi_host per HBA port). - To manage both types of initiator stacks, iscsiadm uses the interface (iface) - structure. For each HBA port or for software iSCSI for each network - device (ethX) or NIC, that you wish to bind sessions to you must create --a iface config /etc/iscsi/ifaces. -+a iface config /var/lib/iscsi/ifaces. - - Prep - ---- -@@ -642,7 +640,7 @@ The command: - - iscsiadm -m iface - --will report iface configurations that are setup in /etc/iscsi/ifaces: -+will report iface configurations that are setup in /var/lib/iscsi/ifaces: - - iface0 qla4xxx,00:c0:dd:08:63:e8,20.15.0.7,default,iqn.2005-06.com.redhat:madmax - iface1 qla4xxx,00:c0:dd:08:63:ea,20.15.0.9,default,iqn.2005-06.com.redhat:madmax -@@ -653,10 +651,10 @@ The format is: - - For software iSCSI, you can create the iface configs by hand, but it is - recommended that you use iscsiadm's iface mode. There is an iface.example in --/etc/iscsi/ifaces which can be used as a template for the daring. -+/var/lib/iscsi/ifaces which can be used as a template for the daring. - - For each network object you wish to bind a session to, you must create --a separate iface config in /etc/iscsi/ifaces and each iface config file -+a separate iface config in /var/lib/iscsi/ifaces and each iface config file - must have a unique name which is less than or equal to 64 characters. - - Example -@@ -669,7 +667,7 @@ TCP/IP, then in /etc/iscsi/ifaces/iface0 you would enter: - iface.transport_name = tcp - iface.hwaddress = 00:0F:1F:92:6B:BF - --and in /etc/iscsi/ifaces/iface1 you would enter: -+and in /var/lib/ifaces/iface1 you would enter: - - iface.transport_name = tcp - iface.hwaddress = 00:C0:DD:08:63:E7 -@@ -715,7 +713,7 @@ Running the following command: - - iscsiadm -m iface - --will report iface configurations that are setup in /etc/iscsi/ifaces: -+will report iface configurations that are setup in /var/lib/iscsi/ifaces: - - default tcp,,,, - iser iser,,,, -@@ -802,7 +800,7 @@ need a separate network connection to the target for discovery purposes. - *This should be fixed in the some future version of Open-iSCSI* - - For compatibility reasons, when you run iscsiadm to do discovery, it --will check for interfaces in /etc/iscsi/iscsi/ifaces that are using -+will check for interfaces in /var/lib/iscsi/iscsi/ifaces that are using - tcp for the iface.transport, and it will bind the portals that are discovered - so that they will be logged in through those ifaces. This behavior can also - be overridden by passing in the interfaces you want to use. For the case -@@ -819,7 +817,7 @@ bind a session to an iface, then you can use the special iface "default": - - iscsiadm -m discoverydb -t st -p ip:port -I default --discover -P 1 - --And if you did not define any interfaces in /etc/iscsi/ifaces and do -+And if you did not define any interfaces in /var/lib/iscsi/ifaces and do - not pass anything into iscsiadm, running iscsiadm will do the default - behavior, allowing the network subsystem to decide which device to use. - -@@ -860,7 +858,7 @@ Discovery mode - - iscsiadm -m discoverydb -t st -p 192.168.1.1:3260 --discover - -- This will search /etc/iscsi/send_targets for a record with the -+ This will search /var/lib/iscsi/send_targets for a record with the - ID [portal = 192.168.1.1:3260 and type = sendtargets. If found it - will perform discovery using the settings stored in the record. - If a record does not exist, it will be created using the iscsid.conf -@@ -870,7 +868,7 @@ Discovery mode - - iscsiadm -m discoverydb -t st -p somehost --discover - -- For the ifaces, iscsiadm will first search /etc/iscsi/ifaces for -+ For the ifaces, iscsiadm will first search /var/lib/iscsi/ifaces for - interfaces using software iSCSI. If any are found then nodes found - during discovery will be setup so that they can logged in through - those interfaces. To specify a specific iface, pass the -@@ -926,7 +924,7 @@ Discovery mode - - - SendTargets iSCSI Discovery with a specific interface. If you wish - to only use a subset of the interfaces in -- /etc/iscsi/ifaces, then you can pass them in during discovery: -+ /var/lib/iscsi/ifaces, then you can pass them in during discovery: - - iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \ - --interface=iface0 --interface=iface1 --discover -@@ -1349,8 +1347,8 @@ Here, where targetname is the name of the target and ip_address:port - is the address and port of the portal. tpgt is the Target Portal Group - Tag of the portal, and is not used in iscsiadm commands except for static - record creation. ifacename is the name of the iSCSI interface --defined in /etc/iscsi/ifaces. If no interface was defined in --/etc/iscsi/ifaces or passed in, the default behavior is used. -+defined in /var/lib/iscsi/ifaces. If no interface was defined in -+/var/lib/iscsi/ifaces or passed in, the default behavior is used. - Default here is iscsi_tcp/tcp to be used over whichever NIC the - network layer decides is best. - -@@ -1488,7 +1486,7 @@ If set, iscsid will perform discovery to the address every - discovery.isns.discoveryd_poll_inval or - discovery.sendtargets.discoveryd_poll_inval seconds, - and it will log into any portals found from the discovery source using --the ifaces in /etc/iscsi/ifaces. -+the ifaces in /var/lib/iscsi/ifaces. - - Note that for iSNS the poll_interval does not have to be set. If not set, - iscsid will only perform rediscovery when it gets a SCN from the server. -diff --git a/libopeniscsiusr/idbm.h b/libopeniscsiusr/idbm.h -index be5986f..56f8ec3 100644 ---- a/libopeniscsiusr/idbm.h -+++ b/libopeniscsiusr/idbm.h -@@ -31,7 +31,7 @@ - #include "libopeniscsiusr/libopeniscsiusr_common.h" - - #ifndef ISCSI_DB_ROOT --#define ISCSI_DB_ROOT "/etc/iscsi" -+#define ISCSI_DB_ROOT "/var/lib/iscsi" - #endif - - #define IFACE_CONFIG_DIR ISCSI_DB_ROOT"/ifaces" -diff --git a/usr/iface.h b/usr/iface.h -index 7e1e6a2..1139fc1 100644 ---- a/usr/iface.h -+++ b/usr/iface.h -@@ -21,6 +21,7 @@ - #define ISCSI_IFACE_H - - #include -+#include "idbm.h" - - #define IFACE_CONFIG_DIR ISCSI_DB_ROOT"/ifaces" - --- -2.31.1 - diff --git a/0007-Disable-Data-Digests.patch b/0007-Disable-Data-Digests.patch new file mode 100644 index 0000000000000000000000000000000000000000..795078056e7219f32546020f7b0744060db249b2 --- /dev/null +++ b/0007-Disable-Data-Digests.patch @@ -0,0 +1,70 @@ +From 4fd0476062b1c63e1e4aff45a59e3fa79e3bf0e6 Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Tue, 18 Apr 2023 16:04:00 -0700 +Subject: [PATCH 6/6] Disable Data Digests + +--- + etc/iscsid.conf | 18 +++++++----------- + usr/idbm.c | 4 ++++ + 2 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/etc/iscsid.conf b/etc/iscsid.conf +index ec4d4df..e009c29 100644 +--- a/etc/iscsid.conf ++++ b/etc/iscsid.conf +@@ -285,27 +285,23 @@ 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: ++# uncomment the following line: + #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: ++# uncomment the following line: + #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: ++# To enable CRC32C digest checking for the header of ++# iSCSI PDUs, uncomment the following line: + #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: ++# To disable digest checking for the header of ++# iSCSI PDUs, uncomment the following line: + #node.conn[0].iscsi.HeaderDigest = None +-#node.conn[0].iscsi.DataDigest = None + # +-# The default is to never use DataDigests or HeaderDigests. ++# The default is to never use HeaderDigests. + # + + # For multipath configurations, you may want more than one session to be +diff --git a/usr/idbm.c b/usr/idbm.c +index ca4a4ec..32e99bc 100644 +--- a/usr/idbm.c ++++ b/usr/idbm.c +@@ -568,9 +568,13 @@ idbm_recinfo_node(node_rec_t *r, recinfo_t *ri) + IDBM_SHOW, "None", "CRC32C", "CRC32C,None", + "None,CRC32C", num, 1); + sprintf(key, CONN_DATA_DIGEST, i); ++ ++#if 0 ++We do not support data digests + __recinfo_int_o4(key, ri, r, conn[i].iscsi.DataDigest, IDBM_SHOW, + "None", "CRC32C", "CRC32C,None", + "None,CRC32C", num, 1); ++#endif + sprintf(key, CONN_IFMARKER, i); + __recinfo_int_o2(key, ri, r, conn[i].iscsi.IFMarker, IDBM_SHOW, + "No", "Yes", num, 1); +-- +2.39.2 + diff --git a/0008-Add-macros-to-release-GIL-lock.patch b/0008-Add-macros-to-release-GIL-lock.patch deleted file mode 100644 index e03b7effd709e62e573739f4193d514facdef47a..0000000000000000000000000000000000000000 --- a/0008-Add-macros-to-release-GIL-lock.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 676f48d6e70f8406b36a004669d923825db51e2f Mon Sep 17 00:00:00 2001 -From: Jiri Konecny -Date: Mon, 11 May 2015 13:16:26 +0200 -Subject: [PATCH] Add macros to release GIL lock - -Other threads are blocked when GIL is not released before the time consuming -functions. ---- - libiscsi/pylibiscsi.c | 16 +++++++++++++--- - 1 file changed, 13 insertions(+), 3 deletions(-) - -diff --git a/libiscsi/pylibiscsi.c b/libiscsi/pylibiscsi.c -index 8800853..40b5955 100644 ---- a/libiscsi/pylibiscsi.c -+++ b/libiscsi/pylibiscsi.c -@@ -364,8 +364,13 @@ static PyObject *PyIscsiNode_str(PyObject *self) - static PyObject *PyIscsiNode_login(PyObject *self) - { - PyIscsiNode *node = (PyIscsiNode *)self; -+ int ret; - -- if (libiscsi_node_login(context, &node->node)) { -+ Py_BEGIN_ALLOW_THREADS -+ ret = libiscsi_node_login(context, &node->node); -+ Py_END_ALLOW_THREADS -+ -+ if (ret) { - PyErr_SetString(PyExc_IOError, - libiscsi_get_error_string(context)); - return NULL; -@@ -551,6 +556,7 @@ static PyObject *pylibiscsi_discover_sendtargets(PyObject *self, - const struct libiscsi_auth_info *authinfo = NULL; - struct libiscsi_node *found_nodes; - PyObject* found_node_list; -+ int ret; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|iO", - kwlist, &address, &port, -@@ -570,8 +576,12 @@ static PyObject *pylibiscsi_discover_sendtargets(PyObject *self, - } - } - -- if (libiscsi_discover_sendtargets(context, address, port, authinfo, -- &nr_found, &found_nodes)) { -+ Py_BEGIN_ALLOW_THREADS -+ ret = libiscsi_discover_sendtargets(context, address, port, authinfo, -+ &nr_found, &found_nodes); -+ Py_END_ALLOW_THREADS -+ -+ if (ret) { - PyErr_SetString(PyExc_IOError, - libiscsi_get_error_string(context)); - return NULL; --- -2.26.2 - diff --git a/0010-Revert-iscsiadm-return-error-when-login-fails.patch b/0008-Revert-iscsiadm-return-error-when-login-fails.patch similarity index 100% rename from 0010-Revert-iscsiadm-return-error-when-login-fails.patch rename to 0008-Revert-iscsiadm-return-error-when-login-fails.patch diff --git a/0008-libiscsi-introduce-sessions-API.patch b/0008-libiscsi-introduce-sessions-API.patch deleted file mode 100644 index 01405fc074ab841b268cba83ea7ed05b3f301ef6..0000000000000000000000000000000000000000 --- a/0008-libiscsi-introduce-sessions-API.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 4382a3eac90d0a6b7715cea5d2173ae877ee5a47 Mon Sep 17 00:00:00 2001 -From: Peter Hatina -Date: Thu, 9 Mar 2023 19:00:29 +0800 -Subject: [PATCH] libiscsi introduce sessions API - ---- - usr/iscsi_sysfs.c | 6 ++++++ - usr/iscsi_sysfs.h | 2 ++ - 2 files changed, 8 insertions(+) - -diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c -index 9a591be..0830f0e 100644 ---- a/usr/iscsi_sysfs.c -+++ b/usr/iscsi_sysfs.c -@@ -3,6 +3,7 @@ - * - * Copyright (C) 2006 Mike Christie - * Copyright (C) 2006 Red Hat, Inc. All rights reserved. -+ * Copyright (C) 2015 Peter Hatina - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published -@@ -1163,6 +1164,11 @@ free_info: - return rc; - } - -+const char *iscsi_sysfs_get_session_path(void) -+{ -+ return ISCSI_SESSION_DIR; -+} -+ - int iscsi_sysfs_for_each_iface_on_host(void *data, uint32_t host_no, - int *nr_found, - iscsi_sysfs_iface_op_fn *fn) -diff --git a/usr/iscsi_sysfs.h b/usr/iscsi_sysfs.h -index 9575c65..52b3081 100644 ---- a/usr/iscsi_sysfs.h -+++ b/usr/iscsi_sysfs.h -@@ -3,6 +3,7 @@ - * - * Copyright (C) 2006 Mike Christie - * Copyright (C) 2006 Red Hat, Inc. All rights reserved. -+ * Copyright (C) 2015 Peter Hatina - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published -@@ -48,6 +49,7 @@ typedef int (iscsi_sysfs_flashnode_op_fn)(void *, struct flashnode_rec *, - uint32_t, uint32_t); - typedef int (iscsi_sysfs_iface_op_fn)(void *, struct iface_rec *); - -+extern const char *iscsi_sysfs_get_session_path(void); - extern int iscsi_sysfs_for_each_iface_on_host(void *data, uint32_t host_no, - int *nr_found, - iscsi_sysfs_iface_op_fn *fn); --- -2.31.1 - diff --git a/0012-Coverity-scan-fixes.patch b/0009-Coverity-scan-fixes.patch similarity index 90% rename from 0012-Coverity-scan-fixes.patch rename to 0009-Coverity-scan-fixes.patch index 1b3904e01bf55c8cef9d51755287e2a2b8f94f3f..65b1e92ba2d82468e7a01038042e32d6436755f7 100644 --- a/0012-Coverity-scan-fixes.patch +++ b/0009-Coverity-scan-fixes.patch @@ -15,12 +15,12 @@ diff --git a/iscsiuio/src/unix/libs/qedi.c b/iscsiuio/src/unix/libs/qedi.c index 1af8d1b..9a814c6 100644 --- a/iscsiuio/src/unix/libs/qedi.c +++ b/iscsiuio/src/unix/libs/qedi.c -@@ -1030,7 +1030,7 @@ static int qedi_read(nic_t *nic, packet_t *pkt) +@@ -1034,7 +1034,7 @@ static int qedi_read(nic_t *nic, packet_t *pkt) - LOG_DEBUG(PFX "%s:hw_prod %d bd_prod %d, rx_pkt_idx %d, rxlen %d", + ILOG_DEBUG(PFX "%s:hw_prod %d bd_prod %d, rx_pkt_idx %d, rxlen %d", nic->log_name, hw_prod, bd_prod, rx_bd->rx_pkt_index, len); -- LOG_DEBUG(PFX "%s: sw_con %d bd_cons %d num BD %d", -+ LOG_DEBUG(PFX "%s: sw_con %d bd_cons %d num BD %lu", +- ILOG_DEBUG(PFX "%s: sw_con %d bd_cons %d num BD %d", ++ ILOG_DEBUG(PFX "%s: sw_con %d bd_cons %d num BD %lu", nic->log_name, sw_cons, bd_cons, QEDI_NUM_RX_BD); if (bd_cons != bd_prod) { @@ -33,7 +33,7 @@ index 0c9ad49..f83f305 100644 sigaddset(&set, SIGUSR1); rc = pthread_sigmask(SIG_SETMASK, &set, NULL); + if (rc != 0) { -+ LOG_ERR("Failed to set thread signal mask"); ++ ILOG_ERR("Failed to set thread signal mask"); + } /* Spin off the signal handling thread */ diff --git a/0009-remove-the-offload-boot-supported-ifdef.patch b/0009-remove-the-offload-boot-supported-ifdef.patch deleted file mode 100644 index 2466935571caf012ef45889dfe79ef3e6a7f2e5c..0000000000000000000000000000000000000000 --- a/0009-remove-the-offload-boot-supported-ifdef.patch +++ /dev/null @@ -1,45 +0,0 @@ -From d410fe4b6eb2347f2160b8aaab24a639de99c23c Mon Sep 17 00:00:00 2001 -From: Chris Leech -Date: Mon, 19 Nov 2012 17:09:24 -0800 -Subject: [PATCH] remove the offload boot supported ifdef - ---- - usr/iface.c | 7 +------ - 1 file changed, 1 insertion(+), 6 deletions(-) - -diff --git a/usr/iface.c b/usr/iface.c -index 11f3d2a..65c1615 100644 ---- a/usr/iface.c -+++ b/usr/iface.c -@@ -998,6 +998,7 @@ int iface_setup_from_boot_context(struct iface_rec *iface, - { - struct iscsi_transport *t = NULL; - uint32_t hostno; -+ int rc; - - if (strlen(context->initiatorname)) - strlcpy(iface->iname, context->initiatorname, -@@ -1011,10 +1012,7 @@ int iface_setup_from_boot_context(struct iface_rec *iface, - return 0; - } - } else if (strlen(context->iface)) { --/* this ifdef is only temp until distros and firmwares are updated */ --#ifdef OFFLOAD_BOOT_SUPPORTED - char transport_name[ISCSI_TRANSPORT_NAME_MAXLEN]; -- int rc; - - memset(transport_name, 0, ISCSI_TRANSPORT_NAME_MAXLEN); - /* make sure offload driver is loaded */ -@@ -1040,9 +1038,6 @@ int iface_setup_from_boot_context(struct iface_rec *iface, - } - - strlcpy(iface->netdev, context->iface, sizeof(iface->netdev)); --#else -- return 0; --#endif - } else - return 0; - --- -2.26.2 - diff --git a/0010-use-Red-Hat-version-string-to-match-RPM-package-vers.patch b/0010-use-Red-Hat-version-string-to-match-RPM-package-vers.patch new file mode 100644 index 0000000000000000000000000000000000000000..ed3b5c01ca770d40e91cf1bfed87fe41c16e7721 --- /dev/null +++ b/0010-use-Red-Hat-version-string-to-match-RPM-package-vers.patch @@ -0,0 +1,39 @@ +From 08e9412135c1c89df4d50b8dbdc12c0d227307cb Mon Sep 17 00:00:00 2001 +From: Chris Leech +Date: Mon, 21 Jan 2013 15:43:36 -0800 +Subject: [PATCH 1/1] use Red Hat version string to match RPM package version + +--- + Makefile | 2 +- + meson.build | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index a0859b7..7ae461a 100644 +--- a/Makefile ++++ b/Makefile +@@ -7,7 +7,7 @@ + DESTDIR ?= + + # our VERSION String +-ISCSI_VERSION_STR ?= 2.1.9 ++ISCSI_VERSION_STR ?= 6.2.1.9 + + prefix = /usr + exec_prefix = +diff --git a/meson.build b/meson.build +index d49afbb..ab67096 100644 +--- a/meson.build ++++ b/meson.build +@@ -4,7 +4,7 @@ + + project('open-iscsi', 'c', + meson_version: '>= 0.54.0', +- version: '2.1.9', ++ version: '6.2.1.9', + license: 'LGPL-2.1-or-later', + default_options: [ + 'c_std=gnu99', +-- +2.40.1 + diff --git a/0011-use-var-lib-iscsi-in-libopeniscsiusr.patch b/0011-use-var-lib-iscsi-in-libopeniscsiusr.patch deleted file mode 100644 index c0abbd57030d84bd12f7a6b41148c2544cf5edbd..0000000000000000000000000000000000000000 --- a/0011-use-var-lib-iscsi-in-libopeniscsiusr.patch +++ /dev/null @@ -1,71 +0,0 @@ -From abdce896253f1524a56f174540bd91ecc07c6b52 Mon Sep 17 00:00:00 2001 -From: happy_orange -Date: Thu, 9 Mar 2023 20:28:23 +0800 -Subject: [PATCH 1/1] use /var/lib/iscsi in libopeniscsiusr - ---- - libopeniscsiusr/iface.c | 2 +- - libopeniscsiusr/libopeniscsiusr/libopeniscsiusr.h | 6 +++--- - libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_iface.h | 2 +- - 3 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/libopeniscsiusr/iface.c b/libopeniscsiusr/iface.c -index 006b188..5230f09 100644 ---- a/libopeniscsiusr/iface.c -+++ b/libopeniscsiusr/iface.c -@@ -409,7 +409,7 @@ int iscsi_default_iface_setup(struct iscsi_context *ctx) - - _good(_iscsi_hids_get(ctx, &hids, &hid_count), rc, out); - for (i = 0; i < hid_count; ++i) { -- /* Create /etc/iscsi/ifaces/ file if not found -+ /* Create /var/lib/iscsi/ifaces/ file if not found - */ - _good(_iscsi_ifaces_get_from_sysfs(ctx, hids[i], &ifaces, &iface_count), - rc, out); -diff --git a/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr.h b/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr.h -index a29d5b1..b13e453 100644 ---- a/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr.h -+++ b/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr.h -@@ -339,7 +339,7 @@ __DLL_EXPORT void iscsi_session_free(struct iscsi_session *se); - * * bnx2i - * - * It will also create configuration files for iSCSI hardware offload cards in -- * /etc/iscsi/ifaces/. -+ * /var/lib/iscsi/ifaces/. - * - * @ctx: - * Pointer of 'struct iscsi_context'. -@@ -427,7 +427,7 @@ __DLL_EXPORT void iscsi_ifaces_free(struct iscsi_iface **ifaces, - * iscsi_iface_get() - Retrieve specified iSCSI interface. - * - * Retrieves specified iSCSI interfaces by reading configuration from -- * "/etc/iscsi/iface/". -+ * "/var/lib/iscsi/iface/". - * To generate iSCSI interface configuration when new card installed, please - * use iscsi_default_iface_setup(). - * Illegal configuration file will be treated as error LIBISCSI_ERR_IDBM. -@@ -438,7 +438,7 @@ __DLL_EXPORT void iscsi_ifaces_free(struct iscsi_iface **ifaces, - * If this pointer is NULL, your program will be terminated by assert. - * @iface_name: - * String. Name of iSCSI interface. Also the file name of configuration -- * file "/etc/iscsi/iface/". -+ * file "/var/lib/iscsi/iface/". - * If this pointer is NULL or empty string, your program will be terminated - * by assert. - * @iface: -diff --git a/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_iface.h b/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_iface.h -index 9ac1aa5..50f2d1e 100644 ---- a/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_iface.h -+++ b/libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_iface.h -@@ -182,7 +182,7 @@ __DLL_EXPORT const char *iscsi_iface_name_get(struct iscsi_iface *iface); - * - * Dump all configurations of specified iSCSI interface. Will skip empty - * configuration so that output string could be saved directly to -- * /etc/iscsi/ifaces/ file. -+ * /var/lib/iscsi/ifaces/ file. - * - * @iface: - * Pointer of 'struct iscsi_iface'. --- -2.31.1 - diff --git a/0013-iscsi_if.h-replace-zero-length-array-with-flexible-a.patch b/0013-iscsi_if.h-replace-zero-length-array-with-flexible-a.patch deleted file mode 100644 index 2318503f096886a44dc0e6eed4b9414f108fee20..0000000000000000000000000000000000000000 --- a/0013-iscsi_if.h-replace-zero-length-array-with-flexible-a.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 84a8601fe7b9b5337af95835aaa5aae1bfd88d95 Mon Sep 17 00:00:00 2001 -From: rpm-build -Date: Tue, 11 Aug 2020 21:00:29 +0200 -Subject: [PATCH] iscsi_if.h replace zero-length array with flexible-array - member - ---- - include/iscsi_if.h | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/include/iscsi_if.h b/include/iscsi_if.h -index 5a1c614..e8cee0d 100644 ---- a/include/iscsi_if.h -+++ b/include/iscsi_if.h -@@ -337,7 +337,7 @@ enum iscsi_param_type { - struct iscsi_param_info { - uint32_t len; /* Actual length of the param value */ - uint16_t param; /* iscsi param */ -- uint8_t value[0]; /* length sized value follows */ -+ uint8_t value[]; /* length sized value follows */ - } __attribute__((__packed__)); - - struct iscsi_iface_param_info { -@@ -346,7 +346,7 @@ struct iscsi_iface_param_info { - uint16_t param; /* iscsi param value */ - uint8_t iface_type; /* IPv4 or IPv6 */ - uint8_t param_type; /* iscsi_param_type */ -- uint8_t value[0]; /* length sized value follows */ -+ uint8_t value[]; /* length sized value follows */ - } __attribute__((__packed__)); - - /* -@@ -723,7 +723,7 @@ enum iscsi_flashnode_param { - struct iscsi_flashnode_param_info { - uint32_t len; /* Actual length of the param */ - uint16_t param; /* iscsi param value */ -- uint8_t value[0]; /* length sized value follows */ -+ uint8_t value[]; /* length sized value follows */ - } __attribute__((__packed__)); - - enum iscsi_discovery_parent_type { --- -2.26.2 - diff --git a/0014-minor-service-file-updates.patch b/0014-minor-service-file-updates.patch deleted file mode 100644 index 06892949e8d5f013ba78af738706dd28633923ff..0000000000000000000000000000000000000000 --- a/0014-minor-service-file-updates.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 405c79b48a3d04f8aeb9017226a73bb6d2493a5f Mon Sep 17 00:00:00 2001 -From: Chris Leech -Date: Thu, 9 Mar 2023 19:15:27 +0800 -Subject: [PATCH 1/1] minor service file updates - ---- - etc/systemd/iscsi-init.service.template | 1 + - etc/systemd/iscsi.service.template | 2 +- - etc/systemd/iscsid.service.template | 3 +-- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/etc/systemd/iscsi-init.service.template b/etc/systemd/iscsi-init.service.template -index 51dd052..160e579 100644 ---- a/etc/systemd/iscsi-init.service.template -+++ b/etc/systemd/iscsi-init.service.template -@@ -1,6 +1,7 @@ - [Unit] - Description=One time configuration for iscsi.service - ConditionPathExists=!/etc/iscsi/initiatorname.iscsi -+Before=iscsid.service - DefaultDependencies=no - RequiresMountsFor=/etc/iscsi - # systemd-remount-fs.service is optionally pulled in by -diff --git a/etc/systemd/iscsi.service.template b/etc/systemd/iscsi.service.template -index 125d225..08adff7 100644 ---- a/etc/systemd/iscsi.service.template -+++ b/etc/systemd/iscsi.service.template -@@ -4,7 +4,7 @@ Documentation=man:iscsiadm(8) man:iscsid(8) - DefaultDependencies=no - Before=remote-fs-pre.target - After=network.target network-online.target iscsid.service iscsiuio.service systemd-remount-fs.service --Wants=remote-fs-pre.target iscsi-shutdown.service -+Wants=remote-fs-pre.target - ConditionDirectoryNotEmpty=/var/lib/iscsi/nodes - - [Service] -diff --git a/etc/systemd/iscsid.service.template b/etc/systemd/iscsid.service.template -index 324c593..df0bd83 100644 ---- a/etc/systemd/iscsid.service.template -+++ b/etc/systemd/iscsid.service.template -@@ -4,7 +4,7 @@ Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8) - DefaultDependencies=no - After=network-online.target iscsiuio.service iscsi-init.service - Before=remote-fs-pre.target --Requires=iscsi-init.service -+Requires=iscsi-init.service iscsi-shutdown.service - - [Service] - Type=notify -@@ -15,4 +15,3 @@ Restart=on-failure - - [Install] - WantedBy=multi-user.target --Also=iscsid.socket --- -2.31.1 - diff --git a/0007-libiscsi.patch b/0101-libiscsi.patch similarity index 94% rename from 0007-libiscsi.patch rename to 0101-libiscsi.patch index c8a13a1216065ccc5242123e934cb67bee1162d8..c8c11582861be2154a8d42aacf208e3ecfe9a345 100644 --- a/0007-libiscsi.patch +++ b/0101-libiscsi.patch @@ -1,14 +1,14 @@ -From 0d15398c0afa4bbae9c10fa2374806b7f36cc4c7 Mon Sep 17 00:00:00 2001 -From: happy_orange -Date: Thu, 9 Mar 2023 17:50:25 +0800 -Subject: [PATCH 1/1] add libiscsi +From 87b7c11947f6ba154271f8f70720a721d23f040e Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Mon, 26 Jan 2015 12:57:11 -0800 +Subject: [PATCH 1/1] libiscsi --- Makefile | 2 + - libiscsi/Makefile | 67 + - libiscsi/libiscsi.c | 745 ++++++++++ + libiscsi/Makefile | 77 + + libiscsi/libiscsi.c | 620 ++++++++ libiscsi/libiscsi.doxy | 1473 +++++++++++++++++++ - libiscsi/libiscsi.h | 400 +++++ + libiscsi/libiscsi.h | 344 +++++ libiscsi/no_date_footer.html | 6 + libiscsi/pylibiscsi.c | 719 +++++++++ libiscsi/setup.py | 9 + @@ -21,12 +21,11 @@ Subject: [PATCH 1/1] add libiscsi libiscsi/tests/test_logout.c | 51 + libiscsi/tests/test_params.c | 103 ++ libiscsi/tests/test_set_auth.c | 58 + - usr/Makefile | 2 +- - usr/discovery.c | 5 + + usr/discovery.c | 1 + usr/idbm.c | 6 +- - usr/idbm.h | 4 + + usr/idbm.h | 3 + usr/iscsi_ipc.h | 2 + - 22 files changed, 3966 insertions(+), 4 deletions(-) + 21 files changed, 3789 insertions(+), 3 deletions(-) create mode 100644 libiscsi/Makefile create mode 100644 libiscsi/libiscsi.c create mode 100644 libiscsi/libiscsi.doxy @@ -45,31 +44,31 @@ Subject: [PATCH 1/1] add libiscsi create mode 100644 libiscsi/tests/test_set_auth.c diff --git a/Makefile b/Makefile -index 09bda07..dad878f 100644 +index 09bda07..a0859b7 100644 --- a/Makefile +++ b/Makefile -@@ -65,6 +65,7 @@ user: deprecation_msg iscsiuio/Makefile - $(MAKE) $(MFLAGS) -C utils +@@ -66,6 +66,7 @@ user: deprecation_msg iscsiuio/Makefile $(MAKE) $(MFLAGS) -C etc $(MAKE) $(MFLAGS) -C iscsiuio -+ $(MAKE) $(MFLAGS) -C libiscsi $(MAKE) $(MFLAGS) -C doc ++ $(MAKE) $(MFLAGS) -C libiscsi @echo @echo "Compilation complete Output file" -@@ -91,6 +92,7 @@ clean distclean: - $(MAKE) $(MFLAGS) -C usr $@ - $(MAKE) $(MFLAGS) -C etc $@ - $(MAKE) $(MFLAGS) -C libopeniscsiusr $@ -+ $(MAKE) $(MFLAGS) -C libiscsi $@ - $(MAKE) $(MFLAGS) -C doc $@ - [ ! -f iscsiuio/Makefile ] || $(MAKE) $(MFLAGS) -C iscsiuio $@ + @echo "----------------------------------- ----------------" +@@ -86,6 +87,7 @@ iscsiuio/configure: iscsiuio/configure.ac iscsiuio/Makefile.am + force: ; + clean distclean: ++ $(MAKE) $(MFLAGS) -C libiscsi $@ + $(MAKE) $(MFLAGS) -C sysdeps $@ + $(MAKE) $(MFLAGS) -C utils $@ + $(MAKE) $(MFLAGS) -C usr $@ diff --git a/libiscsi/Makefile b/libiscsi/Makefile new file mode 100644 -index 0000000..462d666 +index 0000000..7f5d371 --- /dev/null +++ b/libiscsi/Makefile -@@ -0,0 +1,67 @@ +@@ -0,0 +1,77 @@ +# This Makefile will work only with GNU make. + +ifeq ($(TOPDIR),) @@ -82,7 +81,17 @@ index 0000000..462d666 +CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I../include -I../usr \ + -D$(OSNAME) -fPIC -D_GNU_SOURCE -fvisibility=hidden \ + -I../libopeniscsiusr ++ ++#CFLAGS ?= -O2 -g ++#CFLAGS += -Wall -Werror -Wextra -fvisibility=hidden -fPIC ++CFLAGS += -I../libopeniscsiusr -I../include -I../usr ++#CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod) ++CFLAGS += -DSBINDIR=\"$(SBINDIR)\" ++CFLAGS += -DISCSI_DB_ROOT=\"$(DBROOT)\" ++CFLAGS += -DISCSI_VERSION_STR=\"$(ISCSI_VERSION_STR)\" ++ +LDFLAGS = -L../libopeniscsiusr -lopeniscsiusr -lkmod -lcrypto ++ +LIB = libiscsi.so.0 +TESTS = tests/test_discovery_sendtargets tests/test_discovery_firmware +TESTS += tests/test_login tests/test_logout tests/test_params @@ -139,16 +148,15 @@ index 0000000..462d666 +-include .depend ../usr/.depend diff --git a/libiscsi/libiscsi.c b/libiscsi/libiscsi.c new file mode 100644 -index 0000000..c598aee +index 0000000..3e400a8 --- /dev/null +++ b/libiscsi/libiscsi.c -@@ -0,0 +1,745 @@ +@@ -0,0 +1,620 @@ +/* + * iSCSI Administration library + * + * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved. + * Copyright (C) 2008-2009 Hans de Goede -+ * Copyright (C) 2015 Peter Hatina + * maintained by open-iscsi@googlegroups.com + * + * This program is free software; you can redistribute it and/or modify @@ -618,130 +626,6 @@ index 0000000..c598aee + return rc; +} + -+struct libiscsi_session_array { -+ int cnt; -+ int size; -+ struct libiscsi_session_info *data; -+}; -+ -+static void libiscsi_session_array_init(struct libiscsi_session_array *arr) -+{ -+ arr->cnt = 0; -+ arr->size = 0; -+ arr->data = NULL; -+} -+ -+static int libiscsi_session_array_grow(struct libiscsi_session_array *arr) -+{ -+ if (arr->size == 0) -+ arr->size = 4; -+ else -+ arr->size *= 2; -+ -+ arr->data = (struct libiscsi_session_info *) realloc( -+ arr->data, -+ arr->size * sizeof(struct libiscsi_session_info)); -+ -+ return arr->data ? 0 : 1; -+} -+ -+static int libiscsi_session_array_grow_ondemand(struct libiscsi_session_array *arr) -+{ -+ if (arr->size == arr->cnt) -+ return libiscsi_session_array_grow(arr); -+ return 0; -+} -+ -+static int libiscsi_session_array_resize_precize(struct libiscsi_session_array *arr) -+{ -+ arr->data = (struct libiscsi_session_info *) realloc( -+ arr->data, -+ arr->cnt * sizeof(struct libiscsi_session_info)); -+ arr->size = arr->cnt; -+ -+ return arr->data ? 0 : 1; -+} -+ -+static void copy_session_info_to_libiscsi_session_info( -+ struct libiscsi_session_info *info, -+ struct session_info *s_info) -+{ -+ /* Copy session info to public struct. */ -+ info->sid = s_info->sid; -+ /* Timeouts */ -+ memcpy(&info->tmo, &s_info->tmo, sizeof(struct libiscsi_session_timeout)); -+ /* CHAP authentication information */ -+ memcpy(&info->chap, &s_info->chap, sizeof(struct libiscsi_chap_auth_info)); -+ /* Target information */ -+ strncpy(info->targetname, s_info->targetname, LIBISCSI_VALUE_MAXLEN); -+ strncpy(info->address, s_info->address, NI_MAXHOST); -+ strncpy(info->persistent_address, s_info->persistent_address, NI_MAXHOST); -+ info->tpgt = s_info->tpgt; -+ info->persistent_port = s_info->persistent_port; -+} -+ -+static int get_sessions_helper(void *data, struct session_info *s_info) -+{ -+ struct libiscsi_session_array *arr = (struct libiscsi_session_array *) data; -+ -+ if (libiscsi_session_array_grow_ondemand(arr) != 0) -+ return 1; -+ -+ copy_session_info_to_libiscsi_session_info(&arr->data[arr->cnt++], s_info); -+ -+ return 0; -+} -+ -+int libiscsi_get_session_infos(struct libiscsi_context *context, -+ struct libiscsi_session_info **infos, -+ int *nr_sessions) -+{ -+ int rc = 0; -+ int nr_found = 0; -+ struct libiscsi_session_array arr; -+ -+ if (!context || !infos || !nr_sessions) -+ return 1; -+ -+ libiscsi_session_array_init(&arr); -+ -+ rc = iscsi_sysfs_for_each_session((void *) &arr, &nr_found, -+ get_sessions_helper, 0); -+ if (rc != 0 || nr_found == 0) { -+ strcpy(context->error_str, "No matching session"); -+ return ENODEV; -+ } -+ -+ if (libiscsi_session_array_resize_precize(&arr) != 0) { -+ strcpy(context->error_str, "Can't allocate memory for session infos"); -+ return ENOMEM; -+ } -+ -+ *infos = arr.data; -+ *nr_sessions = nr_found; -+ -+ return 0; -+} -+ -+int libiscsi_get_session_info_by_id(struct libiscsi_context *context, -+ struct libiscsi_session_info *info, -+ const char *session) -+{ -+ struct session_info s_info; -+ -+ if (!context || !info || !session) -+ return 1; -+ -+ if (iscsi_sysfs_get_sessioninfo_by_id(&s_info, (char*) session) != 0) { -+ strcpy(context->error_str, "No matching session"); -+ return ENODEV; -+ } -+ -+ copy_session_info_to_libiscsi_session_info(info, &s_info); -+ -+ return 0; -+} -+ +int libiscsi_node_set_parameter(struct libiscsi_context *context, + const struct libiscsi_node *node, + const char *parameter, const char *value) @@ -2369,16 +2253,15 @@ index 0000000..7a5ff7f +SEARCHENGINE = NO diff --git a/libiscsi/libiscsi.h b/libiscsi/libiscsi.h new file mode 100644 -index 0000000..a9891f4 +index 0000000..756590e --- /dev/null +++ b/libiscsi/libiscsi.h -@@ -0,0 +1,400 @@ +@@ -0,0 +1,344 @@ +/* + * iSCSI Administration library + * + * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved. + * Copyright (C) 2008-2009 Hans de Goede -+ * Copyright (C) 2015 Peter Hatina + * maintained by open-iscsi@googlegroups.com + * + * This program is free software; you can redistribute it and/or modify @@ -2432,17 +2315,6 @@ index 0000000..a9891f4 + */ +struct libiscsi_context; + -+/** \brief iSCSI session timeouts -+ * -+ * Struct holding session timeouts. -+ */ -+struct libiscsi_session_timeout { -+ int abort_tmo; -+ int lu_reset_tmo; -+ int recovery_tmo; -+ int tgt_reset_tmo; -+}; -+ +/** \brief iSCSI node record + * + * Struct holding data uniquely identifying an iSCSI node. @@ -2471,24 +2343,6 @@ index 0000000..a9891f4 + char reverse_password[LIBISCSI_VALUE_MAXLEN] /** Reverse Password */; +}; + -+/** \brief iSCSI session -+ * -+ * Struct hoding iSCSI session information. -+ */ -+struct libiscsi_session_info { -+ int sid; -+ -+ struct libiscsi_session_timeout tmo; -+ struct libiscsi_chap_auth_info chap; -+ -+ char targetname[LIBISCSI_VALUE_MAXLEN]; -+ int tpgt; -+ char address[NI_MAXHOST]; -+ int port; -+ char persistent_address[NI_MAXHOST]; -+ int persistent_port; -+}; -+ +/** \brief generic libiscsi authentication information struct + * + * Struct holding authentication information for discovery and login. @@ -2653,32 +2507,6 @@ index 0000000..a9891f4 +PUBLIC int libiscsi_node_logout(struct libiscsi_context *context, + const struct libiscsi_node *node); + -+/** \brief Get an array of iSCSI sessions. -+ * -+ * Get the array containing iSCSI sessions' information. -+ * -+ * \param context libiscsi context to operate on. -+ * \param infos Array of iSCSI sessions' information. -+ * Release with free(). -+ * \param nr_sessions The number of elements in \e infos. -+ * \return 0 on success, otherwise a standard error code -+ * (from errno.h). -+ */ -+PUBLIC int libiscsi_get_session_infos(struct libiscsi_context *context, -+ struct libiscsi_session_info **infos, int *nr_sessions); -+ -+/** \brief Get session information by session ID. -+ * -+ * \param context libiscsi context to operate on. -+ * \param info iSCSI session information. -+ * \param session Session name. -+ * \return 0 on success, otherwise a standard error code -+ * (from errno.h) -+ */ -+PUBLIC int libiscsi_get_session_info_by_id(struct libiscsi_context *context, -+ struct libiscsi_session_info *info, -+ const char *session); -+ +/** \brief Set an iSCSI parameter for the given node + * + * Set the given nodes iSCSI parameter named by \e parameter to value \e value. @@ -4109,21 +3937,8 @@ index 0000000..a21f888 + + return rc; +} -diff --git a/usr/Makefile b/usr/Makefile -index 84f33bc..16fb5f0 100644 ---- a/usr/Makefile -+++ b/usr/Makefile -@@ -46,7 +46,7 @@ PKG_CONFIG ?= /usr/bin/pkg-config - CFLAGS ?= -O2 -g - WARNFLAGS ?= -Wall -Wextra -Werror -Wstrict-prototypes -fno-common - CFLAGS += $(WARNFLAGS) -I../include -I. -D_GNU_SOURCE \ -- -I$(TOPDIR)/libopeniscsiusr \ -+ -I$(TOPDIR)/libopeniscsiusr -DISNS_ENABLE \ - -DISCSI_VERSION_STR=\"$(ISCSI_VERSION_STR)\" - CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod) - CFLAGS += $(shell $(PKG_CONFIG) --cflags libsystemd) diff --git a/usr/discovery.c b/usr/discovery.c -index 587af6d..7c4f613 100644 +index 792abcf..ed4dc73 100644 --- a/usr/discovery.c +++ b/usr/discovery.c @@ -36,6 +36,7 @@ @@ -4134,39 +3949,11 @@ index 587af6d..7c4f613 100644 #include "log.h" #include "idbm.h" #include "iscsi_settings.h" -@@ -49,10 +50,12 @@ - #include "iface.h" - #include "iscsi_timer.h" - #include "iscsi_err.h" -+#ifdef ISNS_ENABLE - /* libisns includes */ - #include - #include - #include -+#endif - - #ifdef SLP_ENABLE - #include "iscsi-slp-discovery.h" -@@ -98,12 +101,14 @@ static int request_initiator_name(int tmo) - return 0; - } - -+#ifdef ISNS_ENABLE - void discovery_isns_free_servername(void) - { - if (isns_config.ic_server_name) - free(isns_config.ic_server_name); - isns_config.ic_server_name = NULL; - } -+#endif - - int discovery_isns_set_servername(char *address, int port) - { diff --git a/usr/idbm.c b/usr/idbm.c -index 38cf5be..6588e76 100644 +index 32e99bc..b730d1c 100644 --- a/usr/idbm.c +++ b/usr/idbm.c -@@ -1846,9 +1846,9 @@ int idbm_print_all_discovery(int info_level) +@@ -1829,9 +1829,9 @@ int idbm_print_all_discovery(int info_level) * fn should return -1 if it skipped the rec, an ISCSI_ERR error code if * the operation failed or 0 if fn was run successfully. */ @@ -4174,28 +3961,27 @@ index 38cf5be..6588e76 100644 - char *targetname, int tpgt, char *ip, int port, - bool ruw_lock) +int idbm_for_each_iface(int *found, void *data, idbm_iface_op_fn *fn, -+ char *targetname, int tpgt, char *ip, int port, -+ bool ruw_lock) ++ char *targetname, int tpgt, char *ip, int port, ++ bool ruw_lock) { DIR *iface_dirfd; struct dirent *iface_dent; diff --git a/usr/idbm.h b/usr/idbm.h -index f428531..827777e 100644 +index 7b1b271..52428ad 100644 --- a/usr/idbm.h +++ b/usr/idbm.h -@@ -106,6 +106,10 @@ struct rec_op_data { +@@ -102,6 +102,9 @@ struct rec_op_data { node_rec_t *match_rec; idbm_iface_op_fn *fn; }; +extern int idbm_for_each_iface(int *found, void *data, idbm_iface_op_fn *fn, -+ char *targetname, int tpgt, char *ip, int port, -+ bool ruw_lock); -+ ++ char *targetname, int tpgt, char *ip, int port, ++ bool ruw_lock); extern int idbm_for_each_portal(int *found, void *data, idbm_portal_op_fn *fn, char *targetname, bool ruw_lock); extern int idbm_for_each_node(int *found, void *data, diff --git a/usr/iscsi_ipc.h b/usr/iscsi_ipc.h -index 78bd29a..d5c9f14 100644 +index c3c9917..73a8865 100644 --- a/usr/iscsi_ipc.h +++ b/usr/iscsi_ipc.h @@ -175,4 +175,6 @@ struct iscsi_ipc { @@ -4206,5 +3992,5 @@ index 78bd29a..d5c9f14 100644 + #endif /* ISCSI_IPC_H */ -- -2.31.1 +2.40.1 diff --git a/0102-libiscsi-introduce-sessions-API.patch b/0102-libiscsi-introduce-sessions-API.patch new file mode 100644 index 0000000000000000000000000000000000000000..57ab58fa85e4800141b8391d9c218974a2f5bd30 --- /dev/null +++ b/0102-libiscsi-introduce-sessions-API.patch @@ -0,0 +1,290 @@ +From 2c28c620727e522f022689312d76f107eb8ef18f Mon Sep 17 00:00:00 2001 +From: Peter Hatina +Date: Mon, 5 Oct 2015 16:50:36 -0700 +Subject: [PATCH] libiscsi introduce sessions API + +--- + libiscsi/libiscsi.c | 125 ++++++++++++++++++++++++++++++++++++++++++++ + libiscsi/libiscsi.h | 56 ++++++++++++++++++++ + usr/iscsi_sysfs.c | 6 +++ + usr/iscsi_sysfs.h | 2 + + 4 files changed, 189 insertions(+) + +diff --git a/libiscsi/libiscsi.c b/libiscsi/libiscsi.c +index 064e4b5..755c18c 100644 +--- a/libiscsi/libiscsi.c ++++ b/libiscsi/libiscsi.c +@@ -3,6 +3,7 @@ + * + * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved. + * Copyright (C) 2008-2009 Hans de Goede ++ * Copyright (C) 2015 Peter Hatina + * maintained by open-iscsi@googlegroups.com + * + * This program is free software; you can redistribute it and/or modify +@@ -469,6 +470,130 @@ leave: + return rc; + } + ++struct libiscsi_session_array { ++ int cnt; ++ int size; ++ struct libiscsi_session_info *data; ++}; ++ ++static void libiscsi_session_array_init(struct libiscsi_session_array *arr) ++{ ++ arr->cnt = 0; ++ arr->size = 0; ++ arr->data = NULL; ++} ++ ++static int libiscsi_session_array_grow(struct libiscsi_session_array *arr) ++{ ++ if (arr->size == 0) ++ arr->size = 4; ++ else ++ arr->size *= 2; ++ ++ arr->data = (struct libiscsi_session_info *) realloc( ++ arr->data, ++ arr->size * sizeof(struct libiscsi_session_info)); ++ ++ return arr->data ? 0 : 1; ++} ++ ++static int libiscsi_session_array_grow_ondemand(struct libiscsi_session_array *arr) ++{ ++ if (arr->size == arr->cnt) ++ return libiscsi_session_array_grow(arr); ++ return 0; ++} ++ ++static int libiscsi_session_array_resize_precize(struct libiscsi_session_array *arr) ++{ ++ arr->data = (struct libiscsi_session_info *) realloc( ++ arr->data, ++ arr->cnt * sizeof(struct libiscsi_session_info)); ++ arr->size = arr->cnt; ++ ++ return arr->data ? 0 : 1; ++} ++ ++static void copy_session_info_to_libiscsi_session_info( ++ struct libiscsi_session_info *info, ++ struct session_info *s_info) ++{ ++ /* Copy session info to public struct. */ ++ info->sid = s_info->sid; ++ /* Timeouts */ ++ memcpy(&info->tmo, &s_info->tmo, sizeof(struct libiscsi_session_timeout)); ++ /* CHAP authentication information */ ++ memcpy(&info->chap, &s_info->chap, sizeof(struct libiscsi_chap_auth_info)); ++ /* Target information */ ++ strncpy(info->targetname, s_info->targetname, LIBISCSI_VALUE_MAXLEN); ++ strncpy(info->address, s_info->address, NI_MAXHOST); ++ strncpy(info->persistent_address, s_info->persistent_address, NI_MAXHOST); ++ info->tpgt = s_info->tpgt; ++ info->persistent_port = s_info->persistent_port; ++} ++ ++static int get_sessions_helper(void *data, struct session_info *s_info) ++{ ++ struct libiscsi_session_array *arr = (struct libiscsi_session_array *) data; ++ ++ if (libiscsi_session_array_grow_ondemand(arr) != 0) ++ return 1; ++ ++ copy_session_info_to_libiscsi_session_info(&arr->data[arr->cnt++], s_info); ++ ++ return 0; ++} ++ ++int libiscsi_get_session_infos(struct libiscsi_context *context, ++ struct libiscsi_session_info **infos, ++ int *nr_sessions) ++{ ++ int rc = 0; ++ int nr_found = 0; ++ struct libiscsi_session_array arr; ++ ++ if (!context || !infos || !nr_sessions) ++ return 1; ++ ++ libiscsi_session_array_init(&arr); ++ ++ rc = iscsi_sysfs_for_each_session((void *) &arr, &nr_found, ++ get_sessions_helper, 0); ++ if (rc != 0 || nr_found == 0) { ++ strcpy(context->error_str, "No matching session"); ++ return ENODEV; ++ } ++ ++ if (libiscsi_session_array_resize_precize(&arr) != 0) { ++ strcpy(context->error_str, "Can't allocate memory for session infos"); ++ return ENOMEM; ++ } ++ ++ *infos = arr.data; ++ *nr_sessions = nr_found; ++ ++ return 0; ++} ++ ++int libiscsi_get_session_info_by_id(struct libiscsi_context *context, ++ struct libiscsi_session_info *info, ++ const char *session) ++{ ++ struct session_info s_info; ++ ++ if (!context || !info || !session) ++ return 1; ++ ++ if (iscsi_sysfs_get_sessioninfo_by_id(&s_info, (char*) session) != 0) { ++ strcpy(context->error_str, "No matching session"); ++ return ENODEV; ++ } ++ ++ copy_session_info_to_libiscsi_session_info(info, &s_info); ++ ++ return 0; ++} ++ + int libiscsi_node_set_parameter(struct libiscsi_context *context, + const struct libiscsi_node *node, + const char *parameter, const char *value) +diff --git a/libiscsi/libiscsi.h b/libiscsi/libiscsi.h +index 756590e..a9891f4 100644 +--- a/libiscsi/libiscsi.h ++++ b/libiscsi/libiscsi.h +@@ -3,6 +3,7 @@ + * + * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved. + * Copyright (C) 2008-2009 Hans de Goede ++ * Copyright (C) 2015 Peter Hatina + * maintained by open-iscsi@googlegroups.com + * + * This program is free software; you can redistribute it and/or modify +@@ -56,6 +57,17 @@ enum libiscsi_auth_t { + */ + struct libiscsi_context; + ++/** \brief iSCSI session timeouts ++ * ++ * Struct holding session timeouts. ++ */ ++struct libiscsi_session_timeout { ++ int abort_tmo; ++ int lu_reset_tmo; ++ int recovery_tmo; ++ int tgt_reset_tmo; ++}; ++ + /** \brief iSCSI node record + * + * Struct holding data uniquely identifying an iSCSI node. +@@ -84,6 +96,24 @@ struct libiscsi_chap_auth_info { + char reverse_password[LIBISCSI_VALUE_MAXLEN] /** Reverse Password */; + }; + ++/** \brief iSCSI session ++ * ++ * Struct hoding iSCSI session information. ++ */ ++struct libiscsi_session_info { ++ int sid; ++ ++ struct libiscsi_session_timeout tmo; ++ struct libiscsi_chap_auth_info chap; ++ ++ char targetname[LIBISCSI_VALUE_MAXLEN]; ++ int tpgt; ++ char address[NI_MAXHOST]; ++ int port; ++ char persistent_address[NI_MAXHOST]; ++ int persistent_port; ++}; ++ + /** \brief generic libiscsi authentication information struct + * + * Struct holding authentication information for discovery and login. +@@ -248,6 +278,32 @@ PUBLIC int libiscsi_node_login(struct libiscsi_context *context, + PUBLIC int libiscsi_node_logout(struct libiscsi_context *context, + const struct libiscsi_node *node); + ++/** \brief Get an array of iSCSI sessions. ++ * ++ * Get the array containing iSCSI sessions' information. ++ * ++ * \param context libiscsi context to operate on. ++ * \param infos Array of iSCSI sessions' information. ++ * Release with free(). ++ * \param nr_sessions The number of elements in \e infos. ++ * \return 0 on success, otherwise a standard error code ++ * (from errno.h). ++ */ ++PUBLIC int libiscsi_get_session_infos(struct libiscsi_context *context, ++ struct libiscsi_session_info **infos, int *nr_sessions); ++ ++/** \brief Get session information by session ID. ++ * ++ * \param context libiscsi context to operate on. ++ * \param info iSCSI session information. ++ * \param session Session name. ++ * \return 0 on success, otherwise a standard error code ++ * (from errno.h) ++ */ ++PUBLIC int libiscsi_get_session_info_by_id(struct libiscsi_context *context, ++ struct libiscsi_session_info *info, ++ const char *session); ++ + /** \brief Set an iSCSI parameter for the given node + * + * Set the given nodes iSCSI parameter named by \e parameter to value \e value. +diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c +index 435c576..e549afe 100644 +--- a/usr/iscsi_sysfs.c ++++ b/usr/iscsi_sysfs.c +@@ -3,6 +3,7 @@ + * + * Copyright (C) 2006 Mike Christie + * Copyright (C) 2006 Red Hat, Inc. All rights reserved. ++ * Copyright (C) 2015 Peter Hatina + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published +@@ -1151,6 +1152,11 @@ free_info: + return rc; + } + ++const char *iscsi_sysfs_get_session_path(void) ++{ ++ return ISCSI_SESSION_DIR; ++} ++ + int iscsi_sysfs_for_each_iface_on_host(void *data, uint32_t host_no, + int *nr_found, + iscsi_sysfs_iface_op_fn *fn) +diff --git a/usr/iscsi_sysfs.h b/usr/iscsi_sysfs.h +index 1d0377f..909db34 100644 +--- a/usr/iscsi_sysfs.h ++++ b/usr/iscsi_sysfs.h +@@ -3,6 +3,7 @@ + * + * Copyright (C) 2006 Mike Christie + * Copyright (C) 2006 Red Hat, Inc. All rights reserved. ++ * Copyright (C) 2015 Peter Hatina + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published +@@ -47,6 +48,7 @@ typedef int (iscsi_sysfs_flashnode_op_fn)(void *, struct flashnode_rec *, + uint32_t, uint32_t); + typedef int (iscsi_sysfs_iface_op_fn)(void *, struct iface_rec *); + ++extern const char *iscsi_sysfs_get_session_path(void); + extern int iscsi_sysfs_for_each_iface_on_host(void *data, uint32_t host_no, + int *nr_found, + iscsi_sysfs_iface_op_fn *fn); +-- +2.26.2 + diff --git a/0103-fix-libiscsi-firmware-discovery-issue-with-NULL-drec.patch b/0103-fix-libiscsi-firmware-discovery-issue-with-NULL-drec.patch new file mode 100644 index 0000000000000000000000000000000000000000..f58a1b05b3b52998aafc6d874e82ac61c382cc94 --- /dev/null +++ b/0103-fix-libiscsi-firmware-discovery-issue-with-NULL-drec.patch @@ -0,0 +1,40 @@ +From 47dd191ab5c48932df4c0c219fca19fcedba6cd2 Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Thu, 2 Jun 2022 11:37:20 -0700 +Subject: [PATCH 1/1] fix libiscsi firmware discovery issue with NULL drec + argument + +--- + libiscsi/libiscsi.c | 2 +- + usr/idbm.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libiscsi/libiscsi.c b/libiscsi/libiscsi.c +index c598aee..bddf9fc 100644 +--- a/libiscsi/libiscsi.c ++++ b/libiscsi/libiscsi.c +@@ -258,7 +258,7 @@ int libiscsi_discover_firmware(struct libiscsi_context *context, + struct libiscsi_node *new_node = new_nodes; + /* in one loop, add nodes to idbm and create libiscsi_node entries */ + list_for_each_entry(rec, &rec_list, list) { +- CHECK(idbm_add_node(rec, NULL, 1 /* overwrite */)); ++ CHECK(idbm_add_node(rec, &drec, 1 /* overwrite */)); + + strlcpy(new_node->name, rec->name, LIBISCSI_VALUE_MAXLEN); + new_node->tpgt = rec->tpgt; +diff --git a/usr/idbm.c b/usr/idbm.c +index e9025bf..9cc9c40 100644 +--- a/usr/idbm.c ++++ b/usr/idbm.c +@@ -2536,7 +2536,7 @@ int idbm_add_node(node_rec_t *newrec, discovery_rec_t *drec, int overwrite) + if (rc) + goto unlock; + +- if (drec->type == DISCOVERY_TYPE_FW) { ++ if (drec && drec->type == DISCOVERY_TYPE_FW) { + log_debug(8, "setting firmware node 'startup' to 'onboot'"); + newrec->startup = ISCSI_STARTUP_ONBOOT; + newrec->conn[0].startup = ISCSI_STARTUP_ONBOOT; +-- +2.36.1 + diff --git a/0104-libiscsi-build-fixes.patch b/0104-libiscsi-build-fixes.patch new file mode 100644 index 0000000000000000000000000000000000000000..1c4ea9d548c4b95eca15b78a1b18b7888fb2786b --- /dev/null +++ b/0104-libiscsi-build-fixes.patch @@ -0,0 +1,88 @@ +From d6344267de82b7ef38e2834522a8782579b77d42 Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Fri, 30 Jun 2023 22:19:23 +0000 +Subject: [PATCH 104/104] libiscsi build fixes + +--- + Makefile | 4 ++++ + libiscsi/Makefile | 27 +++++++++++++++------------ + 2 files changed, 19 insertions(+), 12 deletions(-) + +diff --git a/Makefile b/Makefile +index a537516..3fe76df 100644 +--- a/Makefile ++++ b/Makefile +@@ -58,6 +58,10 @@ deprecation_msg: + @echo "*** Please see the README file for more information." + @echo "***" + ++.PHONY: libiscsi ++libiscsi: ++ $(MAKE) $(MFLAGS) -C libiscsi ++ + user: deprecation_msg iscsiuio/Makefile + $(MAKE) $(MFLAGS) -C libopeniscsiusr + $(MAKE) $(MFLAGS) -C sysdeps +diff --git a/libiscsi/Makefile b/libiscsi/Makefile +index 7f5d371..9f7b034 100644 +--- a/libiscsi/Makefile ++++ b/libiscsi/Makefile +@@ -5,15 +5,15 @@ ifeq ($(TOPDIR),) + endif + + OSNAME=$(shell uname -s) +-OPTFLAGS ?= -O2 -g +-WARNFLAGS ?= -Wall -Wstrict-prototypes +-CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I../include -I../usr \ +- -D$(OSNAME) -fPIC -D_GNU_SOURCE -fvisibility=hidden \ ++# OPTFLAGS ?= -O2 -g ++# WARNFLAGS ?= -Wall -Wstrict-prototypes ++CFLAGS ?= -O2 -g -Wall ++CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -I../include -I../usr \ ++ -D$(OSNAME) -D_GNU_SOURCE -fvisibility=hidden \ + -I../libopeniscsiusr + +-#CFLAGS ?= -O2 -g + #CFLAGS += -Wall -Werror -Wextra -fvisibility=hidden -fPIC +-CFLAGS += -I../libopeniscsiusr -I../include -I../usr ++#CFLAGS += -I../libopeniscsiusr -I../include -I../usr + #CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod) + CFLAGS += -DSBINDIR=\"$(SBINDIR)\" + CFLAGS += -DISCSI_DB_ROOT=\"$(DBROOT)\" +@@ -39,7 +40,7 @@ USR_OBJS = $(patsubst %.o, usr-objs/%.o, $(ISCSI_LIB_SRCS) local_strings.o) + FW_OBJS = $(patsubst %.o, fw-objs/%.o, $(FW_PARAM_SRCS)) + + # Flags for the tests +-tests/% : CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I. ++tests/% : CFLAGS += -I. + + all: lib tests html + +@@ -48,18 +49,20 @@ tests: $(TESTS) + + common-objs/%.o: ../sysdeps/%.c + mkdir -p common-objs +- $(CC) $(CFLAGS) -c $< -o $@ ++ $(CC) $(CFLAGS) -c $< -o $@ $(LDFLAGS) $(LDLIBS) + + usr-objs/%.o: ../usr/%.c + mkdir -p usr-objs +- $(CC) $(CFLAGS) -c $< -o $@ ++ $(CC) $(CFLAGS) -c $< -o $@ $(LDFLAGS) $(LDLIBS) + + fw-objs/%.o: ../usr/fwparam_ibft/%.c + mkdir -p fw-objs +- $(CC) $(CFLAGS) -c $< -o $@ ++ $(CC) $(CFLAGS) -c $< -o $@ $(LDFLAGS) $(LDLIBS) ++ ++$(LIB): CFLAGS += -fPIC + + $(LIB): $(COMMON_OBJS) $(FW_OBJS) $(USR_OBJS) libiscsi.o +- $(CC) $(CFLAGS) -shared -Wl,-soname,$(LIB) $^ -o $@ -L$(TOPDIR)/libopeniscsiusr -lopeniscsiusr ++ $(CC) $(CFLAGS) -shared -Wl,-soname,$(LIB) $^ -o $@ $(LDFLAGS) $(LDLIBS) + ln -s -f $(LIB) libiscsi.so + + $(TESTS): $(FW_OBJS) $(COMMON_OBJS) $(USR_OBJS) $(LIB) +-- +2.40.1 + diff --git a/1001-add-ISCSI_VERSION_STR-define.patch b/1001-add-ISCSI_VERSION_STR-define.patch deleted file mode 100644 index 3427db4b681f36b5993d3fcbdb31d890d4a7270c..0000000000000000000000000000000000000000 --- a/1001-add-ISCSI_VERSION_STR-define.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 3518aebee85edf2da8df1cbcad1bc0f3588405a5 Mon Sep 17 00:00:00 2001 -From: happy_orange -Date: Fri, 10 Mar 2023 17:27:55 +0800 -Subject: [PATCH 1/1] add ISCSI_VERSION_STR define - ---- - usr/version.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/usr/version.h b/usr/version.h -index f8be671..328d650 100644 ---- a/usr/version.h -+++ b/usr/version.h -@@ -9,7 +9,7 @@ - * Version string should be set by the build system, else we have problems - */ - #ifndef ISCSI_VERSION_STR --#error Must set ISCSI_VERSION_STR -+#define ISCSI_VERSION_STR "2.1.8" - #endif - #define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version" - --- -2.31.1 - diff --git a/1002-fix-the-libiscsi-build-error.patch b/1002-fix-the-libiscsi-build-error.patch deleted file mode 100644 index 12925dba0910d467e0b166f0ead2c9b9b8ba5019..0000000000000000000000000000000000000000 --- a/1002-fix-the-libiscsi-build-error.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 152ac0d58d3f2915b6b9af98fb2ed47aeede9972 Mon Sep 17 00:00:00 2001 -From: happy_orange -Date: Tue, 14 Mar 2023 20:16:29 +0800 -Subject: [PATCH 1/1] fix the libiscsi build error - ---- - libiscsi/Makefile | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/libiscsi/Makefile b/libiscsi/Makefile -index f28a62d..e0df9f0 100644 ---- a/libiscsi/Makefile -+++ b/libiscsi/Makefile -@@ -4,11 +4,18 @@ ifeq ($(TOPDIR),) - TOPDIR = .. - endif - -+#ifndef ISCSI_DB_ROOT -+#define ISCSI_DB_ROOT "/var/lib/iscsi" -+#endif -+ -+ISCSI_VERSION_STR ?= 2.1.8 - OSNAME=$(shell uname -s) - OPTFLAGS ?= -O2 -g - WARNFLAGS ?= -Wall -Wstrict-prototypes - CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I../include -I../usr \ -- -D$(OSNAME) -fPIC -D_GNU_SOURCE -fvisibility=hidden \ -+ -D$(OSNAME) -fPIC -D_GNU_SOURCE -DISNS_ENABLE \ -+ -fvisibility=hidden -DISCSI_VERSION_STR=\"$(ISCSI_VERSION_STR)\"\ -+ -DSBINDIR=\"/sbin\" -DISCSI_DB_ROOT=\"$(ISCSI_DB_ROOT)\" \ - -I../libopeniscsiusr - LDFLAGS = -L../libopeniscsiusr -lopeniscsiusr -lkmod -lcrypto - LIB = libiscsi.so.0 --- -2.31.1 - diff --git a/1003-change-the-sbin-dir-to-usr-sbin.patch b/1003-change-the-sbin-dir-to-usr-sbin.patch deleted file mode 100644 index 2ab79418e0decffb1aa4f86d9386e076e1572c7a..0000000000000000000000000000000000000000 --- a/1003-change-the-sbin-dir-to-usr-sbin.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 6b04c754f0fa06c88c7248705c5b7cc8cfe75b69 Mon Sep 17 00:00:00 2001 -From: happy_orange -Date: Tue, 14 Mar 2023 20:26:32 +0800 -Subject: [PATCH 1/1] change the sbin dir to usr/sbin - ---- - Makefile | 2 +- - libopeniscsiusr/Makefile | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Makefile b/Makefile -index dad878f..62181f6 100644 ---- a/Makefile -+++ b/Makefile -@@ -10,7 +10,7 @@ DESTDIR ?= - ISCSI_VERSION_STR ?= 2.1.8 - - prefix = /usr --exec_prefix = -+exec_prefix = $(prefix) - mandir = $(prefix)/share/man - etcdir = /etc - -diff --git a/libopeniscsiusr/Makefile b/libopeniscsiusr/Makefile -index 0d215fc..0318396 100644 ---- a/libopeniscsiusr/Makefile -+++ b/libopeniscsiusr/Makefile -@@ -11,7 +11,7 @@ endif - DESTDIR ?= - prefix ?= /usr - INSTALL ?= install --exec_prefix = -+exec_prefix = $(prefix) - etcdir = /etc - SBINDIR ?= $(exec_prefix)/sbin - DBROOT ?= $(etcdir)/iscsi --- -2.31.1 - diff --git a/2.1.8.tar.gz b/2.1.8.tar.gz deleted file mode 100644 index b2f8a4028597203290aedd527fb7d2f99752b964..0000000000000000000000000000000000000000 Binary files a/2.1.8.tar.gz and /dev/null differ diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec index fda8e2a2cf463bc02ffeedfbeb9b3cc3f46a5254..1cf5a807881db0b1b3e474503c22275365936944 100644 --- a/iscsi-initiator-utils.spec +++ b/iscsi-initiator-utils.spec @@ -1,44 +1,50 @@ -%define anolis_release 3 +%define anolis_release 1 %global _hardened_build 1 %global __provides_exclude_from ^(%{python3_sitearch}/.*\\.so)$ +%global commit a65a472a35b436c7a2d47c5862aae530ac4ae9c8 +%global git_hash a65a472 Name: iscsi-initiator-utils -Version: 2.1.8 -Release: %{anolis_release}%{?dist} +Version: 6.2.1.9 +Release: %{anolis_release}.git%{git_hash}%{?dist} Summary: iSCSI daemon and utility programs License: GPLv2+ URL: https://github.com/open-iscsi/open-iscsi -Source0: https://github.com/open-iscsi/open-iscsi/archive/refs/tags/%{version}.tar.gz +Source0: https://github.com/open-iscsi/open-iscsi/archive/%{commit}.tar.gz#/open-iscsi-%{git_hash}.tar.gz Source1: 04-iscsi Source2: iscsi-tmpfiles.conf -Patch0001: 0001-unit-file-tweaks.patch -Patch0002: 0002-idmb_rec_write-check-for-tpgt-first.patch -Patch0003: 0003-idbm_rec_write-seperate-old-and-new-style-writes.patch -Patch0004: 0004-idbw_rec_write-pick-tpgt-from-existing-record.patch -Patch0005: 0005-update-initscripts-and-docs.patch -Patch0006: 0006-use-var-for-config.patch -Patch0007: 0007-libiscsi.patch -Patch0008: 0008-libiscsi-introduce-sessions-API.patch -Patch0009: 0009-remove-the-offload-boot-supported-ifdef.patch -Patch0010: 0010-Revert-iscsiadm-return-error-when-login-fails.patch -Patch0011: 0011-use-var-lib-iscsi-in-libopeniscsiusr.patch -Patch0012: 0012-Coverity-scan-fixes.patch -Patch0013: 0013-iscsi_if.h-replace-zero-length-array-with-flexible-a.patch -Patch0014: 0014-minor-service-file-updates.patch -Patch0015: 0015-try-not-to-require-network-online.patch -Patch0016: 0016-add-some-service-in-system.patch - -Patch1001: 1001-add-ISCSI_VERSION_STR-define.patch -Patch1002: 1002-fix-the-libiscsi-build-error.patch -Patch1003: 1003-change-the-sbin-dir-to-usr-sbin.patch +Patch0001: 0001-meson-don-t-hide-things-with-Wno-all.patch + +# https://github.com/open-iscsi/open-iscsi/pull/394/ +Patch0002: 0002-Currently-when-iscsi.service-is-installed-it-creates.patch +Patch0003: 0003-Use-DBROOT-in-iscsi-starter.-Include-iscsi-starter-i.patch +Patch0004: 0004-fix-systemctl-path-in-iscsi-starter.service.patch + +# Fedora / Red Hat stuff, merge more of this upstream? +Patch0005: 0005-improved-onboot-and-shutdown-services.patch +Patch0006: 0006-iscsid.conf-Fedora-Red-Hat-defaults.patch +Patch0007: 0007-Disable-Data-Digests.patch +Patch0008: 0008-Revert-iscsiadm-return-error-when-login-fails.patch +Patch0009: 0009-Coverity-scan-fixes.patch +Patch0010: 0010-use-Red-Hat-version-string-to-match-RPM-package-vers.patch + +# libiscsi, deprecated but still needed until UDisks2 is converted to libopeniscsiusr +Patch0101: 0101-libiscsi.patch +Patch0102: 0102-libiscsi-introduce-sessions-API.patch +Patch0103: 0103-fix-libiscsi-firmware-discovery-issue-with-NULL-drec.patch +Patch0104: 0104-libiscsi-build-fixes.patch BuildRequires: autoconf automake BuildRequires: flex bison doxygen kmod-devel libtool systemd-units BuildRequires: isns-utils-devel systemd-devel libmount-devel openssl-devel BuildRequires: python3-rpm-macros +BuildRequires: meson git Requires: %{name}-iscsiuio >= %{EVR} +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd Conflicts: NetworkManager < 1.20 @@ -50,7 +56,7 @@ Protocol networks. %package iscsiuio Summary: Userspace configuration daemon required for some iSCSI hardware -License: BSD +License: BSD-4-Clause Requires: %{name} = %{EVR} %description iscsiuio @@ -75,40 +81,22 @@ The %{name}-python3 package contains Python %{python3_version} bindings to the libiscsi interface for interacting with %{name} %prep -%autosetup -n open-iscsi-%{version} -p1 -%{__sed} -i -e 's|^exec_prefix = /$|exec_prefix = %{_exec_prefix}|' Makefile +%autosetup -n open-iscsi-%{commit} -p1 %build # avoid undefined references linking failures %undefine _ld_as_needed -cd iscsiuio -autoreconf --install -%{configure} -cd - -make OPTFLAGS="%{optflags} %{?__global_ldflags}" - +%meson -Diqn_prefix=iqn.1994-05.com.anolis +%meson_build +%make_build LDFLAGS="%{build_ldflags}" iqn_prefix=iqn.1994-05.com.anolis DBROOT=/var/lib/iscsi libiscsi cd libiscsi %py3_build touch -r libiscsi.doxy html/* cd - %install -make DESTDIR=%{?buildroot} LIB_DIR=%{_libdir} \ - install_programs \ - install_doc \ - install_etc \ - install_libopeniscsiusr - -rm %{buildroot}%{_mandir}/man8/iscsi_discovery.8 -rm %{buildroot}%{_mandir}/man8/iscsi_fw_login.8 -install -pm 755 usr/iscsistart %{buildroot}%{_sbindir} -install -pm 755 iscsiuio/src/unix/iscsiuio %{buildroot}%{_sbindir} -install -pm 644 doc/iscsistart.8 %{buildroot}%{_mandir}/man8 -install -pm 644 doc/iscsi-iname.8 %{buildroot}%{_mandir}/man8 -install -pm 644 iscsiuio/docs/iscsiuio.8 %{buildroot}%{_mandir}/man8 -install -d %{buildroot}%{_sysconfdir}/logrotate.d -install -pm 644 iscsiuio/iscsiuiolog %{buildroot}%{_sysconfdir}/logrotate.d +%meson_install install -d %{buildroot}%{_sharedstatedir}/iscsi install -d %{buildroot}%{_sharedstatedir}/iscsi/nodes @@ -120,16 +108,20 @@ install -d %{buildroot}%{_sharedstatedir}/iscsi/ifaces install -d %{buildroot}%{_rundir}/lock/iscsi touch %{buildroot}%{_rundir}/lock/iscsi/lock -install -d %{buildroot}%{_unitdir} -install -pm 644 etc/systemd/iscsi.service %{buildroot}%{_unitdir} -install -pm 644 etc/systemd/iscsi-starter.service %{buildroot}%{_unitdir} -install -pm 644 etc/systemd/iscsi-init.service %{buildroot}%{_unitdir} -install -pm 644 etc/systemd/iscsi-onboot.service %{buildroot}%{_unitdir} -install -pm 644 etc/systemd/iscsi-shutdown.service %{buildroot}%{_unitdir} -install -pm 644 etc/systemd/iscsid.service %{buildroot}%{_unitdir} -install -pm 644 etc/systemd/iscsid.socket %{buildroot}%{_unitdir} -install -pm 644 etc/systemd/iscsiuio.service %{buildroot}%{_unitdir} -install -pm 644 etc/systemd/iscsiuio.socket %{buildroot}%{_unitdir} +# upstream started installing a bunch of optional stuff from other distros +# maybe we can make use of these, but clean up for now +rm %{buildroot}/etc/iscsi/initiatorname.iscsi +rm %{buildroot}/etc/udev/rules.d/50-iscsi-firmware-login.rules +rm %{buildroot}/usr/lib/systemd/system-generators/ibft-rule-generator +rm %{buildroot}/usr/sbin/brcm_iscsiuio +rm %{buildroot}/usr/sbin/iscsi-gen-initiatorname +rm %{buildroot}/usr/sbin/iscsi_discovery +rm %{buildroot}/usr/sbin/iscsi_fw_login +rm %{buildroot}/usr/sbin/iscsi_offload +rm %{buildroot}/usr/share/man/man8/iscsi-gen-initiatorname.8 +rm %{buildroot}/usr/share/man/man8/iscsi_discovery.8 +rm %{buildroot}/usr/share/man/man8/iscsi_fw_login.8 +rm %{buildroot}/var/lib/iscsi/ifaces/iface.example install -d %{buildroot}%{_libexecdir} install -pm 755 etc/systemd/iscsi-mark-root-nodes %{buildroot}%{_libexecdir} @@ -146,11 +138,6 @@ ln -s libiscsi.so.0 %{buildroot}%{_libdir}/libiscsi.so install -d %{buildroot}%{_includedir} install -pm 644 libiscsi/libiscsi.h %{buildroot}%{_includedir} -mkdir -p %{buildroot}/%{_udevrulesdir} -mv %{buildroot}/%{_sysconfdir}/udev/rules.d/50-iscsi-firmware-login.rules %{buildroot}/%{_udevrulesdir}/50-iscsi-firmware-login.rules -rm -rf %{buildroot}/%{_sysconfdir}/udev - -install -d %{buildroot}%{python3_sitearch} pushd libiscsi %py3_install popd @@ -175,7 +162,7 @@ popd %postun iscsiuio %systemd_postun iscsiuio.service iscsiuio.socket -%triggerun -- iscsi-initiator-utils < 2.1.4 +%triggerun -- iscsi-initiator-utils < 6.2.1.4 systemctl --no-reload preset iscsi.service iscsi-starter.service &>/dev/null || : %files @@ -204,10 +191,6 @@ systemctl --no-reload preset iscsi.service iscsi-starter.service &>/dev/null || %{_sbindir}/iscsiadm %{_sbindir}/iscsid %{_sbindir}/iscsistart -%{_sbindir}/iscsi-gen-initiatorname -%{_sbindir}/iscsi_discovery -%{_sbindir}/iscsi_fw_login -%{_sbindir}/iscsi_offload %{_libdir}/libiscsi.so.0 %{_libdir}/libopeniscsiusr.so.* @@ -216,17 +199,13 @@ systemctl --no-reload preset iscsi.service iscsi-starter.service &>/dev/null || %{abidir}/iscsiadm-option.list %{abidir}/iscsid-option.list %{abidir}/iscsistart-option.list -%{abidir}/iscsi-gen-initiatorname-option.list %{abidir}/libopeniscsiusr.dump %{abidir}/libiscsi.dump -%{_mandir}/man3/*.zst %{_mandir}/man8/iscsi-iname.8*.zst %{_mandir}/man8/iscsiadm.8*.zst %{_mandir}/man8/iscsid.8*.zst %{_mandir}/man8/iscsistart.8*.zst -%{_mandir}/man8/iscsi-gen-initiatorname.8*.zst -%{_udevrulesdir}/50-iscsi-firmware-login.rules %doc README %files iscsiuio @@ -254,6 +233,15 @@ systemctl --no-reload preset iscsi.service iscsi-starter.service &>/dev/null || %{abidir}/libiscsi.cpython-%{python3_version_nodots}-%{_arch}-linux-gnu.dump %changelog +* Wed Feb 19 2025 Xiaoping Liu - 6.2.1.9-1.gita65a472 +- update to 6.2.1.9 from 6.2.1.8 +- switch to build using meson +- Migrated to SPDX license +- Remove the patch because the changes already exist upstream +- Add patches to fix some configuration options + [Patches cherry-picked from c10s. Original changelog: + - iscsiuio threading fixes. (6.2.1.9-18.gita65a472)] + * Tue Mar 12 2024 Bo Ren - 2.1.8-3 - Rebuild with python3.11 diff --git a/open-iscsi-a65a472.tar.gz b/open-iscsi-a65a472.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2421255ca5df2c893b43cfe1fcfcf69561e2070c Binary files /dev/null and b/open-iscsi-a65a472.tar.gz differ