aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-extended
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-extended')
-rw-r--r--meta-networking/recipes-extended/corosync/corosync/corosync.conf61
-rw-r--r--meta-networking/recipes-extended/corosync/corosync_2.4.3.bb79
-rw-r--r--meta-networking/recipes-extended/corosync/corosync_3.1.6.bb63
-rw-r--r--meta-networking/recipes-extended/dlm/dlm/0001-Disable-annobin-plugin.patch31
-rw-r--r--meta-networking/recipes-extended/dlm/dlm/0001-Include-sys-sysmacros.h-for-major-minor-macros-in-gl.patch41
-rw-r--r--meta-networking/recipes-extended/dlm/dlm/0001-Remove-fcf-protection-full.patch64
-rw-r--r--meta-networking/recipes-extended/dlm/dlm/0001-dlm_controld-remove-unnecessary-header-include.patch35
-rw-r--r--meta-networking/recipes-extended/dlm/dlm/0001-make-Replace-cp-a-with-mode-preserving-options.patch51
-rw-r--r--meta-networking/recipes-extended/dlm/dlm/respect-ldflags-also-from-bin_ldflags.patch36
-rw-r--r--meta-networking/recipes-extended/dlm/dlm_4.0.2.bb51
-rw-r--r--meta-networking/recipes-extended/dlm/dlm_4.2.0.bb65
-rw-r--r--meta-networking/recipes-extended/iscsitarget/files/0001-kernel-event-netlink_ack-now-requires-4-arguments.patch40
-rw-r--r--meta-networking/recipes-extended/iscsitarget/files/access-sk_v6_daddr-iff-IPV6-defined.patch28
-rw-r--r--meta-networking/recipes-extended/iscsitarget/files/build_with_updated_bio_struct_of_linux_v4.3_and_above.patch108
-rw-r--r--meta-networking/recipes-extended/iscsitarget/files/build_with_updated_interfaces_of_linux_v4.8_and_above.patch475
-rw-r--r--meta-networking/recipes-extended/iscsitarget/files/fix-call-trace-of-ahash-API-calling.patch85
-rw-r--r--meta-networking/recipes-extended/iscsitarget/files/fix-errors-observed-with-linux-3.19-and-greater.patch327
-rw-r--r--meta-networking/recipes-extended/iscsitarget/files/use-kernel-makefile-to-get-kernel-version.patch67
-rw-r--r--meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb62
-rw-r--r--meta-networking/recipes-extended/kronosnet/kronosnet/0001-links.c-Fix-build-with-gcc-12.patch40
-rw-r--r--meta-networking/recipes-extended/kronosnet/kronosnet_1.24.bb32
-rw-r--r--meta-networking/recipes-extended/tgt/files/0001-Correct-the-path-of-header-files-check-in-Yocto-buil.patch47
-rw-r--r--meta-networking/recipes-extended/tgt/files/0001-usr-Makefile-WARNING-fix.patch29
-rw-r--r--meta-networking/recipes-extended/tgt/files/musl-__wordsize.patch41
-rw-r--r--meta-networking/recipes-extended/tgt/files/tgtd5
-rw-r--r--meta-networking/recipes-extended/tgt/files/tgtd.init116
-rwxr-xr-xmeta-networking/recipes-extended/tgt/files/tgtd.service33
-rw-r--r--meta-networking/recipes-extended/tgt/files/usr-Makefile-apply-LDFLAGS-to-all-executables.patch37
-rw-r--r--meta-networking/recipes-extended/tgt/tgt_1.0.90.bb93
29 files changed, 884 insertions, 1358 deletions
diff --git a/meta-networking/recipes-extended/corosync/corosync/corosync.conf b/meta-networking/recipes-extended/corosync/corosync/corosync.conf
new file mode 100644
index 0000000000..744a30ff55
--- /dev/null
+++ b/meta-networking/recipes-extended/corosync/corosync/corosync.conf
@@ -0,0 +1,61 @@
+# Please read the corosync.conf.5 manual page
+totem {
+ version: 2
+
+ # Set name of the cluster
+ cluster_name: testCluster
+
+ # crypto_cipher and crypto_hash: Used for mutual node authentication.
+ # If you choose to enable this, then do remember to create a shared
+ # secret with "corosync-keygen".
+ # enabling crypto_cipher, requires also enabling of crypto_hash.
+ # crypto works only with knet transport
+ crypto_cipher: none
+ crypto_hash: none
+}
+
+logging {
+ # Log the source file and line where messages are being
+ # generated. When in doubt, leave off. Potentially useful for
+ # debugging.
+ fileline: off
+ # Log to standard error. When in doubt, set to yes. Useful when
+ # running in the foreground (when invoking "corosync -f")
+ to_stderr: yes
+ # Log to a log file. When set to "no", the "logfile" option
+ # must not be set.
+ to_logfile: yes
+ logfile: /var/log/cluster/corosync.log
+ # Log to the system log daemon. When in doubt, set to yes.
+ to_syslog: yes
+ # Log debug messages (very verbose). When in doubt, leave off.
+ debug: off
+ # Log messages with time stamps. When in doubt, set to hires (or on)
+ #timestamp: hires
+ logger_subsys {
+ subsys: QUORUM
+ debug: off
+ }
+}
+
+quorum {
+ # Enable and configure quorum subsystem (default: off)
+ # see also corosync.conf.5 and votequorum.5
+ provider: corosync_votequorum
+}
+
+nodelist {
+ # Change/uncomment/add node sections to match cluster configuration
+
+ node {
+ # Hostname of the node
+ name: node1
+ # Cluster membership node identifier
+ nodeid: 1
+ # Address of first link
+ ring0_addr: 127.0.0.1
+ # When knet transport is used it's possible to define up to 8 links
+ #ring1_addr: 192.168.1.1
+ }
+ # ...
+}
diff --git a/meta-networking/recipes-extended/corosync/corosync_2.4.3.bb b/meta-networking/recipes-extended/corosync/corosync_2.4.3.bb
deleted file mode 100644
index 9673fa362e..0000000000
--- a/meta-networking/recipes-extended/corosync/corosync_2.4.3.bb
+++ /dev/null
@@ -1,79 +0,0 @@
-SUMMARY = "The Corosync Cluster Engine and Application Programming Interfaces"
-DESCRIPTION = "This package contains the Corosync Cluster Engine Executive, several default \
-APIs and libraries, default configuration files, and an init script."
-HOMEPAGE = "http://corosync.github.io/corosync/"
-
-SECTION = "base"
-
-inherit autotools pkgconfig systemd useradd
-
-SRC_URI = "http://build.clusterlabs.org/corosync/releases/${BP}.tar.gz"
-
-SRC_URI[md5sum] = "bf0ede13018aadc8a046183bc593b0e0"
-SRC_URI[sha256sum] = "b1e7e422e8d2f7af8e5315fa329b1dbd1175fff32efaa55e8054584c80a2c597"
-
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=a85eb4ce24033adb6088dd1d6ffc5e5d"
-
-DEPENDS = "groff-native nss libqb"
-
-SYSTEMD_SERVICE_${PN} = "corosync.service corosync-notifyd.service \
- ${@bb.utils.contains('PACKAGECONFIG', 'qdevice', 'corosync-qdevice.service', '', d)} \
- ${@bb.utils.contains('PACKAGECONFIG', 'qnetd', 'corosync-qnetd.service', '', d)} \
-"
-SYSTEMD_AUTO_ENABLE = "disable"
-
-INITSCRIPT_NAME = "corosync-daemon"
-
-PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
- dbus qdevice qnetd snmp \
-"
-
-PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
-PACKAGECONFIG[qdevice] = "--enable-qdevices,--disable-qdevices"
-PACKAGECONFIG[qnetd] = "--enable-qnetd,--disable-qnetd"
-PACKAGECONFIG[rdma] = "--enable-rdma,--disable-rdma"
-PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp"
-PACKAGECONFIG[systemd] = "--enable-systemd --with-systemddir=${systemd_system_unitdir},--disable-systemd --without-systemddir,systemd"
-
-EXTRA_OECONF = "ac_cv_path_BASHPATH=${base_bindir}/bash ap_cv_cc_pie=no"
-EXTRA_OEMAKE = "tmpfilesdir_DATA="
-
-do_configure_prepend() {
- ( cd ${S}
- ${S}/autogen.sh )
-}
-
-do_install_append() {
- install -d ${D}${sysconfdir}/sysconfig/
- install -m 0644 ${S}/init/corosync.sysconfig.example ${D}${sysconfdir}/sysconfig/corosync
- install -m 0644 ${S}/tools/corosync-notifyd.sysconfig.example ${D}${sysconfdir}/sysconfig/corosync-notifyd
-
- rm -rf "${D}${localstatedir}/run"
-
- install -d ${D}${sysconfdir}/default/volatiles
- echo "d root root 0755 ${localstatedir}/log/cluster none" > ${D}${sysconfdir}/default/volatiles/05_corosync
-
- if [ ${@bb.utils.filter('PACKAGECONFIG', 'qnetd', d)} ]; then
- chown -R coroqnetd:coroqnetd ${D}${sysconfdir}/${BPN}/qnetd
- echo "d coroqnetd coroqnetd 0770 /var/run/corosync-qnetd none" >> ${D}${sysconfdir}/default/volatiles/05_corosync
- fi
-
- if [ ${@bb.utils.filter('DISTRO_FEATURES','systemd',d)} ]; then
- install -d ${D}${sysconfdir}/tmpfiles.d
- echo "d ${localstatedir}/log/cluster - - - -" > ${D}${sysconfdir}/tmpfiles.d/corosync.conf
-
- if [ ${@bb.utils.filter('PACKAGECONFIG', 'qnetd', d)} ]; then
- install -m 0644 ${S}/conf/tmpfiles.d/corosync-qnetd.conf ${D}${sysconfdir}/tmpfiles.d
- fi
- fi
-}
-
-RDEPENDS_${PN} += "bash ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit-pidof', 'procps', d)}"
-
-FILES_${PN}-dbg += "${libexecdir}/lcrso/.debug"
-FILES_${PN}-doc += "${datadir}/snmp/mibs/COROSYNC-MIB.txt"
-
-USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "--system coroqnetd"
-USERADD_PARAM_${PN} = "--system -d / -M -s /bin/nologin -c 'User for corosync-qnetd' -g coroqnetd coroqnetd"
diff --git a/meta-networking/recipes-extended/corosync/corosync_3.1.6.bb b/meta-networking/recipes-extended/corosync/corosync_3.1.6.bb
new file mode 100644
index 0000000000..cbbbbc70cd
--- /dev/null
+++ b/meta-networking/recipes-extended/corosync/corosync_3.1.6.bb
@@ -0,0 +1,63 @@
+SUMMARY = "The Corosync Cluster Engine and Application Programming Interfaces"
+DESCRIPTION = "This package contains the Corosync Cluster Engine Executive, several default \
+APIs and libraries, default configuration files, and an init script."
+HOMEPAGE = "http://corosync.github.io/corosync/"
+
+SECTION = "base"
+
+inherit autotools pkgconfig systemd
+
+SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BP}.tar.gz \
+ file://corosync.conf \
+ "
+SRC_URI[sha256sum] = "ca6ed32b4d7f33ed614afce8760fe58d0de92c68b575d4969ebacd892f3d1e27"
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+\.(?!99)\d+(\.\d+)+)"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a85eb4ce24033adb6088dd1d6ffc5e5d"
+
+DEPENDS = "groff-native nss libqb kronosnet"
+
+SYSTEMD_SERVICE:${PN} = "corosync.service corosync-notifyd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+INITSCRIPT_NAME = "corosync-daemon"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
+ dbus snmp \
+"
+
+PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
+PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp"
+PACKAGECONFIG[systemd] = "--enable-systemd --with-systemddir=${systemd_system_unitdir},--disable-systemd --without-systemddir,systemd"
+
+EXTRA_OECONF = "ac_cv_path_BASHPATH=${base_bindir}/bash ap_cv_cc_pie=no"
+EXTRA_OEMAKE = "tmpfilesdir_DATA="
+
+#do_configure:prepend() {
+# ( cd ${S}
+# ${S}/autogen.sh )
+#}
+
+do_install:append() {
+ install -D -m 0644 ${UNPACKDIR}/corosync.conf ${D}${sysconfdir}/corosync/corosync.conf.example
+ install -d ${D}${sysconfdir}/sysconfig/
+ install -m 0644 ${S}/init/corosync.sysconfig.example ${D}${sysconfdir}/sysconfig/corosync
+ install -m 0644 ${S}/tools/corosync-notifyd.sysconfig.example ${D}${sysconfdir}/sysconfig/corosync-notifyd
+
+ rmdir ${D}${localstatedir}/log/cluster ${D}${localstatedir}/log
+ rmdir --ignore-fail-on-non-empty ${D}${localstatedir}
+
+ install -d ${D}${sysconfdir}/default/volatiles
+ echo "d root root 0755 ${localstatedir}/log/cluster none" > ${D}${sysconfdir}/default/volatiles/05_corosync
+
+ if [ ${@bb.utils.filter('DISTRO_FEATURES','systemd',d)} ]; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d ${localstatedir}/log/cluster - - - -" > ${D}${sysconfdir}/tmpfiles.d/corosync.conf
+ fi
+}
+
+RDEPENDS:${PN} += "bash ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit-pidof', 'procps', d)}"
+
+FILES:${PN}-dbg += "${libexecdir}/lcrso/.debug"
+FILES:${PN}-doc += "${datadir}/snmp/mibs/COROSYNC-MIB.txt"
diff --git a/meta-networking/recipes-extended/dlm/dlm/0001-Disable-annobin-plugin.patch b/meta-networking/recipes-extended/dlm/dlm/0001-Disable-annobin-plugin.patch
new file mode 100644
index 0000000000..6302829267
--- /dev/null
+++ b/meta-networking/recipes-extended/dlm/dlm/0001-Disable-annobin-plugin.patch
@@ -0,0 +1,31 @@
+From 5a0799d0bacc0cf93e15febdac7d8c50b21e7234 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 15 Jul 2023 13:13:12 -0700
+Subject: [PATCH] Disable annobin plugin
+
+OE gcc does not build this plugin, moreover there are non gcc compilers
+which can be used with OE as well e.g. clang which might not have it
+either
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ dlm_controld/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dlm_controld/Makefile b/dlm_controld/Makefile
+index 8802d88..0380ec9 100644
+--- a/dlm_controld/Makefile
++++ b/dlm_controld/Makefile
+@@ -47,7 +47,7 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
+
+ BIN_CFLAGS += $(CFLAGS) -fPIE -DPIE
+ BIN_CFLAGS += -I../include -I../libdlm
+-LIB_CFLAGS += $(CFLAGS) -fPIC -fplugin=annobin
++LIB_CFLAGS += $(CFLAGS) -fPIC
+
+ BIN_LDFLAGS += $(LDFLAGS) -Wl,-z,relro -Wl,-z,now -pie
+ BIN_LDFLAGS += -lpthread -lrt -lcpg -lcmap -lcfg -lquorum -luuid
+--
+2.41.0
+
diff --git a/meta-networking/recipes-extended/dlm/dlm/0001-Include-sys-sysmacros.h-for-major-minor-macros-in-gl.patch b/meta-networking/recipes-extended/dlm/dlm/0001-Include-sys-sysmacros.h-for-major-minor-macros-in-gl.patch
new file mode 100644
index 0000000000..6f9a0a45a3
--- /dev/null
+++ b/meta-networking/recipes-extended/dlm/dlm/0001-Include-sys-sysmacros.h-for-major-minor-macros-in-gl.patch
@@ -0,0 +1,41 @@
+From a55ab8a07770296bf6a622df14f2f0445be16327 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 19 Aug 2018 15:58:49 -0700
+Subject: [PATCH] Include sys/sysmacros.h for major/minor macros in glibc 2.25+
+
+sys/sysmacros.h was included though sys/types.h until 2.28
+glibc release removed it therefore it must be included
+explicitly now.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ dlm_controld/action.c | 2 ++
+ libdlm/libdlm.c | 1 +
+ 2 files changed, 3 insertions(+)
+
+diff --git a/dlm_controld/action.c b/dlm_controld/action.c
+index 84637f1..2b8ad6c 100644
+--- a/dlm_controld/action.c
++++ b/dlm_controld/action.c
+@@ -8,6 +8,8 @@
+
+ #include "dlm_daemon.h"
+
++#include <sys/sysmacros.h>
++
+ #include <corosync/corotypes.h>
+ #include <corosync/cmap.h>
+
+diff --git a/libdlm/libdlm.c b/libdlm/libdlm.c
+index a9e6195..499eb6a 100644
+--- a/libdlm/libdlm.c
++++ b/libdlm/libdlm.c
+@@ -14,6 +14,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include <inttypes.h>
diff --git a/meta-networking/recipes-extended/dlm/dlm/0001-Remove-fcf-protection-full.patch b/meta-networking/recipes-extended/dlm/dlm/0001-Remove-fcf-protection-full.patch
new file mode 100644
index 0000000000..6290aa4c7a
--- /dev/null
+++ b/meta-networking/recipes-extended/dlm/dlm/0001-Remove-fcf-protection-full.patch
@@ -0,0 +1,64 @@
+From e4ae70ae71f88d48cf1ab63810c9f7b4177af3a5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 15 Jul 2023 19:05:54 -0700
+Subject: [PATCH] Remove -fcf-protection=full
+
+This option is not available on all architectures e.g. RISC-V
+Fixes
+| cc1: error: '-fcf-protection=full' is not supported for this target
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ dlm_controld/Makefile | 1 -
+ dlm_tool/Makefile | 1 -
+ fence/Makefile | 1 -
+ libdlm/Makefile | 4 ++--
+ 4 files changed, 2 insertions(+), 5 deletions(-)
+
+--- a/dlm_controld/Makefile
++++ b/dlm_controld/Makefile
+@@ -43,7 +43,7 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
+ -Wno-sign-compare -Wno-unused-parameter -Wp,-D_FORTIFY_SOURCE=2 \
+ -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option \
+ -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong \
+- -fstack-clash-protection -fcf-protection=full
++ -fstack-clash-protection
+
+ BIN_CFLAGS += $(CFLAGS) -fPIE -DPIE
+ BIN_CFLAGS += -I../include -I../libdlm
+--- a/dlm_tool/Makefile
++++ b/dlm_tool/Makefile
+@@ -15,7 +15,7 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
+ -Wno-sign-compare -Wno-unused-parameter -Wp,-D_FORTIFY_SOURCE=2 \
+ -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option \
+ -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong \
+- -fstack-clash-protection -fcf-protection=full
++ -fstack-clash-protection
+
+ CFLAGS += -fPIE -DPIE
+ CFLAGS += -I../include -I../libdlm -I../dlm_controld
+--- a/fence/Makefile
++++ b/fence/Makefile
+@@ -15,7 +15,7 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
+ -Wno-sign-compare -Wno-unused-parameter -Wp,-D_FORTIFY_SOURCE=2 \
+ -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option \
+ -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong \
+- -fstack-clash-protection -fcf-protection=full
++ -fstack-clash-protection
+
+ CFLAGS += -fPIE -DPIE
+ CFLAGS += -I../include
+--- a/libdlm/Makefile
++++ b/libdlm/Makefile
+@@ -80,8 +80,8 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
+ -fdiagnostics-show-option \
+ -fPIC
+
+-LIB_CFLAGS += $(CFLAGS) -D_REENTRANT -fcf-protection=full
+-LLT_CFLAGS += $(CFLAGS) -fcf-protection=full
++LIB_CFLAGS += $(CFLAGS) -D_REENTRANT
++LLT_CFLAGS += $(CFLAGS)
+
+ LIB_LDFLAGS += $(LDFLAGS) -lpthread -Wl,-z,now
+ LLT_LDFLAGS += $(LDFLAGS) -Wl,-z,now
diff --git a/meta-networking/recipes-extended/dlm/dlm/0001-dlm_controld-remove-unnecessary-header-include.patch b/meta-networking/recipes-extended/dlm/dlm/0001-dlm_controld-remove-unnecessary-header-include.patch
new file mode 100644
index 0000000000..55efcea184
--- /dev/null
+++ b/meta-networking/recipes-extended/dlm/dlm/0001-dlm_controld-remove-unnecessary-header-include.patch
@@ -0,0 +1,35 @@
+From 4c40289eb9e47cfd272a8cc402fd2ddb29e2a3dc Mon Sep 17 00:00:00 2001
+From: Alexander Aring <aahringo@redhat.com>
+Date: Wed, 24 May 2023 13:50:59 +0000
+Subject: [PATCH] dlm_controld: remove unnecessary header include
+
+The timewarn netlink functionality got dropped and will be removed by
+kernel v6.4. The user space part was already dropped by commit 34ea31e7
+("controld: remove timewarn handling"). This is just a left over of this
+commit. Recent builds fails now because the UAPI header in the Linux
+kernel was removed. This means older dlm sources cannot be build with
+newer kernel-headers, however it is not recommended to use older dlm
+sources and all existing users should upgrade anyway.
+
+Upstream-Status: Backport [https://pagure.io/dlm/c/ddbba6608896f81bfce8f8edf3d0f507714cfc43?branch=main]
+Reported-by: Fabio M. Di Nitto <fdinitto@redhat.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ dlm_controld/main.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/dlm_controld/main.c b/dlm_controld/main.c
+index 7cf6348..e70e96a 100644
+--- a/dlm_controld/main.c
++++ b/dlm_controld/main.c
+@@ -12,7 +12,6 @@
+ #include <pthread.h>
+ #include <linux/netlink.h>
+ #include <linux/genetlink.h>
+-#include <linux/dlm_netlink.h>
+ #include <uuid/uuid.h>
+
+ #ifdef USE_SD_NOTIFY
+--
+2.41.0
+
diff --git a/meta-networking/recipes-extended/dlm/dlm/0001-make-Replace-cp-a-with-mode-preserving-options.patch b/meta-networking/recipes-extended/dlm/dlm/0001-make-Replace-cp-a-with-mode-preserving-options.patch
new file mode 100644
index 0000000000..e6a37579ed
--- /dev/null
+++ b/meta-networking/recipes-extended/dlm/dlm/0001-make-Replace-cp-a-with-mode-preserving-options.patch
@@ -0,0 +1,51 @@
+From 2f72f9271b8dd61ca5092e025b0f8243c6fd68f2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 3 Mar 2020 12:38:19 -0800
+Subject: [PATCH] make: Replace cp -a with mode preserving options
+
+Helps fix permissions in staging area
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ dlm_controld/Makefile | 4 ++--
+ libdlm/Makefile | 8 ++++----
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/dlm_controld/Makefile b/dlm_controld/Makefile
+index 6081cf8..fe71be2 100644
+--- a/dlm_controld/Makefile
++++ b/dlm_controld/Makefile
+@@ -88,8 +88,8 @@ install: all
+ $(INSTALL) -d $(DESTDIR)/$(PKGDIR)
+ $(INSTALL) -m 755 $(BIN_TARGET) $(DESTDIR)/$(BINDIR)
+ $(INSTALL) -m 755 $(LIB_TARGET) $(DESTDIR)/$(LIBDIR)
+- cp -a $(LIB_SO) $(DESTDIR)/$(LIBDIR)
+- cp -a $(LIB_SMAJOR) $(DESTDIR)/$(LIBDIR)
++ cp -R --no-dereference --preserve=mode,links $(LIB_SO) $(DESTDIR)/$(LIBDIR)
++ cp -R --no-dereference --preserve=mode,links $(LIB_SMAJOR) $(DESTDIR)/$(LIBDIR)
+ $(INSTALL) -m 644 $(LIB_PC) $(DESTDIR)/$(PKGDIR)
+ $(INSTALL) -m 644 libdlmcontrol.h $(DESTDIR)/$(HDRDIR)
+ $(INSTALL) -m 644 dlm_controld.8 $(DESTDIR)/$(MANDIR)/man8/
+diff --git a/libdlm/Makefile b/libdlm/Makefile
+index ab32761..8820bf8 100644
+--- a/libdlm/Makefile
++++ b/libdlm/Makefile
+@@ -125,10 +125,10 @@ install: all
+ $(INSTALL) -d $(DESTDIR)/$(UDEVDIR)
+ $(INSTALL) -c -m 755 $(LIB_TARGET) $(DESTDIR)/$(LIBDIR)
+ $(INSTALL) -c -m 755 $(LLT_TARGET) $(DESTDIR)/$(LIBDIR)
+- cp -a $(LIB_SO) $(DESTDIR)/$(LIBDIR)
+- cp -a $(LIB_SMAJOR) $(DESTDIR)/$(LIBDIR)
+- cp -a $(LLT_SO) $(DESTDIR)/$(LIBDIR)
+- cp -a $(LLT_SMAJOR) $(DESTDIR)/$(LIBDIR)
++ cp -R --no-dereference --preserve=mode,links $(LIB_SO) $(DESTDIR)/$(LIBDIR)
++ cp -R --no-dereference --preserve=mode,links $(LIB_SMAJOR) $(DESTDIR)/$(LIBDIR)
++ cp -R --no-dereference --preserve=mode,links $(LLT_SO) $(DESTDIR)/$(LIBDIR)
++ cp -R --no-dereference --preserve=mode,links $(LLT_SMAJOR) $(DESTDIR)/$(LIBDIR)
+ $(INSTALL) -m 644 $(LIB_PC) $(DESTDIR)/$(PKGDIR)
+ $(INSTALL) -m 644 $(LLT_PC) $(DESTDIR)/$(PKGDIR)
+ $(INSTALL) -c -m 644 $(HDR_TARGET) $(DESTDIR)/$(HDRDIR)
+--
+2.25.1
+
diff --git a/meta-networking/recipes-extended/dlm/dlm/respect-ldflags-also-from-bin_ldflags.patch b/meta-networking/recipes-extended/dlm/dlm/respect-ldflags-also-from-bin_ldflags.patch
deleted file mode 100644
index 69b2f903c3..0000000000
--- a/meta-networking/recipes-extended/dlm/dlm/respect-ldflags-also-from-bin_ldflags.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff -uNr dlm-4.0.2.orig/dlm_controld/Makefile dlm-4.0.2/dlm_controld/Makefile
---- dlm-4.0.2.orig/dlm_controld/Makefile 2017-04-04 10:49:23.661320260 +0200
-+++ dlm-4.0.2/dlm_controld/Makefile 2017-04-04 10:50:36.121326429 +0200
-@@ -55,7 +55,7 @@
- BIN_CFLAGS += -fPIE -DPIE
- BIN_CFLAGS += -I../include -I../libdlm
-
--BIN_LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
-+BIN_LDFLAGS += $(LDFLAGS) -Wl,-z,now -Wl,-z,relro -pie
- BIN_LDFLAGS += -lpthread -lrt -lcpg -lcmap -lcfg -lquorum
-
- LIB_CFLAGS += $(BIN_CFLAGS)
-diff -uNr dlm-4.0.2.orig/dlm_tool/Makefile dlm-4.0.2/dlm_tool/Makefile
---- dlm-4.0.2.orig/dlm_tool/Makefile 2013-07-31 17:50:26.000000000 +0200
-+++ dlm-4.0.2/dlm_tool/Makefile 2017-04-04 10:50:44.617327153 +0200
-@@ -32,7 +32,7 @@
- BIN_CFLAGS += -fPIE -DPIE
- BIN_CFLAGS += -I../include -I../libdlm -I../dlm_controld
-
--BIN_LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
-+BIN_LDFLAGS += $(LDFLAGS) -Wl,-z,now -Wl,-z,relro -pie
- BIN_LDFLAGS += -L../libdlm -L../dlm_controld
- BIN_LDFLAGS += -lpthread -ldlm -ldlmcontrol
-
-diff -uNr dlm-4.0.2.orig/dlm_controld/Makefile dlm-4.0.2/dlm_controld/Makefile
---- dlm-4.0.2.orig/dlm_controld/Makefile 2017-04-04 11:02:58.578389641 +0200
-+++ dlm-4.0.2/dlm_controld/Makefile 2017-04-04 11:07:55.672414935 +0200
-@@ -59,7 +59,7 @@
- BIN_LDFLAGS += -lpthread -lrt -lcpg -lcmap -lcfg -lquorum
-
- LIB_CFLAGS += $(BIN_CFLAGS)
--LIB_LDFLAGS += -Wl,-z,relro -pie
-+LIB_LDFLAGS += $(LDFLAGS) -Wl,-z,relro -pie
-
- ifeq ($(USE_SD_NOTIFY),yes)
- BIN_CFLAGS += $(shell pkg-config --cflags libsystemd-daemon) \
diff --git a/meta-networking/recipes-extended/dlm/dlm_4.0.2.bb b/meta-networking/recipes-extended/dlm/dlm_4.0.2.bb
deleted file mode 100644
index 31e411e86d..0000000000
--- a/meta-networking/recipes-extended/dlm/dlm_4.0.2.bb
+++ /dev/null
@@ -1,51 +0,0 @@
-DESCRIPTION = "dlm control daemon and tool"
-
-SECTION = "utils"
-HOMEPAGE = "https://fedorahosted.org/cluster/wiki/HomePage"
-
-REQUIRED_DISTRO_FEATURES = "systemd"
-
-SRC_URI = "https://git.fedorahosted.org/cgit/dlm.git/snapshot/${BP}.tar.xz \
- file://respect-ldflags-also-from-bin_ldflags.patch \
-"
-
-SRC_URI[md5sum] = "efc2ee6093aa6aa0a88aaad83e998a3f"
-SRC_URI[sha256sum] = "b89bc557aaffbab0ac005398025f247718a5589cff6574d902eaffe2b20e683e"
-
-LICENSE = "LGPLv2+ & GPLv2 & GPLv2+"
-LIC_FILES_CHKSUM = "file://README.license;md5=8f0bbcdd678df1bce9863492b6c8832d"
-
-DEPENDS = "corosync systemd"
-
-inherit pkgconfig systemd distro_features_check
-
-SYSTEMD_SERVICE_${PN} = "dlm.service"
-SYSTEMD_AUTO_ENABLE = "enable"
-
-export EXTRA_OEMAKE = ""
-
-do_compile_prepend() {
- sed -i "s/libsystemd-daemon/libsystemd/g" ${S}/dlm_controld/Makefile
-}
-
-do_compile () {
- oe_runmake 'CC=${CC}'
-}
-
-do_install_append (){
- install -d ${D}${sysconfdir}/sysconfig/
- install -d ${D}${sysconfdir}/init.d/
- install -m 0644 ${S}/init/dlm.sysconfig ${D}${sysconfdir}/sysconfig/dlm
- install -m 0644 ${S}/init/dlm.init ${D}${sysconfdir}/init.d/dlm
-
- # install systemd unit files
- if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
- install -d ${D}${systemd_unitdir}/system
- install -m 0644 ${S}/init/dlm.service ${D}${systemd_unitdir}/system
- fi
-}
-
-do_install() {
- oe_runmake install DESTDIR=${D} LIBDIR=${libdir}
-}
-
diff --git a/meta-networking/recipes-extended/dlm/dlm_4.2.0.bb b/meta-networking/recipes-extended/dlm/dlm_4.2.0.bb
new file mode 100644
index 0000000000..ee006efe28
--- /dev/null
+++ b/meta-networking/recipes-extended/dlm/dlm_4.2.0.bb
@@ -0,0 +1,65 @@
+DESCRIPTION = "dlm control daemon and tool"
+
+SECTION = "utils"
+HOMEPAGE = "https://fedorahosted.org/cluster/wiki/HomePage"
+
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+SRC_URI = "https://pagure.io/dlm/archive/dlm-${PV}/dlm-dlm-${PV}.tar.gz \
+ file://0001-Include-sys-sysmacros.h-for-major-minor-macros-in-gl.patch \
+ file://0001-make-Replace-cp-a-with-mode-preserving-options.patch \
+ file://0001-dlm_controld-remove-unnecessary-header-include.patch \
+ file://0001-Disable-annobin-plugin.patch \
+ file://0001-Remove-fcf-protection-full.patch \
+ "
+
+SRC_URI[sha256sum] = "90237e18af7422ac15fc756899b3bb6932597b13342296de8e0e120e6d8729ab"
+
+UPSTREAM_CHECK_URI = "https://pagure.io/dlm/releases"
+UPSTREAM_CHECK_REGEX = "dlm-(?P<pver>\d+(\.\d+)+)"
+
+LICENSE = "LGPL-2.0-or-later & GPL-2.0-only & GPL-2.0-or-later"
+LIC_FILES_CHKSUM = "file://README.license;md5=8f0bbcdd678df1bce9863492b6c8832d"
+
+S = "${WORKDIR}/dlm-dlm-${PV}"
+
+DEPENDS += "corosync"
+
+inherit pkgconfig systemd features_check
+
+PACKAGECONFIG ??= ""
+
+PACKAGECONFIG[pacemaker] = ",,pacemaker"
+
+SYSTEMD_SERVICE:${PN} = "dlm.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
+export EXTRA_OEMAKE = ""
+
+CFPROTECTION ?= "-fcf-protection=full"
+CFPROTECTION:riscv64 = ""
+CFPROTECTION:arm = ""
+CFPROTECTION:aarch64 = ""
+
+CFLAGS += "${CFPROTECTION}"
+
+PARALLEL_MAKE = ""
+
+DONTBUILD = "${@bb.utils.contains('PACKAGECONFIG', 'pacemaker', '', 'fence', d)}"
+
+do_compile() {
+ sed -i "s/libsystemd-daemon/libsystemd/g" ${S}/dlm_controld/Makefile
+ sed -i -e "s/ ${DONTBUILD}//g" ${S}/Makefile
+ oe_runmake 'CC=${CC}'
+}
+
+do_install() {
+ oe_runmake install DESTDIR=${D} LIBDIR=${libdir}
+ install -Dm 0644 ${S}/init/dlm.sysconfig ${D}${sysconfdir}/sysconfig/dlm
+ install -Dm 0644 ${S}/init/dlm.init ${D}${sysconfdir}/init.d/dlm
+
+ # install systemd unit files
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -Dm 0644 ${S}/init/dlm.service ${D}${systemd_unitdir}/system/dlm.service
+ fi
+}
diff --git a/meta-networking/recipes-extended/iscsitarget/files/0001-kernel-event-netlink_ack-now-requires-4-arguments.patch b/meta-networking/recipes-extended/iscsitarget/files/0001-kernel-event-netlink_ack-now-requires-4-arguments.patch
deleted file mode 100644
index 4426d3552d..0000000000
--- a/meta-networking/recipes-extended/iscsitarget/files/0001-kernel-event-netlink_ack-now-requires-4-arguments.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From cbc5f8151017f45231b75a826f18354a81c287c4 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 26 Aug 2017 07:52:59 -0700
-Subject: [PATCH] kernel/event: netlink_ack() now requires 4 arguments
-
-see https://patchwork.kernel.org/patch/9670181/
-
-event.c:32:4: error: too few arguments to function 'netlink_ack'
-| netlink_ack(skb, nlh, 0);
-| ^~~~~~~~~~~
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- kernel/event.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Index: iscsitarget-1.4.20.3+svn502/kernel/event.c
-===================================================================
---- iscsitarget-1.4.20.3+svn502.orig/kernel/event.c
-+++ iscsitarget-1.4.20.3+svn502/kernel/event.c
-@@ -6,6 +6,7 @@
- * Some functions are based on audit code.
- */
-
-+#include <linux/version.h>
- #include <linux/module.h>
- #include <net/tcp.h>
- #include "iet_u.h"
-@@ -29,7 +30,11 @@ static void event_recv_skb(struct sk_buf
- ietd_pid = NETLINK_CB(skb).portid;
- WARN_ON(ietd_pid == 0);
- if (nlh->nlmsg_flags & NLM_F_ACK)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
-+ netlink_ack(skb, nlh, 0, NULL);
-+#else
- netlink_ack(skb, nlh, 0);
-+#endif
- skb_pull(skb, rlen);
- }
- }
diff --git a/meta-networking/recipes-extended/iscsitarget/files/access-sk_v6_daddr-iff-IPV6-defined.patch b/meta-networking/recipes-extended/iscsitarget/files/access-sk_v6_daddr-iff-IPV6-defined.patch
deleted file mode 100644
index 4444234b2e..0000000000
--- a/meta-networking/recipes-extended/iscsitarget/files/access-sk_v6_daddr-iff-IPV6-defined.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-The element skc_v6_daddr (in struct sock_common) is defined in
-kernel source only when CONFIG_IPV6 is enabled. Hence, access
-sk_v6_daddr element (i.e __sk_common.skc_v6_daddr) only when CONFIG_IPV6
-is defined; to fix below error in world build:
-
--- snip --
-/home/jenkins/oe/world/shr-core/tmp-glibc/work-shared/qemux86/kernel-source/include/net/sock.h:330:33: error: 'struct sock_common' has no member named 'skc_v6_daddr'
--- CUT --
-
-Upstream-Status: Pending
-
-Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
-
---- iscsitarget-1.4.20.3+svn502_org/kernel/conn.c 2015-12-29 21:57:50.547932217 -0800
-+++ iscsitarget-1.4.20.3+svn502/kernel/conn.c 2015-12-29 22:47:25.254657627 -0800
-@@ -46,10 +46,12 @@ void conn_info_show(struct seq_file *seq
- snprintf(buf, sizeof(buf),
- "%pI4", &inet_sk(sk)->inet_daddr);
- break;
-+#if defined(CONFIG_IPV6)
- case AF_INET6:
- snprintf(buf, sizeof(buf), "[%pI6]",
- &(sk)->sk_v6_daddr);
- break;
-+#endif /* defined(CONFIG_IPV6) */
- default:
- break;
- }
diff --git a/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_bio_struct_of_linux_v4.3_and_above.patch b/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_bio_struct_of_linux_v4.3_and_above.patch
deleted file mode 100644
index bce38baee5..0000000000
--- a/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_bio_struct_of_linux_v4.3_and_above.patch
+++ /dev/null
@@ -1,108 +0,0 @@
-Description: Fix source to compile with 4.3+ kernels
- commit 4246a0b63bd8f56a1469b12eafeb875b1041a451
- block: add a bi_error field to struct bio
- -> Removes BIO_UPTODATE and error argument to bio_endio.
- commit b54ffb73cadcdcff9cc1ae0e11f502407e3e2e4c
- block: remove bio_get_nr_vecs()
- -> Removed that call (always use BIO_MAX_PAGES)
- commit 676d23690fb62b5d51ba5d659935e9f7d9da9f8e
- net: Fix use after free by removing length arg from sk_data_ready callbacks.
- -> Removes len argument from sk_data_ready() callback.
-Author: Stefan Bader <stefan.bader@canonical.com>
-
-The original patch is at http://launchpadlibrarian.net/227478885/iscsitarget_1.4.20.3+svn502-2ubuntu2_1.4.20.3+svn502-2ubuntu3.diff.gz,
-those changes were taken using #ifs to allow compilation of iscsitarget
-package with kernel versions < 4.3.
-
-Upstream-Status: Submitted [http://launchpadlibrarian.net/227478885/iscsitarget_1.4.20.3+svn502-2ubuntu2_1.4.20.3+svn502-2ubuntu3.diff.gz]
-
-Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
-
-diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/block-io.c iscsitarget-1.4.20.3+svn502/kernel/block-io.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/block-io.c 2014-05-06 13:59:55.000000000 -0700
-+++ iscsitarget-1.4.20.3+svn502/kernel/block-io.c 2017-01-19 00:46:28.263951115 -0800
-@@ -29,14 +29,23 @@ struct tio_work {
- struct completion tio_complete;
- };
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+static void blockio_bio_endio(struct bio *bio)
-+#else
- static void blockio_bio_endio(struct bio *bio, int error)
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
- {
- struct tio_work *tio_work = bio->bi_private;
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+ if (bio->bi_error)
-+ atomic_set(&tio_work->error, bio->bi_error);
-+#else
- error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? error : -EIO;
-
- if (error)
- atomic_set(&tio_work->error, error);
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
-
- /* If last bio signal completion */
- if (atomic_dec_and_test(&tio_work->bios_remaining))
-@@ -61,14 +70,20 @@ blockio_make_request(struct iet_volume *
- u32 size = tio->size;
- u32 tio_index = 0;
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+ int max_pages = bdev_q ? BIO_MAX_PAGES : 1;
-+#else
- int max_pages = 1;
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
- int err = 0;
-
- loff_t ppos = tio->offset;
-
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
- /* Calculate max_pages for bio_alloc (memory saver) */
- if (bdev_q)
- max_pages = bio_get_nr_vecs(bio_data->bdev);
-+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) */
-
- tio_work = kzalloc(sizeof (*tio_work), GFP_KERNEL);
- if (!tio_work)
-diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/conn.c iscsitarget-1.4.20.3+svn502/kernel/conn.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/conn.c 2017-01-19 00:39:09.737117778 -0800
-+++ iscsitarget-1.4.20.3+svn502/kernel/conn.c 2017-01-19 00:52:30.037223901 -0800
-@@ -89,13 +89,21 @@ static void iet_state_change(struct sock
- target->nthread_info.old_state_change(sk);
- }
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+static void iet_data_ready(struct sock *sk)
-+#else
- static void iet_data_ready(struct sock *sk, int len)
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
- {
- struct iscsi_conn *conn = sk->sk_user_data;
- struct iscsi_target *target = conn->session->target;
-
- nthread_wakeup(target);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+ target->nthread_info.old_data_ready(sk);
-+#else
- target->nthread_info.old_data_ready(sk, len);
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
- }
-
- /*
-diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.h iscsitarget-1.4.20.3+svn502/kernel/iscsi.h
---- iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.h 2014-05-06 13:59:55.000000000 -0700
-+++ iscsitarget-1.4.20.3+svn502/kernel/iscsi.h 2017-01-19 00:48:02.102837260 -0800
-@@ -81,7 +81,11 @@ struct network_thread_info {
- spinlock_t nthread_lock;
-
- void (*old_state_change)(struct sock *);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+ void (*old_data_ready)(struct sock *);
-+#else
- void (*old_data_ready)(struct sock *, int);
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
- void (*old_write_space)(struct sock *);
- };
-
diff --git a/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_interfaces_of_linux_v4.8_and_above.patch b/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_interfaces_of_linux_v4.8_and_above.patch
deleted file mode 100644
index e508a5e6cd..0000000000
--- a/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_interfaces_of_linux_v4.8_and_above.patch
+++ /dev/null
@@ -1,475 +0,0 @@
-Resolve build error with linux kernel 4.8
-
-The below changes in kernel source, triggered iscsitarget
-build fail with linux kernel v4.8.
-
-1. An extra 'flags' argument has been passed to vfs_readv/vfs_writev
- syscalls in v4.8. So, set this argument to "0" for now
- (as there is no real need for that).
- Ref: https://github.com/torvalds/linux/commit/793b80ef14af56d20c998265287648ad34239b6f
- Solves:
- -- snip --
-TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/nthread.c: In function 'write_data':
-TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/nthread.c:350:9: error: too few arguments to function 'vfs_writev'
- res = vfs_writev(file, (struct iovec __user *) iop, count, &off);
- ^~~~~~~~~~
- -- snip --
-
-2. Redefine dropped PAGE_CACHE_* and page_cache_{get,release} definitions,
- as they have been dropped with v4.8
- Ref: https://github.com/torvalds/linux/commit/1fa64f198b9f8d6ec0f7aec7c18dc94684391140
- Solves:
- -- snip --
-TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/param.c: In function 'sess_param_check':
-TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/param.c:48:41: error: 'PAGE_CACHE_SIZE' undeclared (first use in this function)
- (u32) ((ISCSI_CONN_IOV_MAX - 1) * PAGE_CACHE_SIZE));
- ^
- -- snip --
-
-3. Replace crypto_hash interfaces with crypto_ahash interfaces,
- Ref: https://github.com/torvalds/linux/commit/896545098777564212b9e91af4c973f094649aa7
- Ref: https://www.redhat.com/archives/dm-devel/2016-January/msg00244.html
- Solves:
- -- snip --
-TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/digest.c: In function 'digest_init':
-TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/digest.c:42:23: error: implicit declaration of function 'crypto_alloc_hash' [-Werror=implicit-function-declaration]
- conn->rx_hash.tfm = crypto_alloc_hash("crc32c", 0,
- ^~~~~~~~~~~~~~~~~
-TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/digest.c: In function 'digest_cleanup':
-TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/digest.c:77:3: error: implicit declaration of function 'crypto_free_hash' [-Werror=implicit-function-declaration]
- crypto_free_hash(conn->tx_hash.tfm);
- ^~~~~~~~~~~~~~~~
- -- snip --
-
-4. The earlier "rw" parameter has been set in "bi_rw" within
- bio structure, hence remove "rw" argument.
- Ref: https://github.com/torvalds/linux/commit/4e49ea4a3d276365bf7396c9b77b4d1d5923835a
- Solves:
--- snip --
-TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/block-io.c:140:14: warning: passing argument 1 of 'submit_bio' makes pointer from integer without a cast [-Wint-conversion]
- submit_bio(rw, bio);
- ^~
--- snip --
-
-5. The 'len' argument from sk_data_ready() callback has been removed in
- linux kernel v4.3 and above.
- Ref: https://github.com/torvalds/linux/commit/676d23690fb62b5d51ba5d659935e9f7d9da9f8e
- Solves:
--- snip --
-TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/conn.c: In function 'iet_socket_bind':
-TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/conn.c:143:38: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
- target->nthread_info.old_data_ready = conn->sock->sk->sk_data_ready;
- ^
-TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/conn.c:144:32: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
- conn->sock->sk->sk_data_ready = iet_data_ready;
- ^
--- snip --
-
-6.
- A. The "size" argument has been dropped from sock_recvmsg syscall in v4.8,
- as all callers have it equal to msg_data_left(msg).
- B. 'struct user_msghdr' is being used for userland-side msghdr instead
- of 'struct msghdr', which is used for kernel-side msghdr in linux v3.19
- and above, so typecase it while calling sock_recvmsg syscall.
- Ref: https://github.com/torvalds/linux/commit/2da62906b1e298695e1bb725927041cd59942c98
- https://github.com/torvalds/linux/commit/666547ff591cebdedc4679bf6b1b3f3383a8dea3
- Solves:
- -- snip --
-TOPDIR/tmp-glibc/work-shared/qemux86/kernel-source/include/linux/net.h:222:5: note: expected 'struct msghdr *' but argument is of type 'struct user_msghdr *'
- int sock_recvmsg(struct socket *sock, struct msghdr *msg, int flags);
- ^~~~~~~~~~~~
-TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/nthread.c:129:8: error: too many arguments to function 'sock_recvmsg'
- res = sock_recvmsg(conn->sock, &msg, len, MSG_DONTWAIT | MSG_NOSIGNAL);
- ^~~~~~~~~~~~
- -- snip --
-
-Detailed error log is at: http://errors.yoctoproject.org/Errors/Details/83334/
-
-Upstream-Status: Pending
-
-Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
-
-diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/block-io.c iscsitarget-1.4.20.3+svn502/kernel/block-io.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/block-io.c 2017-01-19 20:19:27.400507354 -0800
-+++ iscsitarget-1.4.20.3+svn502/kernel/block-io.c 2017-01-19 20:32:22.977988593 -0800
-@@ -104,7 +104,11 @@ blockio_make_request(struct iet_volume *
- /* bi_sector is ALWAYS in units of 512 bytes */
- bio->bi_iter.bi_sector = ppos >> 9;
- bio->bi_bdev = bio_data->bdev;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ bio->bi_end_io = (bio_end_io_t *) blockio_bio_endio;
-+#else
- bio->bi_end_io = blockio_bio_endio;
-+#endif
- bio->bi_private = tio_work;
-
- if (tio_bio)
-@@ -139,7 +143,12 @@ blockio_make_request(struct iet_volume *
- tio_bio = tio_bio->bi_next;
- bio->bi_next = NULL;
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
-+ submit_bio(bio);
-+#else
- submit_bio(rw, bio);
-+#endif
- }
-
- blk_finish_plug(&plug);
-diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/conn.c iscsitarget-1.4.20.3+svn502/kernel/conn.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/conn.c 2017-01-19 20:19:27.400507354 -0800
-+++ iscsitarget-1.4.20.3+svn502/kernel/conn.c 2017-01-19 20:32:22.978988614 -0800
-@@ -148,8 +148,14 @@ static void iet_socket_bind(struct iscsi
- target->nthread_info.old_state_change = conn->sock->sk->sk_state_change;
- conn->sock->sk->sk_state_change = iet_state_change;
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ target->nthread_info.old_data_ready = (void (*) (struct sock *)) \
-+ conn->sock->sk->sk_data_ready;
-+ conn->sock->sk->sk_data_ready = (void (*) (struct sock *)) iet_data_ready;
-+#else
- target->nthread_info.old_data_ready = conn->sock->sk->sk_data_ready;
- conn->sock->sk->sk_data_ready = iet_data_ready;
-+#endif
-
- target->nthread_info.old_write_space = conn->sock->sk->sk_write_space;
- conn->sock->sk->sk_write_space = iet_write_space;
-diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/digest.c iscsitarget-1.4.20.3+svn502/kernel/digest.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/digest.c 2014-05-06 13:59:55.000000000 -0700
-+++ iscsitarget-1.4.20.3+svn502/kernel/digest.c 2017-01-19 20:32:22.978988614 -0800
-@@ -30,6 +30,9 @@ void digest_alg_available(unsigned int *
- int digest_init(struct iscsi_conn *conn)
- {
- int err = 0;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ struct crypto_ahash *tfm;
-+#endif
-
- if (!(conn->hdigest_type & DIGEST_ALL))
- conn->hdigest_type = DIGEST_NONE;
-@@ -39,15 +42,40 @@ int digest_init(struct iscsi_conn *conn)
-
- if (conn->hdigest_type & DIGEST_CRC32C ||
- conn->ddigest_type & DIGEST_CRC32C) {
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ tfm = crypto_alloc_ahash("crc32c", 0, CRYPTO_ALG_ASYNC);
-+ if (IS_ERR(tfm)) {
-+ tfm = NULL;
-+#else
- conn->rx_hash.tfm = crypto_alloc_hash("crc32c", 0,
- CRYPTO_ALG_ASYNC);
- conn->rx_hash.flags = 0;
- if (IS_ERR(conn->rx_hash.tfm)) {
- conn->rx_hash.tfm = NULL;
-+#endif
- err = -ENOMEM;
- goto out;
- }
--
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ conn->rx_hash = ahash_request_alloc(tfm, GFP_KERNEL);
-+ if (!conn->rx_hash) {
-+ pr_err("ahash_request_alloc() failed for conn->rx_hash\n");
-+ crypto_free_ahash(tfm);
-+ err = -ENOMEM;
-+ goto out;
-+ }
-+ ahash_request_set_callback(conn->rx_hash, 0, NULL, NULL);
-+ conn->tx_hash = ahash_request_alloc(tfm, GFP_KERNEL);
-+ if(!conn->tx_hash) {
-+ pr_err("ahash_request_alloc() failed for conn->tx_hash\n");
-+ ahash_request_free(conn->rx_hash);
-+ conn->rx_hash = NULL;
-+ crypto_free_ahash(tfm);
-+ err = -ENOMEM;
-+ goto out;
-+ }
-+ ahash_request_set_callback(conn->tx_hash, 0, NULL, NULL);
-+#else
- conn->tx_hash.tfm = crypto_alloc_hash("crc32c", 0,
- CRYPTO_ALG_ASYNC);
- conn->tx_hash.flags = 0;
-@@ -56,6 +84,7 @@ int digest_init(struct iscsi_conn *conn)
- err = -ENOMEM;
- goto out;
- }
-+#endif
- }
-
- out:
-@@ -73,10 +102,21 @@ out:
- */
- void digest_cleanup(struct iscsi_conn *conn)
- {
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ ahash_request_free(conn->tx_hash);
-+ if (conn->rx_hash) {
-+ struct crypto_ahash *tfm;
-+ tfm = crypto_ahash_reqtfm(conn->rx_hash);
-+ ahash_request_free(conn->rx_hash);
-+ crypto_free_ahash(tfm);
-+ }
-+
-+#else
- if (conn->tx_hash.tfm)
- crypto_free_hash(conn->tx_hash.tfm);
- if (conn->rx_hash.tfm)
- crypto_free_hash(conn->rx_hash.tfm);
-+#endif
- }
-
- /**
-@@ -160,8 +200,13 @@ static inline void __dbg_simulate_data_d
- }
- }
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+static void digest_header(struct ahash_request *hash, struct iscsi_pdu *pdu,
-+ u8 *crc)
-+#else
- static void digest_header(struct hash_desc *hash, struct iscsi_pdu *pdu,
- u8 *crc)
-+#endif
- {
- struct scatterlist sg[2];
- unsigned int nbytes = sizeof(struct iscsi_hdr);
-@@ -174,16 +219,27 @@ static void digest_header(struct hash_de
- nbytes += pdu->ahssize;
- }
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ crypto_ahash_init(hash);
-+ ahash_request_set_crypt(hash, sg, crc, nbytes);
-+ crypto_ahash_update(hash);
-+ crypto_ahash_digest(hash);
-+#else
- crypto_hash_init(hash);
- crypto_hash_update(hash, sg, nbytes);
- crypto_hash_final(hash, crc);
-+#endif
- }
-
- int digest_rx_header(struct iscsi_cmnd *cmnd)
- {
- u32 crc;
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ digest_header(cmnd->conn->rx_hash, &cmnd->pdu, (u8 *) &crc);
-+#else
- digest_header(&cmnd->conn->rx_hash, &cmnd->pdu, (u8 *) &crc);
-+#endif
- if (crc != cmnd->hdigest)
- return -EIO;
-
-@@ -192,11 +248,20 @@ int digest_rx_header(struct iscsi_cmnd *
-
- void digest_tx_header(struct iscsi_cmnd *cmnd)
- {
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ digest_header(cmnd->conn->tx_hash, &cmnd->pdu, (u8 *) &cmnd->hdigest);
-+#else
- digest_header(&cmnd->conn->tx_hash, &cmnd->pdu, (u8 *) &cmnd->hdigest);
-+#endif
- }
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+static void digest_data(struct ahash_request *hash, struct iscsi_cmnd *cmnd,
-+ struct tio *tio, u32 offset, u8 *crc)
-+#else
- static void digest_data(struct hash_desc *hash, struct iscsi_cmnd *cmnd,
- struct tio *tio, u32 offset, u8 *crc)
-+#endif
- {
- struct scatterlist *sg = cmnd->conn->hash_sg;
- u32 size, length, npages;
-@@ -214,7 +279,11 @@ static void digest_data(struct hash_desc
- BUG_ON(npages > ISCSI_CONN_IOV_MAX);
-
- sg_init_table(sg, ARRAY_SIZE(cmnd->conn->hash_sg));
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ crypto_ahash_init(hash);
-+#else
- crypto_hash_init(hash);
-+#endif
-
- for (i = 0; size > 0; i++) {
- length = min_t(u32, PAGE_CACHE_SIZE - offset, size);
-@@ -225,8 +294,14 @@ static void digest_data(struct hash_desc
-
- sg_mark_end(&sg[i - 1]);
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ ahash_request_set_crypt(hash, sg, crc, nbytes);
-+ crypto_ahash_update(hash);
-+ crypto_ahash_digest(hash);
-+#else
- crypto_hash_update(hash, sg, nbytes);
- crypto_hash_final(hash, crc);
-+#endif
- }
-
- int digest_rx_data(struct iscsi_cmnd *cmnd)
-@@ -251,8 +326,11 @@ int digest_rx_data(struct iscsi_cmnd *cm
- tio = cmnd->tio;
- offset = 0;
- }
--
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ digest_data(cmnd->conn->rx_hash, cmnd, tio, offset, (u8 *) &crc);
-+#else
- digest_data(&cmnd->conn->rx_hash, cmnd, tio, offset, (u8 *) &crc);
-+#endif
-
- if (!cmnd->conn->read_overflow &&
- (cmnd_opcode(cmnd) != ISCSI_OP_PDU_REJECT)) {
-@@ -269,6 +347,11 @@ void digest_tx_data(struct iscsi_cmnd *c
- struct iscsi_data_out_hdr *req = (struct iscsi_data_out_hdr *)&cmnd->pdu.bhs;
-
- assert(tio);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ digest_data(cmnd->conn->tx_hash, cmnd, tio,
-+ be32_to_cpu(req->buffer_offset), (u8 *) &cmnd->ddigest);
-+#else
- digest_data(&cmnd->conn->tx_hash, cmnd, tio,
- be32_to_cpu(req->buffer_offset), (u8 *) &cmnd->ddigest);
-+#endif
- }
-diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.h iscsitarget-1.4.20.3+svn502/kernel/iscsi.h
---- iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.h 2017-01-19 20:19:27.400507354 -0800
-+++ iscsitarget-1.4.20.3+svn502/kernel/iscsi.h 2017-01-19 20:32:22.979988634 -0800
-@@ -14,6 +14,7 @@
- #include <linux/pagemap.h>
- #include <linux/seq_file.h>
- #include <linux/mm.h>
-+#include <crypto/hash.h>
- #include <linux/crypto.h>
- #include <linux/scatterlist.h>
- #include <net/sock.h>
-@@ -275,8 +276,13 @@ struct iscsi_conn {
- u32 write_offset;
- int write_state;
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ struct ahash_request *rx_hash;
-+ struct ahash_request *tx_hash;
-+#else
- struct hash_desc rx_hash;
- struct hash_desc tx_hash;
-+#endif
- struct scatterlist hash_sg[ISCSI_CONN_IOV_MAX];
- };
-
-@@ -552,4 +558,10 @@ enum cmnd_flags {
- #define PRODUCT_ID "VIRTUAL-DISK"
- #define PRODUCT_REV "0"
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+#define PAGE_CACHE_SHIFT PAGE_SHIFT
-+#define PAGE_CACHE_SIZE PAGE_SIZE
-+#define PAGE_CACHE_MASK PAGE_MASK
-+#endif
-+
- #endif /* __ISCSI_H__ */
-diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/nthread.c iscsitarget-1.4.20.3+svn502/kernel/nthread.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/nthread.c 2017-01-19 20:19:27.276504928 -0800
-+++ iscsitarget-1.4.20.3+svn502/kernel/nthread.c 2017-01-19 20:32:22.979988634 -0800
-@@ -155,7 +155,12 @@ static int do_recv(struct iscsi_conn *co
-
- oldfs = get_fs();
- set_fs(get_ds());
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ res = sock_recvmsg(conn->sock, (struct msghdr *) &msg, \
-+ MSG_DONTWAIT | MSG_NOSIGNAL);
-+#else
- res = sock_recvmsg(conn->sock, &msg, len, MSG_DONTWAIT | MSG_NOSIGNAL);
-+#endif
- set_fs(oldfs);
-
- if (res <= 0) {
-@@ -376,7 +381,11 @@ static int write_data(struct iscsi_conn
- ;
- oldfs = get_fs();
- set_fs(KERNEL_DS);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ res = vfs_writev(file, (struct iovec __user *) iop, count, &off, 0);
-+#else
- res = vfs_writev(file, (struct iovec __user *) iop, count, &off);
-+#endif
- set_fs(oldfs);
- dprintk(D_DATA, "%#Lx:%u: %d(%ld)\n",
- (unsigned long long) conn->session->sid, conn->cid,
-@@ -503,7 +512,11 @@ static int tx_ddigest(struct iscsi_cmnd
- iov.iov_base = (char *) (&cmnd->ddigest) + (sizeof(u32) - rest);
- iov.iov_len = rest;
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ res = kernel_sendmsg(cmnd->conn->sock, (struct msghdr *) &msg, &iov, 1, rest);
-+#else
- res = kernel_sendmsg(cmnd->conn->sock, &msg, &iov, 1, rest);
-+#endif
-
- if (res > 0) {
- cmnd->conn->write_size -= res;
-@@ -702,7 +715,12 @@ static void close_conn(struct iscsi_conn
-
- write_lock_bh(&conn->sock->sk->sk_callback_lock);
- conn->sock->sk->sk_state_change = target->nthread_info.old_state_change;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ conn->sock->sk->sk_data_ready = (void (*) (struct sock *)) \
-+ target->nthread_info.old_data_ready;
-+#else
- conn->sock->sk->sk_data_ready = target->nthread_info.old_data_ready;
-+#endif
- conn->sock->sk->sk_write_space = target->nthread_info.old_write_space;
- write_unlock_bh(&conn->sock->sk->sk_callback_lock);
-
-diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/volume.c iscsitarget-1.4.20.3+svn502/kernel/volume.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/volume.c 2017-01-19 20:19:27.276504928 -0800
-+++ iscsitarget-1.4.20.3+svn502/kernel/volume.c 2017-01-19 20:32:22.979988634 -0800
-@@ -84,12 +84,25 @@ static int set_scsisn(struct iet_volume
- /* Generate a MD5 hash of the target IQN and LUN number */
- static void gen_scsiid(struct iet_volume *volume)
- {
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ struct ahash_request *hash;
-+ struct crypto_ahash *tfm;
-+#else
- struct hash_desc hash;
-+#endif
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ tfm = crypto_alloc_ahash("md5", 0, CRYPTO_ALG_ASYNC);
-+#else
- hash.tfm = crypto_alloc_hash("md5", 0, CRYPTO_ALG_ASYNC);
- hash.flags = 0;
-+#endif
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ if (!IS_ERR(tfm)) {
-+#else
- if (!IS_ERR(hash.tfm)) {
-+#endif
- struct scatterlist sg[2];
- unsigned int nbytes = 0;
-
-@@ -102,11 +115,19 @@ static void gen_scsiid(struct iet_volume
- sg_set_buf(&sg[1], &volume->lun, sizeof(volume->lun));
- nbytes += sizeof(volume->lun);
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-+ crypto_ahash_init(hash);
-+ ahash_request_set_crypt(hash, sg, volume->scsi_id, nbytes);
-+ crypto_ahash_update(hash);
-+ crypto_ahash_digest(hash);
-+ crypto_free_ahash(tfm);
-+#else
- crypto_hash_init(&hash);
- crypto_hash_update(&hash, sg, nbytes);
- crypto_hash_final(&hash, volume->scsi_id);
-
- crypto_free_hash(hash.tfm);
-+#endif
- } else {
- /* If no MD5 available set ID to TID and LUN */
- memcpy(volume->scsi_id, &volume->target->tid,
diff --git a/meta-networking/recipes-extended/iscsitarget/files/fix-call-trace-of-ahash-API-calling.patch b/meta-networking/recipes-extended/iscsitarget/files/fix-call-trace-of-ahash-API-calling.patch
deleted file mode 100644
index c99683478b..0000000000
--- a/meta-networking/recipes-extended/iscsitarget/files/fix-call-trace-of-ahash-API-calling.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-The previous build_with_updated_interfaces_of_linux_v4.8_and_above.patch
-does not alloc struct ahash_request before using it. This will cause the
-kernel call trace below when calling gen_scsiid on kernel 4.8 or later
-version.
-
-This patch normalizes the calling of ahash API according to the example
-in kernel doc Documentation/crypto/api-intro.txt.
-
-BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
-IP: [<ffffffffa0008d45>] volume_add+0x625/0x7f0 [iscsi_trgt]
-PGD dd77067 PUD dd7c067 PMD 0
-Oops: 0000 [#1] PREEMPT SMP
-Modules linked in: iscsi_trgt(O)
-CPU: 0 PID: 350 Comm: ietd Tainted: G O 4.8.12-yocto-standard #1
-Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
-task: ffff88000dfe2c00 task.stack: ffff88000de88000
-RIP: 0010:[<ffffffffa0008d45>] [<ffffffffa0008d45>] volume_add+0x625/0x7f0 [iscsi_trgt]
-RSP: 0018:ffff88000de8bd90 EFLAGS: 00000206
-RAX: 000000000000ddfa RBX: ffff88000ddd1d78 RCX: ffffea0000000000
-RDX: 0000000000000600 RSI: 0000000000000000 RDI: ffff88000ddd1c14
-RBP: ffff88000de8be38 R08: ffff88000de44180 R09: ffff88000de8bdd0
-R10: 000000000000002c R11: 0000000000000000 R12: ffff88000ddfa600
-R13: 0000000000000000 R14: 0000000000000000 R15: ffff88000de92200
-FS: 00007f767548b700(0000) GS:ffff88000fc00000(0000) knlGS:0000000000000000
-CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
-CR2: 0000000000000020 CR3: 000000000dd2d000 CR4: 00000000000006f0
-Stack:
- ffff88000de8bdd0 ffff88000dc1b3d0 ffff88000ddfa650 ffff88000ddfa660
- ffff88000df8f000 ffff88000ddd1c00 ffff88000de44180 0000000000000000
- ffffea0000377440 0000000f00000c14 0000000000000000 0000000000000000
-Call Trace:
- [<ffffffffa0006547>] ioctl+0x217/0x390 [iscsi_trgt]
- [<ffffffff81192574>] do_vfs_ioctl+0x94/0x5c0
- [<ffffffff8117ff73>] ? vfs_read+0xf3/0x120
- [<ffffffff81192b19>] SyS_ioctl+0x79/0x90
- [<ffffffff8191a45b>] entry_SYSCALL_64_fastpath+0x13/0x8f
-Code: 4c 01 e0 0f 82 a2 01 00 00 48 b9 00 00 00 80 ff 77 00 00 48 01
-c8 45 31 f6 48 b9 00 00 00 00 00 ea ff ff 89 54 24 68 48 c1 e8 0c <49>
-8b 56 20 4c 89 44 24 20 4c 89 f7 48 c1 e0 06 c7 44 24 6c 04
-RIP [<ffffffffa0008d45>] volume_add+0x625/0x7f0 [iscsi_trgt]
- RSP <ffff88000de8bd90>
-CR2: 0000000000000020
-end trace cd2016297df21635 ]
-ietd_response_recv 200 0 -5
-Input/output error.
-
-Upstream-Status: Pending [This patch is based on the previous one which
-has not been merged upstream.]
-
-Signed-off-by: Zhe He <zhe.he@windriver.com>
-
---- iscsitarget-1.4.20.3+svn502_orig/kernel/volume.c 2017-01-18 08:57:56.752187402 +0800
-+++ iscsitarget-1.4.20.3+svn502/kernel/volume.c 2017-01-18 09:02:44.164195234 +0800
-@@ -93,13 +93,14 @@ static void gen_scsiid(struct iet_volume
-
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
- tfm = crypto_alloc_ahash("md5", 0, CRYPTO_ALG_ASYNC);
-+ hash = ahash_request_alloc(tfm, GFP_ATOMIC);
- #else
- hash.tfm = crypto_alloc_hash("md5", 0, CRYPTO_ALG_ASYNC);
- hash.flags = 0;
- #endif
-
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-- if (!IS_ERR(tfm)) {
-+ if (tfm && !IS_ERR(tfm)) {
- #else
- if (!IS_ERR(hash.tfm)) {
- #endif
-@@ -116,10 +117,13 @@ static void gen_scsiid(struct iet_volume
- nbytes += sizeof(volume->lun);
-
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
-- crypto_ahash_init(hash);
-+ ahash_request_set_callback(hash, 0, NULL, NULL);
- ahash_request_set_crypt(hash, sg, volume->scsi_id, nbytes);
-- crypto_ahash_update(hash);
- crypto_ahash_digest(hash);
-+ crypto_ahash_init(hash);
-+ crypto_ahash_update(hash);
-+ crypto_ahash_final(hash);
-+ ahash_request_free(hash);
- crypto_free_ahash(tfm);
- #else
- crypto_hash_init(&hash);
diff --git a/meta-networking/recipes-extended/iscsitarget/files/fix-errors-observed-with-linux-3.19-and-greater.patch b/meta-networking/recipes-extended/iscsitarget/files/fix-errors-observed-with-linux-3.19-and-greater.patch
deleted file mode 100644
index 1e6a1d6d3f..0000000000
--- a/meta-networking/recipes-extended/iscsitarget/files/fix-errors-observed-with-linux-3.19-and-greater.patch
+++ /dev/null
@@ -1,327 +0,0 @@
-Description: Fix source to compile on 3.19 kernels
-Author: Stefan Bader <stefan.bader@canonical.com>
-Forward: no
-
-Fixes below inconsistent crash when trying to login to iSCSI target
-server, observed with linux kernel v4.1.
-
--- snip --
-CPU: 1 PID: 29883 Comm: istd1 Tainted: G O 4.1.35-rt40-yocto-standard #1
-Hardware name: To be filled by O.E.M. To be filled by O.E.M./Larne CRB, BIOS 4.6.5.4 09/18/2014
-task: ffff88020f1f30c0 ti: ffff8800d7f3c000 task.ti: ffff8800d7f3c000
-RIP: 0010:[<ffffffff8140d1ae>] [<ffffffff8140d1ae>] copy_to_iter+0x3e/0x280
-RSP: 0018:ffff8800d7f3f728 EFLAGS: 00010246
-RAX: 00000000d7f3f928 RBX: 0000000000000030 RCX: 0000000000000030
-RDX: ffff8800d7f3f900 RSI: 0000000000000030 RDI: ffff8800d1501e82
-RBP: ffff8800d7f3f768 R08: 00000000c127d467 R09: 0000000000000000
-R10: ffff88020f29e118 R11: 0000000000000004 R12: ffff8800d7f3f900
-R13: 0000000000000030 R14: 0000000000000001 R15: 0000000000000246
-FS: 00007f86f9c4c700(0000) GS:ffff88021ec80000(0000) knlGS:00000000f7733700
-CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
-CR2: 000000000000024e CR3: 00000000d38b0000 CR4: 00000000000406e0
-Stack:
-ffff880214f14ec0 ffff8800d1501e82 ffff8800d7f3f748 0000000000000030
-ffff88020f122500 0000000000000030 0000000000000000 0000000000000030
-ffff8800d7f3f7c8 ffffffff81806981 ffff8800d7f3f798 ffffffff8105d72a
-Call Trace:
-[<ffffffff81806981>] skb_copy_datagram_iter+0x71/0x2b0
-[<ffffffff8105d72a>] ? __local_bh_enable_ip+0x4a/0xb0
-[<ffffffff8186c9c0>] tcp_recvmsg+0x5e0/0xbb0
-[<ffffffff81898ded>] inet_recvmsg+0x8d/0xb0
-[<ffffffff817f49f3>] sock_recvmsg+0x13/0x20
-[<ffffffffa01655c3>] do_recv+0xe3/0x1f0 [iscsi_trgt]
-[<ffffffff81153097>] ? __mod_zone_page_state+0x77/0xb0
-[<ffffffff81417613>] ? __this_cpu_preempt_check+0x13/0x20
-[<ffffffff81153097>] ? __mod_zone_page_state+0x77/0xb0
-[<ffffffff8140fed5>] ? find_next_bit+0x15/0x30
-[<ffffffff813fa8e0>] ? cpumask_next_and+0x30/0x50
-[<ffffffff8113f785>] ? __alloc_pages_nodemask+0x165/0x980
-[<ffffffff8107e370>] ? preempt_count_add+0xd0/0xf0
-[<ffffffff8195da8b>] ? _raw_spin_lock+0x1b/0x60
-[<ffffffff8109cfa8>] ? cpuacct_charge+0x58/0x70
-[<ffffffff81089039>] ? update_curr+0xb9/0x190
-[<ffffffff81417613>] ? __this_cpu_preempt_check+0x13/0x20
-[<ffffffff8112b43f>] ? __perf_event_task_sched_in+0x4f/0x90
-[<ffffffff8195dbbd>] ? _raw_spin_unlock_irq+0x1d/0x40
-[<ffffffff8107e223>] ? finish_task_switch+0x63/0xe0
-[<ffffffff81959e3b>] ? __schedule+0x38b/0x980
-[<ffffffff8107e370>] ? preempt_count_add+0xd0/0xf0
-[<ffffffffa0165c65>] istd+0x4d5/0x1390 [iscsi_trgt]
-[<ffffffff81959e3b>] ? __schedule+0x38b/0x980
-[<ffffffffa0165790>] ? nthread_wakeup+0x40/0x40 [iscsi_trgt]
-[<ffffffffa0165790>] ? nthread_wakeup+0x40/0x40 [iscsi_trgt]
-[<ffffffff8107748b>] kthread+0xbb/0xe0
-[<ffffffff81950000>] ? wireless_dev_seq_show+0x100/0x180
-[<ffffffff810773d0>] ? kthread_worker_fn+0x170/0x170
-[<ffffffff8195e7a2>] ret_from_fork+0x42/0x70
-[<ffffffff810773d0>] ? kthread_worker_fn+0x170/0x170
-Code: 5a 10 48 89 7d c8 48 39 f3 48 0f 47 de 48 85 db 0f 84 6f 01 00 00 8b 02 49 89
-d4 4c 8b 72 08 4c 8b 7a 18 a8 04 0f 85 a2 00 00 00 <4d> 8b 6f 08 4d 29 f5 49 39 dd 4c 0f 47 eb a8 02 0f 85 5c 01 00
-RSP <ffff8800d7f3f728>
-CR2: 000000000000024e
-------------[ cut here ]------------
--- snip --
-
-The original patch is at
-http://launchpadlibrarian.net/218100509/iscsitarget_1.4.20.3+svn499-0ubuntu2_1.4.20.3+svn499-0ubuntu2.1.diff.gz,
-those changes were taken using #ifs, inorder to allow compilation of
-iscsitarget package with linux kernels < 3.19.
-
-Upstream-Status: Submitted [http://launchpadlibrarian.net/218100509/iscsitarget_1.4.20.3+svn499-0ubuntu2_1.4.20.3+svn499-0ubuntu2.1.diff.gz]
-
-Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
-
-diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/conn.c iscsitarget-1.4.20.3+svn502/kernel/conn.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/conn.c 2017-01-18 22:27:02.713167436 -0800
-+++ iscsitarget-1.4.20.3+svn502/kernel/conn.c 2017-01-18 23:13:11.909214379 -0800
-@@ -129,7 +129,11 @@ static void iet_socket_bind(struct iscsi
-
- dprintk(D_GENERIC, "%llu\n", (unsigned long long) session->sid);
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+ conn->sock = SOCKET_I(file_inode(conn->file));
-+#else
- conn->sock = SOCKET_I(conn->file->f_dentry->d_inode);
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
- conn->sock->sk->sk_user_data = conn;
-
- write_lock_bh(&conn->sock->sk->sk_callback_lock);
-diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/file-io.c iscsitarget-1.4.20.3+svn502/kernel/file-io.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/file-io.c 2014-05-06 13:59:55.000000000 -0700
-+++ iscsitarget-1.4.20.3+svn502/kernel/file-io.c 2017-01-18 23:54:38.505717079 -0800
-@@ -69,7 +69,11 @@ static int fileio_make_request(struct ie
- static int fileio_sync(struct iet_volume *lu, struct tio *tio)
- {
- struct fileio_data *p = lu->private;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+ struct inode *inode = file_inode(p->filp);
-+#else
- struct inode *inode = p->filp->f_dentry->d_inode;
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
- struct address_space *mapping = inode->i_mapping;
- loff_t ppos, count;
- int res;
-@@ -213,7 +217,11 @@ static int fileio_attach(struct iet_volu
- eprintk("%d\n", err);
- goto out;
- }
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+ inode = file_inode(p->filp);
-+#else
- inode = p->filp->f_dentry->d_inode;
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
-
- if (S_ISREG(inode->i_mode))
- ;
-diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.c iscsitarget-1.4.20.3+svn502/kernel/iscsi.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.c 2014-05-06 13:59:55.000000000 -0700
-+++ iscsitarget-1.4.20.3+svn502/kernel/iscsi.c 2017-01-18 23:37:36.462970326 -0800
-@@ -489,8 +489,12 @@ static void cmnd_skip_pdu(struct iscsi_c
- }
- conn->read_iov[i].iov_base = addr;
- conn->read_iov[i].iov_len = size;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+ iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, ++i, conn->read_size);
-+#else
- conn->read_msg.msg_iov = conn->read_iov;
- conn->read_msg.msg_iovlen = ++i;
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
- }
-
- static void iscsi_cmnd_reject(struct iscsi_cmnd *req, int reason)
-@@ -718,7 +722,9 @@ static int cmnd_recv_pdu(struct iscsi_co
- idx = offset >> PAGE_CACHE_SHIFT;
- offset &= ~PAGE_CACHE_MASK;
-
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
- conn->read_msg.msg_iov = conn->read_iov;
-+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) */
- conn->read_size = size = (size + 3) & -4;
- conn->read_overflow = 0;
-
-@@ -730,16 +736,25 @@ static int cmnd_recv_pdu(struct iscsi_co
- conn->read_iov[i].iov_base = addr + offset;
- if (offset + size <= PAGE_CACHE_SIZE) {
- conn->read_iov[i].iov_len = size;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+ iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, ++i, conn->read_size);
-+#else
- conn->read_msg.msg_iovlen = ++i;
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
- break;
- }
- conn->read_iov[i].iov_len = PAGE_CACHE_SIZE - offset;
- size -= conn->read_iov[i].iov_len;
- offset = 0;
- if (++i >= ISCSI_CONN_IOV_MAX) {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
- conn->read_msg.msg_iovlen = i;
-+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) */
- conn->read_overflow = size;
- conn->read_size -= size;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+ iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, i, conn->read_size);
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
- break;
- }
-
-@@ -918,7 +933,9 @@ static int nop_out_start(struct iscsi_co
-
- if ((size = cmnd->pdu.datasize)) {
- size = (size + 3) & -4;
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
- conn->read_msg.msg_iov = conn->read_iov;
-+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) */
- if (cmnd->pdu.bhs.itt != cpu_to_be32(ISCSI_RESERVED_TAG)) {
- struct tio *tio;
- int pg_cnt = get_pgcnt(size);
-@@ -946,7 +963,11 @@ static int nop_out_start(struct iscsi_co
- }
- assert(!size);
- conn->read_overflow = size;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+ iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, i, conn->read_size);
-+#else
- conn->read_msg.msg_iovlen = i;
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
- }
-
- out:
-@@ -986,7 +1007,11 @@ static void scsi_cmnd_start(struct iscsi
- set_cmnd_lunit(req);
-
- switch (req_hdr->scb[0]) {
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+ case SERVICE_ACTION_IN_16:
-+#else
- case SERVICE_ACTION_IN:
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
- if ((req_hdr->scb[1] & 0x1f) != 0x10)
- goto error;
- case INQUIRY:
-diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/nthread.c iscsitarget-1.4.20.3+svn502/kernel/nthread.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/nthread.c 2014-05-06 13:59:55.000000000 -0700
-+++ iscsitarget-1.4.20.3+svn502/kernel/nthread.c 2017-01-18 23:45:03.291033881 -0800
-@@ -42,9 +42,14 @@ static inline void iscsi_conn_init_read(
- len = (len + 3) & -4; // XXX ???
- conn->read_iov[0].iov_base = data;
- conn->read_iov[0].iov_len = len;
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
- conn->read_msg.msg_iov = conn->read_iov;
- conn->read_msg.msg_iovlen = 1;
-+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) */
- conn->read_size = (len + 3) & -4;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+ iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, 1, conn->read_size);
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
- }
-
- static void iscsi_conn_read_ahs(struct iscsi_conn *conn, struct iscsi_cmnd *cmnd)
-@@ -83,14 +88,31 @@ static int is_data_available(struct iscs
-
- static void forward_iov(struct msghdr *msg, int len)
- {
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+ struct iovec *iov;
-+
-+ while (msg->msg_iter.iov->iov_len <= len) {
-+ len -= msg->msg_iter.iov->iov_len;
-+ msg->msg_iter.iov++;
-+ msg->msg_iter.nr_segs--;
-+ }
-+#else
- while (msg->msg_iov->iov_len <= len) {
- len -= msg->msg_iov->iov_len;
- msg->msg_iov++;
- msg->msg_iovlen--;
- }
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+ /* XXX: discards const ... */
-+ iov = msg->msg_iter.iov;
-+ iov->iov_base = (char *) msg->msg_iter.iov->iov_base + len;
-+ iov->iov_len -= len;
-+#else
- msg->msg_iov->iov_base = (char *) msg->msg_iov->iov_base + len;
- msg->msg_iov->iov_len -= len;
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
- }
-
- static int do_recv(struct iscsi_conn *conn, int state)
-@@ -98,6 +120,9 @@ static int do_recv(struct iscsi_conn *co
- mm_segment_t oldfs;
- struct msghdr msg;
- struct iovec iov[ISCSI_CONN_IOV_MAX];
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+ size_t iovlen = ISCSI_CONN_IOV_MAX;
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
- int i, len, res;
-
- if (!test_bit(CONN_ACTIVE, &conn->state)) {
-@@ -110,12 +135,23 @@ static int do_recv(struct iscsi_conn *co
- goto out;
- }
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+ if (conn->read_msg.msg_iter.nr_segs < iovlen)
-+ iovlen = conn->read_msg.msg_iter.nr_segs;
-+
-+ for (i = 0, len = 0; i < iovlen; i++) {
-+ iov[i] = conn->read_msg.msg_iter.iov[i];
-+ len += iov[i].iov_len;
-+ }
-+ iov_iter_init(&msg.msg_iter, READ, iov, iovlen, len);
-+#else
- msg.msg_iov = iov;
- msg.msg_iovlen = min_t(size_t, conn->read_msg.msg_iovlen, ISCSI_CONN_IOV_MAX);
- for (i = 0, len = 0; i < msg.msg_iovlen; i++) {
- iov[i] = conn->read_msg.msg_iov[i];
- len += iov[i].iov_len;
- }
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
-
- oldfs = get_fs();
- set_fs(get_ds());
-diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/target_disk.c iscsitarget-1.4.20.3+svn502/kernel/target_disk.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/target_disk.c 2014-05-06 13:59:55.000000000 -0700
-+++ iscsitarget-1.4.20.3+svn502/kernel/target_disk.c 2017-01-18 23:45:51.451010417 -0800
-@@ -606,7 +606,11 @@ static int disk_execute_cmnd(struct iscs
- case REQUEST_SENSE:
- send_data_rsp(cmnd, build_request_sense_response);
- break;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+ case SERVICE_ACTION_IN_16:
-+#else
- case SERVICE_ACTION_IN:
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
- send_data_rsp(cmnd, build_service_action_in_response);
- break;
- case READ_6:
-diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/volume.c iscsitarget-1.4.20.3+svn502/kernel/volume.c
---- iscsitarget-1.4.20.3+svn502_org/kernel/volume.c 2014-05-06 13:59:55.000000000 -0700
-+++ iscsitarget-1.4.20.3+svn502/kernel/volume.c 2017-01-18 23:47:07.957561600 -0800
-@@ -398,7 +398,11 @@ int is_volume_reserved(struct iet_volume
- case READ_CAPACITY:
- /* allowed commands when reserved */
- break;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+ case SERVICE_ACTION_IN_16:
-+#else
- case SERVICE_ACTION_IN:
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
- if ((scb[1] & 0x1F) == 0x10)
- break;
- /* fall through */
-@@ -465,7 +469,11 @@ int is_volume_reserved(struct iet_volume
- if (excl_access_ro && !registered)
- err = -EBUSY;
- break;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
-+ case SERVICE_ACTION_IN_16:
-+#else
- case SERVICE_ACTION_IN:
-+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
- if ((scb[1] & 0x1F) == 0x10)
- break;
- /* fall through */
diff --git a/meta-networking/recipes-extended/iscsitarget/files/use-kernel-makefile-to-get-kernel-version.patch b/meta-networking/recipes-extended/iscsitarget/files/use-kernel-makefile-to-get-kernel-version.patch
deleted file mode 100644
index 95bd047b97..0000000000
--- a/meta-networking/recipes-extended/iscsitarget/files/use-kernel-makefile-to-get-kernel-version.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-Get linux kernel version from Makefile of kernel source
-
-We get below messages while building iscsitarget,
-
--- snip --
-x86_64-poky-linux-gcc: error:
-/CGE7_SHDD/project_yocto_1.8/poky/build/tmp/work-shared/qemux86-64/kernel-source/include/linux/version.h:
-No such file or directory
-x86_64-poky-linux-gcc: fatal error: no input files
-compilation terminated.
-/bin/sh: line 0: [: too many arguments
-/bin/sh: line 0: [: too many arguments
-/bin/sh: line 0: [: too many arguments
-/bin/sh: line 0: [: too many arguments
-/bin/sh: line 0: [: too many arguments
-/bin/sh: line 0: [: too many arguments
-/bin/sh: line 0: [: too many arguments
-/bin/sh: line 0: [: too many arguments
-/bin/sh: line 0: [: too many arguments
-/bin/sh: line 0: [: too many arguments
-/bin/sh: line 0: [: too many arguments
-/bin/sh: line 0: [: too many arguments
--- CUT --
-
-These messages are due to absence of include/linux/version.h file in
-kernel source directory and failed to compute linux kernel version.
-So, use kernel source Makefile ( i.e $(KSRC)/Makefile) to find out
-actual kernel version.
-
-Upstream-Status: Pending
-
-Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
-
---- iscsitarget-1.4.20.3+svn499_org/Makefile 2014-01-27 00:00:45.000000000 +0530
-+++ iscsitarget-1.4.20.3+svn499/Makefile 2015-07-23 10:44:47.013600285 +0530
-@@ -18,27 +18,11 @@ ifeq ($(KSRC),)
- endif
-
-
--ifneq ($(wildcard $(KSRC)/include/generated/utsrelease.h),)
-- VERSION_FILE := $(KSRC)/include/generated/utsrelease.h
--else
-- ifneq ($(wildcard $(KSRC)/include/linux/utsrelease.h),)
-- VERSION_FILE := $(KSRC)/include/linux/utsrelease.h
-- else
-- VERSION_FILE := $(KSRC)/include/linux/version.h
-- endif
--endif
--
--KVER := $(shell $(CC) $(CFLAGS) $(LDFLAGS) -E -dM $(VERSION_FILE) | \
-- grep UTS_RELEASE | awk '{ print $$3 }' | sed 's/\"//g')
--
- KMOD := /lib/modules/$(KVER)/extra
--
--KMAJ := $(shell echo $(KVER) | \
-- sed -e 's/^\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*.*/\1/')
--KMIN := $(shell echo $(KVER) | \
-- sed -e 's/^[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*.*/\1/')
--KREV := $(shell echo $(KVER) | \
-- sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/')
-+KMAJ := $(shell cat $(KSRC)/Makefile | grep ^VERSION | gawk -F " " '{ print $$NF }')
-+KMIN := $(shell cat $(KSRC)/Makefile | grep ^PATCHLEVEL | gawk -F " " '{ print $$NF }')
-+KREV := $(shell cat $(KSRC)/Makefile | grep ^SUBLEVEL | gawk -F " " '{ print $$NF }')
-+KVER := ${KMAJ}.${KMIN}.${KREV}
-
- kver_eq = $(shell [ $(KMAJ) -eq $(1) -a $(KMIN) -eq $(2) -a $(KREV) -eq $(3) ] && \
- echo 1 || echo 0)
diff --git a/meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb b/meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb
deleted file mode 100644
index 6593661075..0000000000
--- a/meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb
+++ /dev/null
@@ -1,62 +0,0 @@
-DESCRIPTION = "iSCSI Enterprise Target is aimed to develop an \
- open source iSCSI target with professional features, \
- that works well in enterprise environment under real \
- workload, and is scalable and versatile enough to meet the \
- challenge of future storage needs and developments."
-HOMEPAGE = "http://iscsitarget.sourceforge.net/"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=6e233eda45c807aa29aeaa6d94bc48a2"
-DEPENDS = "openssl virtual/kernel"
-
-SRC_URI = "http://ftp.heanet.ie/mirrors/ubuntu/pool/universe/i/${BPN}/${BPN}_${PV}.orig.tar.gz \
- file://use-kernel-makefile-to-get-kernel-version.patch \
- file://fix-errors-observed-with-linux-3.19-and-greater.patch \
- file://access-sk_v6_daddr-iff-IPV6-defined.patch \
- file://build_with_updated_bio_struct_of_linux_v4.3_and_above.patch \
- file://build_with_updated_interfaces_of_linux_v4.8_and_above.patch \
- file://fix-call-trace-of-ahash-API-calling.patch \
- file://0001-kernel-event-netlink_ack-now-requires-4-arguments.patch \
- "
-
-SRC_URI[md5sum] = "ef9bc823bbabd3c772208c00d5f2d089"
-SRC_URI[sha256sum] = "d3196ccb78a43266dce28587bfe30d8ab4db7566d7bce96057dfbb84100babb5"
-
-inherit module
-
-do_configure[noexec] = "1"
-
-# make_scripts requires kernel source directory to create
-# kernel scripts
-do_make_scripts[depends] += "virtual/kernel:do_shared_workdir"
-
-do_compile() {
- oe_runmake KSRC=${STAGING_KERNEL_DIR} LDFLAGS='' V=1 kernel
- oe_runmake KSRC=${STAGING_KERNEL_DIR} usr
-}
-
-do_install() {
- # Module
- install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/iscsi
- install -m 0644 kernel/iscsi_trgt.ko \
- ${D}/lib/modules/${KERNEL_VERSION}/kernel/iscsi/iscsi_trgt.ko
-
- # Userspace utilities
- install -d ${D}${sbindir}
- install -m 0755 usr/ietd ${D}${sbindir}/ietd
- install -m 0755 usr/ietadm ${D}${sbindir}/ietadm
-
- # Config files, init scripts
- mkdir -p ${D}${sysconfdir}/iet
- install -m 0644 etc/ietd.conf ${D}/${sysconfdir}/iet/ietd.conf
- install -m 0644 etc/initiators.allow ${D}${sysconfdir}/iet/initiators.allow
- install -m 0644 etc/targets.allow ${D}${sysconfdir}/iet/targets.allow
- mkdir -p ${D}${sysconfdir}/init.d
- install -m 0755 etc/initd/initd ${D}${sysconfdir}/init.d/iscsi-target
- install -m 0644 etc/initiators.deny ${D}${sysconfdir}/iet/initiators.deny
-}
-
-FILES_${PN} += "${sbindir} \
- ${sysconfdir}"
-
-RDEPENDS_${PN} = "kernel-module-iscsi-trgt"
-RRECOMMENDS_${PN} = "kernel-module-crc32c kernel-module-libcrc32c"
diff --git a/meta-networking/recipes-extended/kronosnet/kronosnet/0001-links.c-Fix-build-with-gcc-12.patch b/meta-networking/recipes-extended/kronosnet/kronosnet/0001-links.c-Fix-build-with-gcc-12.patch
new file mode 100644
index 0000000000..d57d0e61b5
--- /dev/null
+++ b/meta-networking/recipes-extended/kronosnet/kronosnet/0001-links.c-Fix-build-with-gcc-12.patch
@@ -0,0 +1,40 @@
+From a8aac8f3fd8b07fde8f5dc0aa9ece54a46d24425 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Thu, 9 Jun 2022 16:03:06 +0800
+Subject: [PATCH] links.c: Fix build with gcc-12
+
+Fixes:
+ | /build/tmp-glibc/work/corei7-64-wrs-linux/kronosnet/1.22-r0/recipe-sysroot/usr/include/bits/string_fortified.h:59:10: error: 'link' may be used uninitialized [-Werror=maybe-uninitialized]
+ | 59 | return __builtin___memset_chk (__dest, __ch, __len,
+ | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | 60 | __glibc_objsize0 (__dest));
+ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ../../git/libknet/links.c: In function 'knet_link_set_config':
+ | ../../git/libknet/links.c:108:27: note: 'link' was declared here
+ | 108 | struct knet_link *link;
+ | | ^~~~
+ | cc1: all warnings being treated as errors
+
+Upstream-Status: Submitted [https://github.com/kronosnet/kronosnet/pull/382]
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ libknet/links.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libknet/links.c b/libknet/links.c
+index 8cb1621b..0ef42b79 100644
+--- a/libknet/links.c
++++ b/libknet/links.c
+@@ -105,7 +105,7 @@ int knet_link_set_config(knet_handle_t knet_h, knet_node_id_t host_id, uint8_t l
+ {
+ int savederrno = 0, err = 0, i, wipelink = 0, link_idx;
+ struct knet_host *host, *tmp_host;
+- struct knet_link *link;
++ struct knet_link *link = NULL;
+
+ if (!_is_valid_handle(knet_h)) {
+ return -1;
+--
+2.25.1
+
diff --git a/meta-networking/recipes-extended/kronosnet/kronosnet_1.24.bb b/meta-networking/recipes-extended/kronosnet/kronosnet_1.24.bb
new file mode 100644
index 0000000000..cbd5e7a0fd
--- /dev/null
+++ b/meta-networking/recipes-extended/kronosnet/kronosnet_1.24.bb
@@ -0,0 +1,32 @@
+# Copyright (C) 2020 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Kronosnet, often referred to as knet, is a network abstraction layer \
+ designed for High Availability use cases, where redundancy, security, \
+ fault tolerance and fast fail-over are the core requirements of your application."
+HOMEPAGE = "https://kronosnet.org/"
+LICENSE = "GPL-2.0-or-later & LGPL-2.1-only"
+LIC_FILES_CHKSUM = "file://COPYING.applications;md5=751419260aa954499f7abaabaa882bbe \
+ file://COPYING.libraries;md5=2d5025d4aa3495befef8f17206a5b0a1"
+SECTION = "libs"
+DEPENDS = "doxygen-native libqb-native libxml2-native bzip2 libqb libxml2 libnl lksctp-tools lz4 lzo openssl nss xz zlib zstd"
+
+SRCREV = "f8f80fd7f9b85f2626d2c6452612962ad8efca9e"
+SRC_URI = "git://github.com/kronosnet/kronosnet;protocol=https;branch=stable1 \
+ file://0001-links.c-Fix-build-with-gcc-12.patch \
+ "
+
+UPSTREAM_CHECK_URI = "https://github.com/kronosnet/kronosnet/releases"
+
+inherit autotools pkgconfig
+
+S = "${WORKDIR}/git"
+
+# libknet/transport_udp.c:326:48: error: comparison of integers of different signs: 'unsigned long' and 'int' [-Werror,-Wsign-compare]
+# for (cmsg = CMSG_FIRSTHDR(&msg);cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
+# ^~~~~~~~~~~~~~~~~~~~~~~
+CFLAGS:append:toolchain-clang = " -Wno-sign-compare"
+
+PACKAGECONFIG[man] = "enable_man="yes", --disable-man, "
+
+PACKAGECONFIG:remove = "man"
diff --git a/meta-networking/recipes-extended/tgt/files/0001-Correct-the-path-of-header-files-check-in-Yocto-buil.patch b/meta-networking/recipes-extended/tgt/files/0001-Correct-the-path-of-header-files-check-in-Yocto-buil.patch
new file mode 100644
index 0000000000..173ecb620d
--- /dev/null
+++ b/meta-networking/recipes-extended/tgt/files/0001-Correct-the-path-of-header-files-check-in-Yocto-buil.patch
@@ -0,0 +1,47 @@
+From 93fea40915d01be6d02587a0b8be85a642e6a8d5 Mon Sep 17 00:00:00 2001
+From: Zhenhua Luo <zhenhua.luo@freescale.com>
+Date: Thu, 10 Apr 2014 11:26:39 +0800
+Subject: [PATCH] Correct the path of header files check in Yocto build env
+
+Upstream-Status: Inappropriate [the fix is specific to Yocto build env]
+
+Current Makefile will check headers on host instead of Yocto sysroot, following
+error appears. Change the path of header check.
+| bs_aio.c:34:20: fatal error: libaio.h: No such file or directory
+| #include <libaio.h>
+| ^
+| compilation terminated.
+
+Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
+
+---
+ usr/Makefile | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/usr/Makefile b/usr/Makefile
+index decf13c..9ff8f15 100644
+--- a/usr/Makefile
++++ b/usr/Makefile
+@@ -1,11 +1,11 @@
+ sbindir ?= $(PREFIX)/sbin
+ libdir ?= $(PREFIX)/lib/tgt
+
+-ifneq ($(shell test -e /usr/include/linux/signalfd.h && echo 1),)
++ifneq ($(shell test -e $(SYSROOT)/usr/include/linux/signalfd.h && echo 1),)
+ CFLAGS += -DUSE_SIGNALFD
+ endif
+
+-ifneq ($(shell test -n $(shell find /usr/include -name "timerfd.h" | head -n1) && echo 1),)
++ifneq ($(shell test -n $(shell find $(SYSROOT)/usr/include -name "timerfd.h" | head -n1) && echo 1),)
+ CFLAGS += -DUSE_TIMERFD
+ endif
+
+@@ -25,7 +25,7 @@ ifneq ($(SD_NOTIFY),)
+ CFLAGS += -DUSE_SYSTEMD
+ endif
+
+-ifneq ($(shell test -e /usr/include/sys/eventfd.h && test -e /usr/include/libaio.h && echo 1),)
++ifneq ($(shell test -e $(SYSROOT)/usr/include/sys/eventfd.h && test -e $(SYSROOT)/usr/include/libaio.h && echo 1),)
+ CFLAGS += -DUSE_EVENTFD
+ TGTD_OBJS += bs_aio.o
+ LIBS += -laio
diff --git a/meta-networking/recipes-extended/tgt/files/0001-usr-Makefile-WARNING-fix.patch b/meta-networking/recipes-extended/tgt/files/0001-usr-Makefile-WARNING-fix.patch
new file mode 100644
index 0000000000..a3ea604086
--- /dev/null
+++ b/meta-networking/recipes-extended/tgt/files/0001-usr-Makefile-WARNING-fix.patch
@@ -0,0 +1,29 @@
+From 6f4e3b11c7dccf83e2d18635c84837b212dfcc1c Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Sun, 26 Jul 2015 04:23:51 +0900
+Subject: [PATCH] usr/Makefile: WARNING fix WARNING: QA Issue: tgt:
+ /work/i586-oe-linux/tgt/1.0.60+gitAUTOINC+ab51727a36-r0/
+ packages-split/tgt/usr/sbin/tgtd contains probably-redundant RPATH /usr/lib
+ [useless-rpaths]
+
+Upstream-Status: Pending
+
+Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+
+---
+ usr/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/usr/Makefile b/usr/Makefile
+index 9ff8f15..cc8df11 100644
+--- a/usr/Makefile
++++ b/usr/Makefile
+@@ -63,7 +63,7 @@ TGTD_OBJS += tgtd.o mgmt.o target.o scsi.o log.o driver.o util.o work.o \
+
+ TGTD_DEP = $(TGTD_OBJS:.o=.d)
+
+-LDFLAGS = -Wl,-E,-rpath=$(libdir)
++LDFLAGS += -Wl,-E
+
+ .PHONY:all
+ all: $(PROGRAMS) $(MODULES)
diff --git a/meta-networking/recipes-extended/tgt/files/musl-__wordsize.patch b/meta-networking/recipes-extended/tgt/files/musl-__wordsize.patch
new file mode 100644
index 0000000000..ac758cc39d
--- /dev/null
+++ b/meta-networking/recipes-extended/tgt/files/musl-__wordsize.patch
@@ -0,0 +1,41 @@
+The definition of __WORDSIZE is found in <sys/reg.h>
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- a/usr/iscsi/iscsid.h
++++ b/usr/iscsi/iscsid.h
+@@ -22,6 +22,9 @@
+ #include <stdint.h>
+ #include <inttypes.h>
+ #include <netdb.h>
++#if !defined(__GLIBC__)
++#include <sys/reg.h>
++#endif
+
+ #include "transport.h"
+ #include "list.h"
+--- a/usr/tgtd.h
++++ b/usr/tgtd.h
+@@ -1,6 +1,9 @@
+ #ifndef __TARGET_DAEMON_H
+ #define __TARGET_DAEMON_H
+
++#if !defined(__GLIBC__)
++#include <sys/reg.h>
++#endif
+ #include "log.h"
+ #include "scsi_cmnd.h"
+ #include "tgtadm_error.h"
+--- a/usr/util.h
++++ b/usr/util.h
+@@ -19,6 +19,9 @@
+ #include <linux/fs.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#if !defined(__GLIBC__)
++#include <sys/reg.h>
++#endif
+
+ #include "be_byteshift.h"
+
diff --git a/meta-networking/recipes-extended/tgt/files/tgtd b/meta-networking/recipes-extended/tgt/files/tgtd
new file mode 100644
index 0000000000..64df6a3eb4
--- /dev/null
+++ b/meta-networking/recipes-extended/tgt/files/tgtd
@@ -0,0 +1,5 @@
+# options for tgtd
+TGTD_OPTS=""
+
+# configuration file
+TGTD_CONFIG=/etc/tgt/targets.conf
diff --git a/meta-networking/recipes-extended/tgt/files/tgtd.init b/meta-networking/recipes-extended/tgt/files/tgtd.init
new file mode 100644
index 0000000000..4b0ce9443f
--- /dev/null
+++ b/meta-networking/recipes-extended/tgt/files/tgtd.init
@@ -0,0 +1,116 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides: tgtd
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Short-Description: SCSI target daemon
+# Description: Linux SCSI target framework (tgt)
+### END INIT INFO
+
+DESC="tgtd"
+DAEMON="/usr/sbin/tgtd"
+TGTD_CONFIG=/etc/tgt/targets.conf
+
+start ()
+{
+ echo -n "Starting $DESC..."
+
+ # Ensure service isn't running
+ tgt-admin -s >/dev/null 2>&1
+ RETVAL=$?
+ if [ "$RETVAL" -ne 107 ] ; then
+ echo "$DESC is already running."
+ exit 1
+ fi
+
+ # Start tgtd first
+ $DAEMON &>/dev/null
+ RETVAL=$?
+ if [ "$RETVAL" -ne 0 ]; then
+ echo "failed."
+ exit 1
+ fi
+
+ # Put tgtd into "offline" state until all the targets are configured.
+ # We don't want initiators to (re)connect and fail the connection
+ # if it's not ready.
+ tgtadm --op update --mode sys --name State -v offline
+ # Configure the targets.
+ tgt-admin -f -e -c $TGTD_CONFIG
+ # Put tgtd into "ready" state.
+ tgtadm --op update --mode sys --name State -v ready
+
+ echo "done."
+}
+
+stop ()
+{
+ echo -n "Stopping $DESC..."
+
+ # Remove all targets. It only removes targets which are not in use.
+ tgt-admin --update ALL -c /dev/null &>/dev/null
+ # tgtd will exit if all targets were removed
+ tgtadm --op delete --mode system &>/dev/null
+ RETVAL=$?
+ if [ "$RETVAL" -eq 107 ] ; then
+ if [ "$TASK" != "restart" ] ; then
+ return 1
+ fi
+ elif [ "$RETVAL" -ne 0 ] ; then
+ echo "Some initiators are still connected - could not stop tgtd"
+ return 2
+ fi
+ echo -n
+}
+
+reload()
+{
+ echo "Reloading configuration of $DESC" "$NAME"
+ # Update configuration for targets. Only targets which
+ # are not in use will be updated.
+ tgt-admin --update ALL -c $TGTD_CONFIG &>/dev/null
+ RETVAL=$?
+ if [ "$RETVAL" -eq 107 ] ; then
+ echo "tgtd is not running"
+ exit 1
+ fi
+}
+
+status()
+{
+ tgt-admin -s >/dev/null 2>&1
+ RETVAL=$?
+ if [ "$RETVAL" -eq 107 ] ; then
+ echo "tgtd is not running"
+ else
+ echo "tgtd is running"
+ fi
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|force-reload)
+ stop
+ start
+ ;;
+ reload)
+ reload
+ ;;
+ status)
+ status
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|force-reload|restart|status|reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-networking/recipes-extended/tgt/files/tgtd.service b/meta-networking/recipes-extended/tgt/files/tgtd.service
new file mode 100755
index 0000000000..afbd4b4eaa
--- /dev/null
+++ b/meta-networking/recipes-extended/tgt/files/tgtd.service
@@ -0,0 +1,33 @@
+[Unit]
+Description=tgtd iSCSI target daemon
+After=network.target
+
+[Service]
+EnvironmentFile=@SYSCONFDIR@/sysconfig/tgtd
+
+ExecStart=@SBINDIR@/tgtd -f $TGTD_OPTS
+# see bz 848942. workaround for a race for now.
+ExecStartPost=@BASE_BINDIR@/sleep 5
+# Put tgtd into "offline" state until all the targets are configured.
+# We don't want initiators to (re)connect and fail the connection
+# if it's not ready.
+ExecStartPost=@SBINDIR@/tgtadm --op update --mode sys --name State -v offline
+# Configure the targets.
+ExecStartPost=@SBINDIR@/tgt-admin -e -c $TGTD_CONFIG
+# Put tgtd into "ready" state.
+ExecStartPost=@SBINDIR@/tgtadm --op update --mode sys --name State -v ready
+
+# Update configuration for targets. Only targets which
+# are not in use will be updated.
+ExecReload=@SBINDIR@/tgt-admin --update ALL -c $TGTD_CONFIG
+
+# NOTE: Shutdown of the iscsi target may cause data corruption
+# for initiators that are connected.
+ExecStop=@SBINDIR@/tgtadm --op update --mode sys --name State -v offline
+# Remove all targets. It only removes targets which are not in use.
+ExecStop=@SBINDIR@/tgt-admin --update ALL -c /dev/null
+# tgtd will exit if all targets were removed
+ExecStop=@SBINDIR@/tgtadm --op delete --mode system
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-networking/recipes-extended/tgt/files/usr-Makefile-apply-LDFLAGS-to-all-executables.patch b/meta-networking/recipes-extended/tgt/files/usr-Makefile-apply-LDFLAGS-to-all-executables.patch
new file mode 100644
index 0000000000..b6c674bd9d
--- /dev/null
+++ b/meta-networking/recipes-extended/tgt/files/usr-Makefile-apply-LDFLAGS-to-all-executables.patch
@@ -0,0 +1,37 @@
+From a815ac8ee16b344d9e24b445957f32bf2aafa532 Mon Sep 17 00:00:00 2001
+From: Mark Asselstine <mark.asselstine@windriver.com>
+Date: Thu, 5 Jan 2017 11:07:51 -0500
+Subject: [PATCH] usr/Makefile: apply LDFLAGS to all executables
+
+Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
+---
+Upstream-Status: Pending
+
+ usr/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/usr/Makefile b/usr/Makefile
+index cc8df11..c55fd68 100644
+--- a/usr/Makefile
++++ b/usr/Makefile
+@@ -78,7 +78,7 @@ TGTADM_OBJS = tgtadm.o concat_buf.o
+ TGTADM_DEP = $(TGTADM_OBJS:.o=.d)
+
+ tgtadm: $(TGTADM_OBJS)
+- $(CC) $^ -o $@
++ $(CC) $^ -o $@ $(LDFLAGS)
+
+ -include $(TGTADM_DEP)
+
+@@ -86,7 +86,7 @@ TGTIMG_OBJS = tgtimg.o libssc.o libcrc32c.o
+ TGTIMG_DEP = $(TGTIMG_OBJS:.o=.d)
+
+ tgtimg: $(TGTIMG_OBJS)
+- $(CC) $^ -o $@
++ $(CC) $^ -o $@ $(LDFLAGS)
+
+ -include $(TGTIMG_DEP)
+
+--
+2.7.4
+
diff --git a/meta-networking/recipes-extended/tgt/tgt_1.0.90.bb b/meta-networking/recipes-extended/tgt/tgt_1.0.90.bb
new file mode 100644
index 0000000000..e816b79e87
--- /dev/null
+++ b/meta-networking/recipes-extended/tgt/tgt_1.0.90.bb
@@ -0,0 +1,93 @@
+DESCRIPTION = "Linux SCSI target framework (tgt)"
+HOMEPAGE = "http://stgt.sourceforge.net"
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM = "file://scripts/tgtd.spec;beginline=7;endline=7;md5=21c19ea7dad04648b9c2f791b6e29b4c"
+DEPENDS = "sg3-utils libaio"
+
+SRCREV = "df991fa788e22cd8b8e3013cfae306988c19c3d0"
+
+SRC_URI = "git://github.com/fujita/tgt.git;branch=master;protocol=https \
+ file://0001-Correct-the-path-of-header-files-check-in-Yocto-buil.patch \
+ file://0001-usr-Makefile-WARNING-fix.patch \
+ file://usr-Makefile-apply-LDFLAGS-to-all-executables.patch \
+ file://musl-__wordsize.patch \
+"
+SRC_URI += "file://tgtd.init \
+ file://tgtd.service \
+ file://tgtd \
+"
+
+S = "${WORKDIR}/git"
+
+CONFFILES:${PN} += "${sysconfdir}/tgt/targets.conf"
+
+inherit update-rc.d systemd
+
+SYSTEMD_SERVICE:${PN} = "tgtd.service"
+SYSTEMD_AUTO_ENABLE:${PN} = "disable"
+
+CFLAGS += ' -I. -DUSE_SIGNALFD -DUSE_TIMERFD -D_GNU_SOURCE -DTGT_VERSION=\\"1.0.63\\" -DBSDIR=\\"${libdir}/backing-store\\"'
+
+CFLAGS:append:libc-musl = " -D_LARGEFILE64_SOURCE"
+#do_compile() {
+# oe_runmake SYSROOT="${STAGING_DIR_TARGET}" -e programs conf scripts
+#}
+EXTRA_OEMAKE = "-e programs conf scripts"
+
+do_install() {
+ oe_runmake -e DESTDIR="${D}" install-programs install-conf install-scripts
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${UNPACKDIR}/tgtd.init ${D}${sysconfdir}/init.d/tgtd
+ elif ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${UNPACKDIR}/tgtd.service ${D}${systemd_unitdir}/system/tgtd.service
+ install -d ${D}${sysconfdir}/sysconfig
+ install -m 0644 ${UNPACKDIR}/tgtd ${D}${sysconfdir}/sysconfig/tgtd
+ sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/tgtd.service
+ sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/tgtd.service
+ sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/tgtd.service
+ fi
+}
+
+FILES:${PN} += "${systemd_unitdir}/system/tgtd.service \
+ ${sysconfdir}/sysconfig/tgtd \
+"
+
+RDEPENDS:${PN} = " \
+ bash \
+ libaio \
+ libconfig-general-perl \
+ perl \
+ perl-module-english \
+ perl-module-tie-hash-namedcapture \
+ perl-module-xsloader \
+ perl-module-carp \
+ perl-module-exporter \
+ perl-module-errno \
+ perl-module-exporter-heavy \
+ perl-module-symbol \
+ perl-module-selectsaver \
+ perl-module-dynaloader \
+ perl-module-carp-heavy \
+ perl-module-filehandle \
+ perl-module-feature \
+ perl-module-overload \
+ perl-module-fcntl \
+ perl-module-io \
+ perl-module-io-file \
+ perl-module-io-handle \
+ perl-module-io-seekable \
+ perl-module-file-glob \
+ perl-module-base \
+ perl-module-encoding-warnings \
+ perl-module-file-spec-unix \
+ perl-module-file-spec \
+ perl-module-file-spec-functions \
+ perl-module-getopt-long \
+ perl-module-constant \
+ "
+INITSCRIPT_PACKAGES = "${PN}"
+INITSCRIPT_NAME:${PN} = "tgtd"
+