summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-Fix-i586-build-issues-with-string-length-overflow.patch115
-rw-r--r--meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-Make-iscsid-systemd-usage-optional.patch88
-rw-r--r--meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-Use-pkg-config-in-Makefiles-for-newer-libraries.patch92
-rw-r--r--meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.878.bb (renamed from meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.877.bb)9
4 files changed, 5 insertions, 299 deletions
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-Fix-i586-build-issues-with-string-length-overflow.patch b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-Fix-i586-build-issues-with-string-length-overflow.patch
deleted file mode 100644
index f945c636f7..0000000000
--- a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-Fix-i586-build-issues-with-string-length-overflow.patch
+++ /dev/null
@@ -1,115 +0,0 @@
1From 24ce8f62e042e69497e1299212504c356179e15b Mon Sep 17 00:00:00 2001
2From: Lee Duncan <lduncan@suse.com>
3Date: Tue, 6 Nov 2018 11:16:06 -0800
4Subject: [PATCH] Fix i586 build issues with string length overflow.
5
6Gcc7 warns of possible string print overflow, on i586,
7when printing password length (via a macro), generating
8errors like:
9
10[ 59s] ^~~~~~~~~~~~~~~~~~~~
11[ 59s] In file included from /usr/include/stdio.h:862:0,
12[ 59s] from idbm.h:27,
13[ 59s] from context.h:22,
14[ 59s] from idbm.c:59:
15[ 59s] /usr/include/bits/stdio2.h:64:10: note:
16'__builtin___snprintf_chk' output between 2 and 11 bytes into a
17destination of size 8
18[ 59s] return __builtin___snprintf_chk (__s, __n,
19__USE_FORTIFY_LEVEL - 1,
20[ 59s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21~~~~~~~~~~
22[ 59s] __bos (__s), __fmt, __va_arg_pack ());
23[ 59s] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24[ 59s] cc1: all warnings being treated as errors
25[ 59s] make[1]: *** [<builtin>: idbm.o] Error 1
26[ 59s] make[1]: Leaving directory
27
28The fix is to limit the size of the string printed, so that no
29overflow is possible.
30
31The print macros in usr/idbm.c were updated, as well, to match
32the newer version in libopeniscsiusr/idbm.c, also to help the
33i586 build.
34
35Upstream-Status: Backport[https://github.com/open-iscsi/open-iscsi/commit/24ce8f62e042e69497e1299212504c356179e15b]
36
37Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
38---
39 libopeniscsiusr/idbm.c | 2 +-
40 usr/idbm.c | 11 ++++++-----
41 2 files changed, 7 insertions(+), 6 deletions(-)
42
43diff --git a/libopeniscsiusr/idbm.c b/libopeniscsiusr/idbm.c
44index 7724de2..055dd9a 100644
45--- a/libopeniscsiusr/idbm.c
46+++ b/libopeniscsiusr/idbm.c
47@@ -676,7 +676,7 @@ updated:
48 if (!passwd_done && !strcmp(#_param, name)) { \
49 passwd_done = 1; \
50 name = #_param "_length"; \
51- snprintf(passwd_len, 8, "%d", (int)strlen(value)); \
52+ snprintf(passwd_len, 8, "%.7d", (int)strlen(value) & 0xffff); \
53 value = passwd_len; \
54 goto setup_passwd_len; \
55 }
56diff --git a/usr/idbm.c b/usr/idbm.c
57index a0207e2..89a6c27 100644
58--- a/usr/idbm.c
59+++ b/usr/idbm.c
60@@ -30,6 +30,7 @@
61 #include <fcntl.h>
62 #include <sys/stat.h>
63 #include <sys/file.h>
64+#include <inttypes.h>
65
66 #include "idbm.h"
67 #include "idbm_fields.h"
68@@ -65,7 +66,7 @@ static struct idbm *db;
69 #define __recinfo_int(_key, _info, _rec, _name, _show, _n, _mod) do { \
70 _info[_n].type = TYPE_INT; \
71 strlcpy(_info[_n].name, _key, NAME_MAXVAL); \
72- snprintf(_info[_n].value, VALUE_MAXVAL, "%d", _rec->_name); \
73+ snprintf(_info[_n].value, VALUE_MAXVAL, "%" PRIi32, _rec->_name); \
74 _info[_n].data = &_rec->_name; \
75 _info[_n].data_len = sizeof(_rec->_name); \
76 _info[_n].visible = _show; \
77@@ -76,7 +77,7 @@ static struct idbm *db;
78 #define __recinfo_uint8(_key, _info, _rec, _name, _show, _n, _mod) do { \
79 _info[_n].type = TYPE_UINT8; \
80 strlcpy(_info[_n].name, _key, NAME_MAXVAL); \
81- snprintf(_info[_n].value, VALUE_MAXVAL, "%d", _rec->_name); \
82+ snprintf(_info[_n].value, VALUE_MAXVAL, "%" PRIu8, _rec->_name); \
83 _info[_n].data = &_rec->_name; \
84 _info[_n].data_len = sizeof(_rec->_name); \
85 _info[_n].visible = _show; \
86@@ -87,7 +88,7 @@ static struct idbm *db;
87 #define __recinfo_uint16(_key, _info, _rec, _name, _show, _n, _mod) do { \
88 _info[_n].type = TYPE_UINT16; \
89 strlcpy(_info[_n].name, _key, NAME_MAXVAL); \
90- snprintf(_info[_n].value, VALUE_MAXVAL, "%d", _rec->_name); \
91+ snprintf(_info[_n].value, VALUE_MAXVAL, "%" PRIu16, _rec->_name); \
92 _info[_n].data = &_rec->_name; \
93 _info[_n].data_len = sizeof(_rec->_name); \
94 _info[_n].visible = _show; \
95@@ -98,7 +99,7 @@ static struct idbm *db;
96 #define __recinfo_uint32(_key, _info, _rec, _name, _show, _n, _mod) do { \
97 _info[_n].type = TYPE_UINT32; \
98 strlcpy(_info[_n].name, _key, NAME_MAXVAL); \
99- snprintf(_info[_n].value, VALUE_MAXVAL, "%d", _rec->_name); \
100+ snprintf(_info[_n].value, VALUE_MAXVAL, "%" PRIu32, _rec->_name); \
101 _info[_n].data = &_rec->_name; \
102 _info[_n].data_len = sizeof(_rec->_name); \
103 _info[_n].visible = _show; \
104@@ -1041,7 +1042,7 @@ updated:
105 if (!passwd_done && !strcmp(#_param, name)) { \
106 passwd_done = 1; \
107 name = #_param "_length"; \
108- snprintf(passwd_len, 8, "%d", (int)strlen(value)); \
109+ snprintf(passwd_len, 8, "%.7" PRIi32, (int)strlen(value) & 0xffff); \
110 value = passwd_len; \
111 goto setup_passwd_len; \
112 }
113--
1142.7.4
115
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-Make-iscsid-systemd-usage-optional.patch b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-Make-iscsid-systemd-usage-optional.patch
deleted file mode 100644
index 08248d3584..0000000000
--- a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-Make-iscsid-systemd-usage-optional.patch
+++ /dev/null
@@ -1,88 +0,0 @@
1From 365efb2fd3062065af4b6eb3dc1661b96557dae8 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Wed, 21 Aug 2019 16:37:53 +0800
4Subject: [PATCH] Make iscsid systemd usage optional
5
6Upstream-Status: Backport[https://github.com/open-iscsi/open-iscsi
7/commit/f71581bd641dc26d330cb8b97e5ec272dd08f811]
8
9Signed-off-by: Changqing Li <changqing.li@windriver.com>
10---
11 Makefile | 5 +++++
12 usr/Makefile | 2 ++
13 usr/iscsid.c | 6 ++++++
14 3 files changed, 13 insertions(+)
15
16diff --git a/Makefile b/Makefile
17index c533e9d..1ef0921 100644
18--- a/Makefile
19+++ b/Makefile
20@@ -39,6 +39,11 @@ ifneq (,$(CFLAGS))
21 export CFLAGS
22 endif
23
24+# export systemd disablement if set
25+ifneq ($(NO_SYSTEMD),)
26+export NO_SYSTEMD
27+endif
28+
29 # Random comments:
30 # using '$(MAKE)' instead of just 'make' allows make to run in parallel
31 # over multiple makefile.
32diff --git a/usr/Makefile b/usr/Makefile
33index f9445ad..0203127 100644
34--- a/usr/Makefile
35+++ b/usr/Makefile
36@@ -41,7 +41,9 @@ CFLAGS += $(WARNFLAGS) -I../include -I. -D_GNU_SOURCE \
37 CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod)
38 ISCSI_LIB = -L$(TOPDIR)/libopeniscsiusr -lopeniscsiusr
39 LDFLAGS += $(shell $(PKG_CONFIG) --libs libkmod)
40+ifneq ($(NO_SYSTEMD),)
41 LDFLAGS += $(shell $(PKG_CONFIG) --libs libsystemd)
42+endif
43 PROGRAMS = iscsid iscsiadm iscsistart
44
45 # libc compat files
46diff --git a/usr/iscsid.c b/usr/iscsid.c
47index 0c98440..164325e 100644
48--- a/usr/iscsid.c
49+++ b/usr/iscsid.c
50@@ -34,7 +34,9 @@
51 #include <sys/wait.h>
52 #include <sys/types.h>
53 #include <sys/stat.h>
54+#ifndef NO_SYSTEMD
55 #include <systemd/sd-daemon.h>
56+#endif
57
58 #include "iscsid.h"
59 #include "mgmt_ipc.h"
60@@ -339,6 +341,7 @@ static void missing_iname_warn(char *initiatorname_file)
61 /* called right before we enter the event loop */
62 static void set_state_to_ready(void)
63 {
64+#ifndef NO_SYSTEMD
65 if (sessions_to_recover)
66 sd_notify(0, "READY=1\n"
67 "RELOADING=1\n"
68@@ -346,14 +349,17 @@ static void set_state_to_ready(void)
69 else
70 sd_notify(0, "READY=1\n"
71 "STATUS=Ready to process requests\n");
72+#endif
73 }
74
75 /* called when recovery process has been reaped */
76 static void set_state_done_reloading(void)
77 {
78+#ifndef NO_SYSTEMD
79 sessions_to_recover = 0;
80 sd_notifyf(0, "READY=1\n"
81 "STATUS=Ready to process requests\n");
82+#endif
83 }
84
85 int main(int argc, char *argv[])
86--
872.7.4
88
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-Use-pkg-config-in-Makefiles-for-newer-libraries.patch b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-Use-pkg-config-in-Makefiles-for-newer-libraries.patch
deleted file mode 100644
index 37b764e854..0000000000
--- a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-Use-pkg-config-in-Makefiles-for-newer-libraries.patch
+++ /dev/null
@@ -1,92 +0,0 @@
1From e9b49664e969fd5cad1abef7b8b59e1fb8d02a47 Mon Sep 17 00:00:00 2001
2From: Lee Duncan <lduncan@suse.com>
3Date: Mon, 12 Nov 2018 13:10:04 -0800
4Subject: [PATCH] Use pkg-config in Makefiles for newer libraries.
5
6These two recently-added libraries can be in different
7locations on different distros, so use pkg-config to
8added the appropriate actions in the make files.
9
10Upstream-Status: Backport[https://github.com/open-iscsi/open-iscsi/commit/
11623a81123c494f5c69dc6616bd72e838862e2f1f#diff-c4bf6688222ad28c9719cfaf88c16329]
12
13Signed-off-by: Changqing Li <changqing.li@windriver.com>
14---
15 libopeniscsiusr/Makefile | 8 +++++++-
16 usr/Makefile | 11 ++++++++---
17 2 files changed, 15 insertions(+), 4 deletions(-)
18
19diff --git a/libopeniscsiusr/Makefile b/libopeniscsiusr/Makefile
20index bf7c96c..a045a45 100644
21--- a/libopeniscsiusr/Makefile
22+++ b/libopeniscsiusr/Makefile
23@@ -23,6 +23,8 @@ endif
24 INCLUDE_DIR ?= $(prefix)/include
25 PKGCONF_DIR ?= $(LIB_DIR)/pkgconfig
26
27+PKG_CONFIG = /usr/bin/pkg-config
28+
29 LIBISCSI_USR_DIR=$(TOPDIR)/libopeniscsiusr
30
31 LIBISCSI_USR_VERSION_MAJOR=0
32@@ -43,13 +45,17 @@ OBJS = context.o misc.o session.o sysfs.o iface.o idbm.o node.o default.o
33
34 CFLAGS ?= -O2 -g
35 CFLAGS += -Wall -Werror -Wextra -fvisibility=hidden -fPIC
36+CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod)
37+
38+LDFLAGS += $(shell $(PKG_CONFIG) --libs libkmod)
39
40 LIBADD =
41
42 all: $(LIBS) $(LIBS_MAJOR) $(TESTS) doc
43
44 $(LIBS): $(OBJS)
45- $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname=$@ -o $@ $(OBJS) $(LIBADD)
46+ @echo CFLAGS= $(CFLAGS)
47+ $(CC) $(CFLAGS) -shared -Wl,-soname=$@ -o $@ $(OBJS) $(LDFLAGS) $(LIBADD)
48 ln -sf $@ $(DEVLIB)
49
50 $(LIBS_MAJOR): $(LIBS)
51diff --git a/usr/Makefile b/usr/Makefile
52index f9445ad..f1c35aa 100644
53--- a/usr/Makefile
54+++ b/usr/Makefile
55@@ -32,11 +32,16 @@ IPC_OBJ=ioctl.o
56 endif
57 endif
58
59+PKG_CONFIG = /usr/bin/pkg-config
60+
61 CFLAGS ?= -O2 -g
62 WARNFLAGS ?= -Wall -Wstrict-prototypes
63 CFLAGS += $(WARNFLAGS) -I../include -I. -D_GNU_SOURCE \
64 -I$(TOPDIR)/libopeniscsiusr
65+CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod)
66 ISCSI_LIB = -L$(TOPDIR)/libopeniscsiusr -lopeniscsiusr
67+LDFLAGS += $(shell $(PKG_CONFIG) --libs libkmod)
68+LDFLAGS += $(shell $(PKG_CONFIG) --libs libsystemd)
69 PROGRAMS = iscsid iscsiadm iscsistart
70
71 # libc compat files
72@@ -60,14 +65,14 @@ all: $(PROGRAMS)
73
74 iscsid: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \
75 iscsid.o session_mgmt.o discoveryd.o mntcheck.o
76- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns -lcrypto -lrt -lmount $(ISCSI_LIB)
77+ $(CC) $(CFLAGS) $^ -o $@ -lisns -lcrypto -lrt -lmount $(LDFLAGS) $(ISCSI_LIB)
78
79 iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o mntcheck.o
80- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns -lcrypto -lmount $(ISCSI_LIB)
81+ $(CC) $(CFLAGS) $^ -o $@ -lisns -lcrypto -lmount $(LDFLAGS) $(ISCSI_LIB)
82
83 iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
84 iscsistart.o statics.o
85- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lrt $(ISCSI_LIB)
86+ $(CC) $(CFLAGS) $^ -o $@ -lrt $(LDFLAGS) $(ISCSI_LIB)
87 clean:
88 rm -f *.o $(PROGRAMS) .depend $(LIBSYS)
89
90--
912.7.4
92
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.877.bb b/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.878.bb
index 3cef70f5e0..b75e54b9cc 100644
--- a/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.877.bb
+++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.878.bb
@@ -8,21 +8,19 @@ HOMEPAGE = "http://www.open-iscsi.com/"
8LICENSE = "GPLv2 & LGPLv2.1" 8LICENSE = "GPLv2 & LGPLv2.1"
9SECTION = "net" 9SECTION = "net"
10DEPENDS = "openssl flex-native bison-native open-isns util-linux kmod" 10DEPENDS = "openssl flex-native bison-native open-isns util-linux kmod"
11DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
11 12
12LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" 13LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
13 14
14SRCREV ?= "120ac127654c4644d46a74799fffe527ab1f4f42" 15SRCREV ?= "288add22d6b61cc68ede358faeec9affb15019cd"
15 16
16SRC_URI = "git://github.com/open-iscsi/open-iscsi \ 17SRC_URI = "git://github.com/open-iscsi/open-iscsi \
17 file://0001-Fix-i586-build-issues-with-string-length-overflow.patch \
18 file://initd.debian \ 18 file://initd.debian \
19 file://99_iscsi-initiator-utils \ 19 file://99_iscsi-initiator-utils \
20 file://iscsi-initiator \ 20 file://iscsi-initiator \
21 file://iscsi-initiator.service \ 21 file://iscsi-initiator.service \
22 file://iscsi-initiator-targets.service \ 22 file://iscsi-initiator-targets.service \
23 file://set_initiatorname \ 23 file://set_initiatorname \
24 file://0001-Use-pkg-config-in-Makefiles-for-newer-libraries.patch \
25 file://0001-Make-iscsid-systemd-usage-optional.patch \
26 " 24 "
27S = "${WORKDIR}/git" 25S = "${WORKDIR}/git"
28B = "${WORKDIR}/build" 26B = "${WORKDIR}/build"
@@ -36,6 +34,8 @@ EXTRA_OECONF = " \
36 --host=${BUILD_SYS} \ 34 --host=${BUILD_SYS} \
37" 35"
38 36
37EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', '--without-systemd', d)}"
38
39EXTRA_OEMAKE = ' \ 39EXTRA_OEMAKE = ' \
40 OS="${TARGET_SYS}" \ 40 OS="${TARGET_SYS}" \
41 TARGET="${TARGET_OS}" \ 41 TARGET="${TARGET_OS}" \
@@ -46,6 +46,7 @@ EXTRA_OEMAKE = ' \
46 NO_SYSTEMD=1 \ 46 NO_SYSTEMD=1 \
47' 47'
48 48
49
49do_configure () { 50do_configure () {
50 cd ${S}/iscsiuio ; autoreconf --install; ./configure ${EXTRA_OECONF} 51 cd ${S}/iscsiuio ; autoreconf --install; ./configure ${EXTRA_OECONF}
51} 52}