From eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 Mon Sep 17 00:00:00 2001 From: Dave Cobbley Date: Tue, 14 Aug 2018 10:05:37 -0700 Subject: [Subtree] Removing import-layers directory As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley Signed-off-by: Brad Bishop --- ...openiscsiusr-Include-limit.h-for-PATH_MAX.patch | 25 +++++ ...001-qedi.c-Removed-unused-linux-ethtool.h.patch | 25 +++++ ...ude-fcnl.h-for-O_RDWR-and-O_CREAT-definit.patch | 25 +++++ ...openiscsiusr-Add-CFLAGS-to-linker-cmdline.patch | 29 +++++ ...rder-the-includes-to-avoid-duplicate-defi.patch | 49 +++++++++ ...04-fwparam_ppc.c-Do-not-use-__compar_fn_t.patch | 28 +++++ .../files/99_iscsi-initiator-utils | 2 + .../iscsi-initiator-utils/files/initd.debian | 119 +++++++++++++++++++++ .../iscsi-initiator-utils/files/iscsi-initiator | 4 + .../files/iscsi-initiator-targets.service | 15 +++ .../files/iscsi-initiator.service | 13 +++ .../iscsi-initiator-utils/files/set_initiatorname | 12 +++ .../iscsi-initiator-utils_2.0.876.bb | 117 ++++++++++++++++++++ 13 files changed, 463 insertions(+) create mode 100644 meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-libopeniscsiusr-Include-limit.h-for-PATH_MAX.patch create mode 100644 meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-qedi.c-Removed-unused-linux-ethtool.h.patch create mode 100644 meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-idbm.c-Include-fcnl.h-for-O_RDWR-and-O_CREAT-definit.patch create mode 100644 meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-libopeniscsiusr-Add-CFLAGS-to-linker-cmdline.patch create mode 100644 meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0003-bnx2x.c-Reorder-the-includes-to-avoid-duplicate-defi.patch create mode 100644 meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-fwparam_ppc.c-Do-not-use-__compar_fn_t.patch create mode 100644 meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils create mode 100644 meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian create mode 100644 meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator create mode 100644 meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service create mode 100644 meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service create mode 100644 meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/set_initiatorname create mode 100644 meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.876.bb (limited to 'meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils') diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-libopeniscsiusr-Include-limit.h-for-PATH_MAX.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-libopeniscsiusr-Include-limit.h-for-PATH_MAX.patch new file mode 100644 index 000000000..f5e1bec8a --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-libopeniscsiusr-Include-limit.h-for-PATH_MAX.patch @@ -0,0 +1,25 @@ +From cfee58d5863a535b61aa54690ae205b876f57944 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 2 Feb 2018 22:53:29 -0800 +Subject: [PATCH 1/2] libopeniscsiusr: Include limit.h for PATH_MAX + +Signed-off-by: Khem Raj +--- + libopeniscsiusr/iface.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libopeniscsiusr/iface.c b/libopeniscsiusr/iface.c +index 79898df..a48ef36 100644 +--- a/libopeniscsiusr/iface.c ++++ b/libopeniscsiusr/iface.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + + #include "libopeniscsiusr/libopeniscsiusr.h" + #include "misc.h" +-- +2.16.1 + diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-qedi.c-Removed-unused-linux-ethtool.h.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-qedi.c-Removed-unused-linux-ethtool.h.patch new file mode 100644 index 000000000..174aa50d2 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-qedi.c-Removed-unused-linux-ethtool.h.patch @@ -0,0 +1,25 @@ +From 197713ad7e3e944102bbd792e1ab9ec4a67100c0 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 2 Feb 2018 23:25:21 -0800 +Subject: [PATCH 1/4] qedi.c: Removed unused linux/ethtool.h + +Signed-off-by: Khem Raj +--- + iscsiuio/src/unix/libs/qedi.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/iscsiuio/src/unix/libs/qedi.c b/iscsiuio/src/unix/libs/qedi.c +index b81fecd..24cb89a 100644 +--- a/iscsiuio/src/unix/libs/qedi.c ++++ b/iscsiuio/src/unix/libs/qedi.c +@@ -49,7 +49,6 @@ + #include + #include + #include +-#include + #include + #include + #include +-- +2.16.1 + diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-idbm.c-Include-fcnl.h-for-O_RDWR-and-O_CREAT-definit.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-idbm.c-Include-fcnl.h-for-O_RDWR-and-O_CREAT-definit.patch new file mode 100644 index 000000000..aecede6ee --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-idbm.c-Include-fcnl.h-for-O_RDWR-and-O_CREAT-definit.patch @@ -0,0 +1,25 @@ +From 2b39f85dcf020647544002cb0b0e734748391dfb Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 2 Feb 2018 23:27:25 -0800 +Subject: [PATCH 2/4] idbm.c: Include fcnl.h for O_RDWR and O_CREAT definitions + +Signed-off-by: Khem Raj +--- + usr/idbm.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/usr/idbm.c b/usr/idbm.c +index 5532202..0a51b85 100644 +--- a/usr/idbm.c ++++ b/usr/idbm.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + #include + +-- +2.16.1 + diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-libopeniscsiusr-Add-CFLAGS-to-linker-cmdline.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-libopeniscsiusr-Add-CFLAGS-to-linker-cmdline.patch new file mode 100644 index 000000000..836ed6048 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-libopeniscsiusr-Add-CFLAGS-to-linker-cmdline.patch @@ -0,0 +1,29 @@ +From 29571f71692e28ce9a17d1450097a98492f3b465 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 2 Feb 2018 22:54:04 -0800 +Subject: [PATCH 2/2] libopeniscsiusr: Add CFLAGS to linker cmdline + +This will ensure that -fPIC is passed to linker as +well + +Signed-off-by: Khem Raj +--- + libopeniscsiusr/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libopeniscsiusr/Makefile b/libopeniscsiusr/Makefile +index 8b9b523..4f1d0d6 100644 +--- a/libopeniscsiusr/Makefile ++++ b/libopeniscsiusr/Makefile +@@ -49,7 +49,7 @@ LIBADD = + all: $(LIBS) $(LIBS_MAJOR) $(TESTS) doc + + $(LIBS): $(OBJS) +- $(CC) $(LDFLAGS) -shared -Wl,-soname=$@ -o $@ $(OBJS) $(LIBADD) ++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname=$@ -o $@ $(OBJS) $(LIBADD) + ln -sf $@ $(DEVLIB) + + $(LIBS_MAJOR): $(LIBS) +-- +2.16.1 + diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0003-bnx2x.c-Reorder-the-includes-to-avoid-duplicate-defi.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0003-bnx2x.c-Reorder-the-includes-to-avoid-duplicate-defi.patch new file mode 100644 index 000000000..0ce155f7a --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0003-bnx2x.c-Reorder-the-includes-to-avoid-duplicate-defi.patch @@ -0,0 +1,49 @@ +From 9b7a32903b56ce4d41f264a345ca59a0b00d53b3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 2 Feb 2018 23:28:33 -0800 +Subject: [PATCH 3/4] bnx2x.c: Reorder the includes to avoid duplicate defines + with musl + +including nic.h before linux/ethtool.h avoids redefinitions of +eth structs + +/mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/iscsi-initiator-utils/2.0.876-r0/recipe-sysroot/ +usr/include/netinet/if_ether.h:104:8: error: redefinition of 'struct ethhdr' + struct ethhdr { + ^~~~~~ +In file included from /mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/iscsi-initiator-utils/2.0. +876-r0/recipe-sysroot/usr/include/linux/ethtool.h:19:0, + from qedi.c:52: +/mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/iscsi-initiator-utils/2.0.876-r0/recipe-sysroot/ +usr/include/linux/if_ether.h:154:8: note: originally defined here + struct ethhdr { + ^~~~~~ + +Signed-off-by: Khem Raj +--- + iscsiuio/src/unix/libs/bnx2x.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/iscsiuio/src/unix/libs/bnx2x.c b/iscsiuio/src/unix/libs/bnx2x.c +index 3df6d5f..62530d1 100644 +--- a/iscsiuio/src/unix/libs/bnx2x.c ++++ b/iscsiuio/src/unix/libs/bnx2x.c +@@ -36,6 +36,7 @@ + * bnx2x.c - bnx2x user space driver + * + */ ++#include "nic.h" + #include + #include + #include +@@ -58,7 +59,6 @@ + #include "bnx2x.h" + #include "cnic.h" + #include "logger.h" +-#include "nic.h" + #include "nic_id.h" + #include "nic_utils.h" + #include "options.h" +-- +2.16.1 + diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-fwparam_ppc.c-Do-not-use-__compar_fn_t.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-fwparam_ppc.c-Do-not-use-__compar_fn_t.patch new file mode 100644 index 000000000..57bdc8cb6 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-fwparam_ppc.c-Do-not-use-__compar_fn_t.patch @@ -0,0 +1,28 @@ +From 6f9c1a04d250388d1574cfaf20a1ff66a64beb48 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 2 Feb 2018 23:42:12 -0800 +Subject: [PATCH 4/4] fwparam_ppc.c: Do not use __compar_fn_t + +__compar_fn_t is not defined in musl + +Signed-off-by: Khem Raj +--- + utils/fwparam_ibft/fwparam_ppc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/utils/fwparam_ibft/fwparam_ppc.c b/utils/fwparam_ibft/fwparam_ppc.c +index c298b8c..391faa2 100644 +--- a/utils/fwparam_ibft/fwparam_ppc.c ++++ b/utils/fwparam_ibft/fwparam_ppc.c +@@ -356,7 +356,7 @@ static int loop_devs(const char *devtree) + * Sort the nics into "natural" order. The proc fs + * device-tree has them in somewhat random, or reversed order. + */ +- qsort(niclist, nic_count, sizeof(char *), (__compar_fn_t)nic_cmp); ++ qsort(niclist, nic_count, sizeof(char *), nic_cmp); + + snprintf(prefix, sizeof(prefix), "%s/%s", devtree, "aliases"); + dev_count = 0; +-- +2.16.1 + diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils new file mode 100644 index 000000000..42fdd602f --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils @@ -0,0 +1,2 @@ +# +d root root 0755 /var/lock/iscsi none diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian new file mode 100644 index 000000000..99a763861 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian @@ -0,0 +1,119 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: +# Required-Start: +# Required-Stop: +# Default-Start: +# Default-Stop: +# Short-Description: Starts and stops the iSCSI initiator services and logins to default targets +### END INIT INFO +#set -x +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/iscsid +ADM=/usr/sbin/iscsiadm +PIDFILE=/var/run/iscsid.pid + +[ -x "$DAEMON" ] || exit 0 + +if [ ! -d /sys/class/ ]; then + echo "Failure:" "iSCSI requires a mounted sysfs, not started." + exit 1 +fi + +nodestartup_re='s/^node\.conn\[0]\.startup[ ]*=[ ]*//p' + +RETVAL=0 + +start() { + echo "Starting iSCSI initiator service" "iscsid" + modprobe -q iscsi_tcp 2>/dev/null || : + modprobe -q ib_iser 2>/dev/null || : + if [ ! -f /etc/iscsi/initiatorname.iscsi ]; then + INITIATORNAME=$(iscsi-iname) + cat >/etc/iscsi/initiatorname.iscsi </dev/null + if [ "$?" -ne "0" -a "$?" -ne "1" ]; then + status=1 + fi + modprobe -r iscsi_tcp 2>/dev/null + if [ "$?" -ne "0" -a "$?" -ne "1" ]; then + status=1 + fi +} + +restart() { + stop + if [ $RETVAL -ne 0 ]; then + echo "Failure:" "Stopping iSCSI initiator service failed, not starting" + return $RETVAL + fi + start +} + +restarttargets() { + stoptargets + if [ $RETVAL -ne 0 ]; then + echo "Failure:" "Could not stop all targets, try again later" + return $RETVAL + fi + starttargets +} + +status() { + #XXX FIXME: what to do here? + #status iscsid + # list active sessions + echo Current active iSCSI sessions: + $ADM -m session +} + +case "$1" in + start|starttargets|stop|stoptargets|restart|restarttargets|status) + $1 + ;; + *) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac +exit $RETVAL diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator new file mode 100644 index 000000000..7fa49a2d6 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator @@ -0,0 +1,4 @@ +# default command line settings for open-iscsi's iscsid + +OPTS_ISCSID="" +OPTS_ISCSIADM="" diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service new file mode 100644 index 000000000..564b2d21d --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service @@ -0,0 +1,15 @@ +[Unit] +Description=Open-iSCSI initiator (i.e. client) target bindings +After=iscsi-initiator.service +Requires=iscsi-initiator.service + +[Service] +Type=oneshot +EnvironmentFile=/etc/default/iscsi-initiator +ExecStart=/usr/sbin/iscsiadm -m node --loginall=automatic $OPTS_ISCSIADM +ExecStop=/usr/sbin/iscsiadm -m node --logoutall=all $OPTS_ISCSIADM +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target + diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service new file mode 100644 index 000000000..3790daebd --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service @@ -0,0 +1,13 @@ +[Unit] +Description=Open-iSCSI initiator (i.e. client) service +After=syslog.target + +[Service] +EnvironmentFile=/etc/default/iscsi-initiator +ExecStartPre=/sbin/modprobe iscsi_tcp +ExecStartPre=/usr/lib/iscsi/set_initiatorname +ExecStart=/usr/sbin/iscsid -f $OPTS_ISCSID + +[Install] +WantedBy=multi-user.target + diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/set_initiatorname b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/set_initiatorname new file mode 100644 index 000000000..a196c6b79 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/set_initiatorname @@ -0,0 +1,12 @@ +#!/bin/sh +if [ ! -f /etc/iscsi/initiatorname.iscsi ]; then + INITIATORNAME=$(iscsi-iname) + cat >/etc/iscsi/initiatorname.iscsi < ${D}${sysconfdir}/tmpfiles.d/iscsi.conf + install -d ${D}/etc/default/ + install -p -m 755 ${WORKDIR}/iscsi-initiator ${D}${sysconfdir}/default/ + + install -d ${D}${systemd_unitdir}/system/ + install -m 0644 ${WORKDIR}/iscsi-initiator.service \ + ${WORKDIR}/iscsi-initiator-targets.service \ + ${D}${systemd_unitdir}/system/ + install -d ${D}${nonarch_libdir}/iscsi + install -m 0755 ${WORKDIR}/set_initiatorname ${D}${nonarch_libdir}/iscsi + else + install -d ${D}/etc/default/volatiles + install -m 0644 ${WORKDIR}/99_iscsi-initiator-utils ${D}/etc/default/volatiles + fi +} + +pkg_postinst_${PN}() { + if [ "x$D" = "x" ]; then + if [ -e /etc/init.d/populate-volatile.sh ]; then + /etc/init.d/populate-volatile.sh update + elif command -v systemd-tmpfiles >/dev/null; then + systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/iscsi.conf + fi + fi +} + +SYSTEMD_SERVICE = " iscsi-initiator.service iscsi-initiator-targets.service " +INITSCRIPT_NAME = "iscsid" +INITSCRIPT_PARAMS = "start 30 1 2 3 4 5 . stop 70 0 1 2 3 4 5 6 ." + +FILES_${PN} += "${nonarch_libdir}/iscsi" -- cgit v1.2.1