diff options
Diffstat (limited to 'meta-networking/recipes-extended')
17 files changed, 589 insertions, 78 deletions
diff --git a/meta-networking/recipes-extended/corosync/corosync_3.0.3.bb b/meta-networking/recipes-extended/corosync/corosync_3.1.6.bb index ec2a785277..8fca576614 100644 --- a/meta-networking/recipes-extended/corosync/corosync_3.0.3.bb +++ b/meta-networking/recipes-extended/corosync/corosync_3.1.6.bb @@ -10,7 +10,7 @@ inherit autotools pkgconfig systemd SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BP}.tar.gz \ file://corosync.conf \ " -SRC_URI[sha256sum] = "20eb903eb984f6a728282c199825e442e8bba869acefd22390076ef3a33a4ded" +SRC_URI[sha256sum] = "ca6ed32b4d7f33ed614afce8760fe58d0de92c68b575d4969ebacd892f3d1e27" UPSTREAM_CHECK_REGEX = "(?P<pver>\d+\.(?!99)\d+(\.\d+)+)" LICENSE = "BSD-3-Clause" 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-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-fix-compile-error-since-xml2-config-should-not-b.patch b/meta-networking/recipes-extended/dlm/dlm/0001-dlm-fix-compile-error-since-xml2-config-should-not-b.patch deleted file mode 100644 index f56359a473..0000000000 --- a/meta-networking/recipes-extended/dlm/dlm/0001-dlm-fix-compile-error-since-xml2-config-should-not-b.patch +++ /dev/null @@ -1,36 +0,0 @@ -From ad207a6f83dac390b2d95e3a8262d27292921863 Mon Sep 17 00:00:00 2001 -From: Changqing Li <changqing.li@windriver.com> -Date: Wed, 26 Jun 2019 11:49:33 +0800 -Subject: [PATCH] dlm: fix compile error since xml2-config should not be used - -xml2-config is disabled, so change Makefile to use pkgconfig -to find libxml2. - -Upstream-Status: Inappropriate [oe-specific] - -Signed-off-by: Changqing Li <changqing.li@windriver.com> ---- - fence/Makefile | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/fence/Makefile b/fence/Makefile -index b927879..6e16078 100644 ---- a/fence/Makefile -+++ b/fence/Makefile -@@ -18,11 +18,11 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \ - -fstack-clash-protection -Wl,-z,now - - CFLAGS += -fPIE -DPIE --CFLAGS += `xml2-config --cflags` -+CFLAGS += `pkg-config libxml-2.0 --cflags` - CFLAGS += -I../include - - LDFLAGS += -Wl,-z,relro -pie --LDFLAGS += `xml2-config --libs` -+LDFLAGS += `pkg-config libxml-2.0 --libs` - LDFLAGS += -ldl - - all: $(BIN_TARGET) --- -2.7.4 - 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_4.0.9.bb b/meta-networking/recipes-extended/dlm/dlm_4.2.0.bb index b99c30cc9e..ee006efe28 100644 --- a/meta-networking/recipes-extended/dlm/dlm_4.0.9.bb +++ b/meta-networking/recipes-extended/dlm/dlm_4.2.0.bb @@ -6,18 +6,19 @@ 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-dlm-fix-compile-error-since-xml2-config-should-not-b.patch \ 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[md5sum] = "4c57a941a15547859cd38fd55f66388e" -SRC_URI[sha256sum] = "d59142e067cbd603aaf66151a04e9fa34330219680b8827c953d20821b951991" +SRC_URI[sha256sum] = "90237e18af7422ac15fc756899b3bb6932597b13342296de8e0e120e6d8729ab" UPSTREAM_CHECK_URI = "https://pagure.io/dlm/releases" UPSTREAM_CHECK_REGEX = "dlm-(?P<pver>\d+(\.\d+)+)" -LICENSE = "LGPLv2+ & GPLv2 & GPLv2+" +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}" @@ -35,11 +36,16 @@ SYSTEMD_AUTO_ENABLE = "enable" export EXTRA_OEMAKE = "" -DONTBUILD = "${@bb.utils.contains('PACKAGECONFIG', 'pacemaker', '', 'fence', d)}" +CFPROTECTION ?= "-fcf-protection=full" +CFPROTECTION:riscv64 = "" +CFPROTECTION:arm = "" +CFPROTECTION:aarch64 = "" -do_compile:prepend:toolchain-clang() { - sed -i -e "s/-fstack-clash-protection//g" ${S}/*/Makefile -} +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 @@ -57,4 +63,3 @@ do_install() { install -Dm 0644 ${S}/init/dlm.service ${D}${systemd_unitdir}/system/dlm.service fi } - diff --git a/meta-networking/recipes-extended/kronosnet/kronosnet/0001-libknet-tests-Correct-include-path-for-poll.h.patch b/meta-networking/recipes-extended/kronosnet/kronosnet/0001-libknet-tests-Correct-include-path-for-poll.h.patch deleted file mode 100644 index 0d261fd4ef..0000000000 --- a/meta-networking/recipes-extended/kronosnet/kronosnet/0001-libknet-tests-Correct-include-path-for-poll.h.patch +++ /dev/null @@ -1,29 +0,0 @@ -From cae68083fda5d4ca832ff3cc8a533454df2efe23 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Tue, 12 Oct 2021 20:35:53 -0700 -Subject: [PATCH] libknet/tests: Correct include path for poll.h - -Fixes -/usr/include/sys/poll.h:1:2: error: redirec -ting incorrect #include <sys/poll.h> to <poll.h> [-Werror,-W#warnings] -| #warning redirecting incorrect #include <sys/poll.h> to <poll.h> - -Upstream-Status: Submitted [https://github.com/kronosnet/kronosnet/pull/363] -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - libknet/tests/test-common.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libknet/tests/test-common.c b/libknet/tests/test-common.c -index 86b76b0..8f8b6ca 100644 ---- a/libknet/tests/test-common.c -+++ b/libknet/tests/test-common.c -@@ -20,7 +20,7 @@ - #include <pthread.h> - #include <dirent.h> - #include <sys/select.h> --#include <sys/poll.h> -+#include <poll.h> - - #include "libknet.h" - #include "test-common.h" 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.22.bb b/meta-networking/recipes-extended/kronosnet/kronosnet_1.24.bb index 28d740cb41..cbd5e7a0fd 100644 --- a/meta-networking/recipes-extended/kronosnet/kronosnet_1.22.bb +++ b/meta-networking/recipes-extended/kronosnet/kronosnet_1.24.bb @@ -5,15 +5,15 @@ 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+ & LGPL-2.1" +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 = "0123ecebce0ad6aba3cdb320027192e15fd71e23" +SRCREV = "f8f80fd7f9b85f2626d2c6452612962ad8efca9e" SRC_URI = "git://github.com/kronosnet/kronosnet;protocol=https;branch=stable1 \ - file://0001-libknet-tests-Correct-include-path-for-poll.h.patch \ + file://0001-links.c-Fix-build-with-gcc-12.patch \ " UPSTREAM_CHECK_URI = "https://github.com/kronosnet/kronosnet/releases" 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..35995f7876 --- /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 ${WORKDIR}/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 ${WORKDIR}/tgtd.service ${D}${systemd_unitdir}/system/tgtd.service + install -d ${D}${sysconfdir}/sysconfig + install -m 0644 ${WORKDIR}/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" + |