summaryrefslogtreecommitdiff
path: root/sys-block/open-iscsi/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-06-02 21:45:28 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-06-02 21:45:28 +0100
commit2018227e9344edb9da15fc6a4a8298086cc2aa77 (patch)
treec18e1c09e605e94e2a1e93345ad25746cc9e14b9 /sys-block/open-iscsi/files
parent6f8038813c460b4f0572d5ef595cdfa94af3a94d (diff)
gentoo resync : 02.06.2019
Diffstat (limited to 'sys-block/open-iscsi/files')
-rw-r--r--sys-block/open-iscsi/files/open-iscsi-2.0.877-optional_systemd.patch87
-rw-r--r--sys-block/open-iscsi/files/open-iscsi-2.0.877-pkgconfig.patch84
2 files changed, 171 insertions, 0 deletions
diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.877-optional_systemd.patch b/sys-block/open-iscsi/files/open-iscsi-2.0.877-optional_systemd.patch
new file mode 100644
index 000000000000..b1f1a8f1d078
--- /dev/null
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.877-optional_systemd.patch
@@ -0,0 +1,87 @@
+From f66608aa9ce989c91f744bb2f3f34d2e01aedc87 Mon Sep 17 00:00:00 2001
+From: Lee Duncan <lduncan@suse.com>
+Date: Tue, 14 May 2019 13:11:34 -0700
+Subject: [PATCH] Make iscsid systemd usage optional
+
+You can compile without system now by using something
+like:
+
+ make OPTFLAGS="-DNO_SYSTEMD ..." NO_SYSTEMD=1
+
+This will skip systemd code for iscsid and iscsiuio.
+---
+ Makefile | 5 +++++
+ usr/Makefile | 2 ++
+ usr/iscsid.c | 6 ++++++
+ 3 files changed, 13 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index c941740c..9a337741 100644
+--- a/Makefile
++++ b/Makefile
+@@ -40,6 +40,11 @@ ifneq (,$(CFLAGS))
+ export CFLAGS
+ endif
+
++# export systemd disablement if set
++ifneq ($(NO_SYSTEMD),)
++export NO_SYSTEMD
++endif
++
+ # Random comments:
+ # using '$(MAKE)' instead of just 'make' allows make to run in parallel
+ # over multiple makefile.
+diff --git a/usr/Makefile b/usr/Makefile
+index f1c35aa7..0203127c 100644
+--- a/usr/Makefile
++++ b/usr/Makefile
+@@ -41,7 +41,9 @@ CFLAGS += $(WARNFLAGS) -I../include -I. -D_GNU_SOURCE \
+ CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod)
+ ISCSI_LIB = -L$(TOPDIR)/libopeniscsiusr -lopeniscsiusr
+ LDFLAGS += $(shell $(PKG_CONFIG) --libs libkmod)
++ifeq ($(NO_SYSTEMD),)
+ LDFLAGS += $(shell $(PKG_CONFIG) --libs libsystemd)
++endif
+ PROGRAMS = iscsid iscsiadm iscsistart
+
+ # libc compat files
+diff --git a/usr/iscsid.c b/usr/iscsid.c
+index 0c984409..37c13b39 100644
+--- a/usr/iscsid.c
++++ b/usr/iscsid.c
+@@ -34,7 +34,9 @@
+ #include <sys/wait.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#ifndef NO_SYSTEMD
+ #include <systemd/sd-daemon.h>
++#endif
+
+ #include "iscsid.h"
+ #include "mgmt_ipc.h"
+@@ -339,6 +341,7 @@ static void missing_iname_warn(char *initiatorname_file)
+ /* called right before we enter the event loop */
+ static void set_state_to_ready(void)
+ {
++#ifndef NO_SYSTEMD
+ if (sessions_to_recover)
+ sd_notify(0, "READY=1\n"
+ "RELOADING=1\n"
+@@ -346,14 +349,17 @@ static void set_state_to_ready(void)
+ else
+ sd_notify(0, "READY=1\n"
+ "STATUS=Ready to process requests\n");
++#endif
+ }
+
+ /* called when recovery process has been reaped */
+ static void set_state_done_reloading(void)
+ {
++#ifndef NO_SYSTEMD
+ sessions_to_recover = 0;
+ sd_notifyf(0, "READY=1\n"
+ "STATUS=Ready to process requests\n");
++#endif
+ }
+
+ int main(int argc, char *argv[])
diff --git a/sys-block/open-iscsi/files/open-iscsi-2.0.877-pkgconfig.patch b/sys-block/open-iscsi/files/open-iscsi-2.0.877-pkgconfig.patch
new file mode 100644
index 000000000000..1756196e6b33
--- /dev/null
+++ b/sys-block/open-iscsi/files/open-iscsi-2.0.877-pkgconfig.patch
@@ -0,0 +1,84 @@
+From 623a81123c494f5c69dc6616bd72e838862e2f1f Mon Sep 17 00:00:00 2001
+From: Lee Duncan <lduncan@suse.com>
+Date: Mon, 12 Nov 2018 13:10:04 -0800
+Subject: [PATCH] Use pkg-config in Makefiles for newer libraries.
+
+These two recently-added libraries can be in different
+locations on different distros, so use pkg-config to
+added the appropriate actions in the make files.
+---
+ libopeniscsiusr/Makefile | 8 +++++++-
+ usr/Makefile | 11 ++++++++---
+ 2 files changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/libopeniscsiusr/Makefile b/libopeniscsiusr/Makefile
+index bf7c96c7..a045a459 100644
+--- a/libopeniscsiusr/Makefile
++++ b/libopeniscsiusr/Makefile
+@@ -23,6 +23,8 @@ endif
+ INCLUDE_DIR ?= $(prefix)/include
+ PKGCONF_DIR ?= $(LIB_DIR)/pkgconfig
+
++PKG_CONFIG = /usr/bin/pkg-config
++
+ LIBISCSI_USR_DIR=$(TOPDIR)/libopeniscsiusr
+
+ LIBISCSI_USR_VERSION_MAJOR=0
+@@ -43,13 +45,17 @@ OBJS = context.o misc.o session.o sysfs.o iface.o idbm.o node.o default.o
+
+ CFLAGS ?= -O2 -g
+ CFLAGS += -Wall -Werror -Wextra -fvisibility=hidden -fPIC
++CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod)
++
++LDFLAGS += $(shell $(PKG_CONFIG) --libs libkmod)
+
+ LIBADD =
+
+ all: $(LIBS) $(LIBS_MAJOR) $(TESTS) doc
+
+ $(LIBS): $(OBJS)
+- $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname=$@ -o $@ $(OBJS) $(LIBADD)
++ @echo CFLAGS= $(CFLAGS)
++ $(CC) $(CFLAGS) -shared -Wl,-soname=$@ -o $@ $(OBJS) $(LDFLAGS) $(LIBADD)
+ ln -sf $@ $(DEVLIB)
+
+ $(LIBS_MAJOR): $(LIBS)
+diff --git a/usr/Makefile b/usr/Makefile
+index f9445ada..f1c35aa7 100644
+--- a/usr/Makefile
++++ b/usr/Makefile
+@@ -32,11 +32,16 @@ IPC_OBJ=ioctl.o
+ endif
+ endif
+
++PKG_CONFIG = /usr/bin/pkg-config
++
+ CFLAGS ?= -O2 -g
+ WARNFLAGS ?= -Wall -Wstrict-prototypes
+ CFLAGS += $(WARNFLAGS) -I../include -I. -D_GNU_SOURCE \
+ -I$(TOPDIR)/libopeniscsiusr
++CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod)
+ ISCSI_LIB = -L$(TOPDIR)/libopeniscsiusr -lopeniscsiusr
++LDFLAGS += $(shell $(PKG_CONFIG) --libs libkmod)
++LDFLAGS += $(shell $(PKG_CONFIG) --libs libsystemd)
+ PROGRAMS = iscsid iscsiadm iscsistart
+
+ # libc compat files
+@@ -60,14 +65,14 @@ all: $(PROGRAMS)
+
+ iscsid: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \
+ iscsid.o session_mgmt.o discoveryd.o mntcheck.o
+- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns -lcrypto -lrt -lmount $(ISCSI_LIB)
++ $(CC) $(CFLAGS) $^ -o $@ -lisns -lcrypto -lrt -lmount $(LDFLAGS) $(ISCSI_LIB)
+
+ iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o mntcheck.o
+- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns -lcrypto -lmount $(ISCSI_LIB)
++ $(CC) $(CFLAGS) $^ -o $@ -lisns -lcrypto -lmount $(LDFLAGS) $(ISCSI_LIB)
+
+ iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
+ iscsistart.o statics.o
+- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lrt $(ISCSI_LIB)
++ $(CC) $(CFLAGS) $^ -o $@ -lrt $(LDFLAGS) $(ISCSI_LIB)
+ clean:
+ rm -f *.o $(PROGRAMS) .depend $(LIBSYS)
+