Accepting request 813010 from network:fcoe

OBS-URL: https://build.opensuse.org/request/show/813010
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/fcoe-utils?expand=0&rev=18
This commit is contained in:
2020-06-11 12:46:53 +00:00
committed by Git OBS Bridge
14 changed files with 45 additions and 436 deletions

View File

@@ -1,31 +0,0 @@
From 4cb4df057df03ce1ccc81b2778b5090d1443ae15 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Fri, 21 Mar 2014 14:46:40 +0100
Subject: systemctl cannot start fcoemon.socket
systemctl start fcoemon.socket fails, as systemd cannot find
the referenced service.
References: bnc#869392
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
etc/systemd/fcoemon.socket | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/etc/systemd/fcoemon.socket b/etc/systemd/fcoemon.socket
index 4de8715..fdf7141 100644
--- a/etc/systemd/fcoemon.socket
+++ b/etc/systemd/fcoemon.socket
@@ -1,4 +1,8 @@
+[Unit]
+Description=Open-FCoE daemon control socket
+
[Socket]
+Service=fcoe.service
ListenDatagram=@/com/intel/fcoemon
PassCredentials=true
--
1.8.4.5

View File

@@ -1,121 +0,0 @@
From 1e3d735a5cd1edefaeff75c43aed68661b8cda7e Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Fri, 11 Apr 2014 15:38:26 +0200
Subject: fcoemon: Correctly handle options in the service file
When runnig under systemd we can't really modify the arguments
to provide an 'FCOEMON_OPTS' variable. Instead we should be
modifying fcoemon --debug and --syslog to accept 'yes' or 'no'
as parameters; that way we can use the variables directly.
References: bnc#872732
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
doc/fcoemon.txt | 6 +++---
etc/systemd/fcoe.service | 4 ++--
fcoemon.c | 24 +++++++++++++++---------
3 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/doc/fcoemon.txt b/doc/fcoemon.txt
index 7ccf892..7449601 100644
--- a/doc/fcoemon.txt
+++ b/doc/fcoemon.txt
@@ -53,13 +53,13 @@ OPTIONS
-------
*-f*, *--foreground*::
Run *fcoemon* in the foreground.
-*-d*, *--debug*::
- Enable debugging messages.
+*-d*, *--debug=yes|no*::
+ Enable or disable debugging messages.
*-l*, *--legacy*::
Force fcoemon to use the legacy /sys/module/libfcoe/parameters/
interface. The default is to use the newer /sys/bus/fcoe/ interfaces
if they are available.
-*-s*, *--syslog*::
+*-s*, *--syslog=yes|no*::
Use syslogd for logging. The default behavior is to log to stdout
and stderr.
*-h*, *--help*::
diff --git a/etc/systemd/fcoe.service b/etc/systemd/fcoe.service
index 5e5c8a2..2e10bcd 100644
--- a/etc/systemd/fcoe.service
+++ b/etc/systemd/fcoe.service
@@ -4,9 +4,9 @@ After=syslog.target network.target
[Service]
Type=simple
-EnvironmentFile=/etc/sysconfig/fcoe
+EnvironmentFile=/etc/fcoe/config
ExecStartPre=/sbin/modprobe -qa $SUPPORTED_DRIVERS
-ExecStart=/usr/sbin/fcoemon $FCOEMON_OPTS
+ExecStart=/usr/sbin/fcoemon --debug=$DEBUG --syslog=$SYSLOG
[Install]
WantedBy=multi-user.target
diff --git a/fcoemon.c b/fcoemon.c
index c0af99b..3ccdd5f 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -336,9 +336,9 @@ static int fcoe_vid_from_ifname(const char *ifname);
* Table for getopt_long(3).
*/
static struct option fcm_options[] = {
- {"debug", 0, NULL, 'd'},
+ {"debug", 1, NULL, 'd'},
{"legacy", 0, NULL, 'l'},
- {"syslog", 0, NULL, 's'},
+ {"syslog", 1, NULL, 's'},
{"exec", 1, NULL, 'e'},
{"foreground", 0, NULL, 'f'},
{"version", 0, NULL, 'v'},
@@ -3229,9 +3229,9 @@ static void fcm_usage(void)
{
printf("Usage: %s\n"
"\t [-f|--foreground]\n"
- "\t [-d|--debug]\n"
+ "\t [-d|--debug=yes|no]\n"
"\t [-l|--legacy]\n"
- "\t [-s|--syslog]\n"
+ "\t [-s|--syslog=yes|no]\n"
"\t [-v|--version]\n"
"\t [-h|--help]\n\n", progname);
exit(1);
@@ -3685,22 +3685,28 @@ int main(int argc, char **argv)
sa_log_flags = 0;
openlog(sa_log_prefix, LOG_CONS, LOG_DAEMON);
- while ((c = getopt_long(argc, argv, "fdhlsv",
+ while ((c = getopt_long(argc, argv, "fd:hls:v",
fcm_options, NULL)) != -1) {
switch (c) {
case 'f':
fcm_fg = 1;
break;
case 'd':
- fcoe_config.debug = 1;
- enable_debug_log(1);
+ if (!strncmp(optarg, "yes", 3) ||
+ !strncmp(optarg, "YES", 3)) {
+ fcoe_config.debug = 1;
+ enable_debug_log(1);
+ }
break;
case 'l':
force_legacy = true;
break;
case 's':
- fcoe_config.use_syslog = 1;
- enable_syslog(1);
+ if (!strncmp(optarg, "yes", 3) ||
+ !strncmp(optarg, "YES", 3)) {
+ fcoe_config.use_syslog = 1;
+ enable_syslog(1);
+ }
break;
case 'v':
printf("%s\n", FCOE_UTILS_VERSION);
--
1.8.4.5

View File

@@ -1,33 +0,0 @@
From 475d3e782f84beec9ce7b4557f2444df0e2f914f Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Wed, 16 Apr 2014 13:30:47 +0200
Subject: fcoe.service: Add '--foreground' to prevent fcoemon to be killed
fcoemon is running as a daemon per default, so when using
Type=simple in the service file systemd will kill the fcoemon
daemon immediately as it just sees the return code from the
first fork() call.
References: bnc#873269
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
etc/systemd/fcoe.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/etc/systemd/fcoe.service b/etc/systemd/fcoe.service
index 2e10bcd..b1d9567 100644
--- a/etc/systemd/fcoe.service
+++ b/etc/systemd/fcoe.service
@@ -6,7 +6,7 @@ After=syslog.target network.target
Type=simple
EnvironmentFile=/etc/fcoe/config
ExecStartPre=/sbin/modprobe -qa $SUPPORTED_DRIVERS
-ExecStart=/usr/sbin/fcoemon --debug=$DEBUG --syslog=$SYSLOG
+ExecStart=/usr/sbin/fcoemon --foreground --debug=$DEBUG --syslog=$SYSLOG
[Install]
WantedBy=multi-user.target
--
1.8.4.5

View File

@@ -1,38 +0,0 @@
From 28c841380880fb95f3096c42dc89fa0487504a45 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 13 May 2014 09:44:17 +0200
Subject: fipvlan: fixup return value on error
fipvlan should return 1 on error or ENODEV (=19) if no interfaces
were found.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
fipvlan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fipvlan.c b/fipvlan.c
index 2059276..a8d18b7 100644
--- a/fipvlan.c
+++ b/fipvlan.c
@@ -981,7 +981,7 @@ int main(int argc, char **argv)
ns = rtnl_socket(RTMGRP_LINK);
if (ns < 0) {
- rc = ns;
+ rc = 1;
goto ns_err;
}
pfd_add(ns);
@@ -1001,7 +1001,7 @@ int main(int argc, char **argv)
"no interfaces to perform discovery on");
else
FIP_LOG("no interfaces to perform discovery on");
- exit(1);
+ exit(ENODEV);
}
do_vlan_discovery();
--
2.6.6

View File

@@ -1,31 +0,0 @@
From 7f267031c30b6bc9fe708efac4d00060c583ae64 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Mon, 28 Jul 2014 11:24:19 +0200
Subject: Use correct socket for fcoemon.socket
fcoeadm/fcoemon is using a socket 'fcm_clif', so we need to
refer to that one in fcoemon.socket.
References: bnc#881205
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
etc/systemd/fcoemon.socket | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/etc/systemd/fcoemon.socket b/etc/systemd/fcoemon.socket
index fdf7141..6768515 100644
--- a/etc/systemd/fcoemon.socket
+++ b/etc/systemd/fcoemon.socket
@@ -3,7 +3,7 @@ Description=Open-FCoE daemon control socket
[Socket]
Service=fcoe.service
-ListenDatagram=@/com/intel/fcoemon
+ListenDatagram=@fcm_clif
PassCredentials=true
[Install]
--
1.8.4.5

View File

@@ -1,23 +0,0 @@
From: Johannes Thumshirn <jthumshirn@suse.de>
Date: Tue Apr 11 11:08:13 CEST 2017
Subject: Disable Werror building
Disbale the -Werror compiler flag due to a new warning in GCC 7. Although the
warning is legitim it is a false positive in this place.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,7 @@ sbin_PROGRAMS = fcoeadm fcoemon fcping f
AM_CPPFLAGS = -I${srcdir}/include -I${builddir}/include
## pass the sysconfdir into the C proprocessor
AM_CPPFLAGS += -DSYSCONFDIR="\"${sysconfdir}\"" -D_FORTIFY_SOURCE=2
-AM_CFLAGS = -Wall -Wformat=2 -Werror -Wmissing-prototypes -Wstrict-prototypes
+AM_CFLAGS = -Wall -Wformat=2 -Wmissing-prototypes -Wstrict-prototypes
## rules for building fcoeadm
fcoeadm_SOURCES = fcoeadm.c fcoeadm_display.c

View File

@@ -1,61 +0,0 @@
From e21f1ac46b9672824e00ad907ee0443af2dbad66 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 28 Jun 2016 14:10:38 +0200
Subject: fcoemon: Retry fcm_link_getlink() on EBUSY
If netlink returns -EBUSY as NLMSG_ERROR code there was another
callback running on that socket. So we can simply retry here.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
fcoemon.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/fcoemon.c b/fcoemon.c
index 58137df..32ba30c 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -750,7 +750,7 @@ static void fcm_fc_event_handler(struct fc_nl_event *fc_event)
}
}
-static void log_nlmsg_error(struct nlmsghdr *hp, size_t rlen, const char *str)
+static int log_nlmsg_error(struct nlmsghdr *hp, size_t rlen, const char *str)
{
struct nlmsgerr *ep;
@@ -758,8 +758,10 @@ static void log_nlmsg_error(struct nlmsghdr *hp, size_t rlen, const char *str)
ep = (struct nlmsgerr *)NLMSG_DATA(hp);
FCM_LOG_DBG("%s, err=%d, type=%d\n",
str, ep->error, ep->msg.nlmsg_type);
+ return ep->error;
} else {
FCM_LOG("%s", str);
+ return 0;
}
}
@@ -1873,7 +1875,7 @@ static void fcm_link_recv(UNUSED void *arg)
break;
if (hp->nlmsg_type == NLMSG_ERROR) {
- log_nlmsg_error(hp, rlen, "nlmsg error");
+ rc = log_nlmsg_error(hp, rlen, "nlmsg error");
break;
}
@@ -1904,6 +1906,11 @@ static void fcm_link_recv(UNUSED void *arg)
break;
}
}
+ if (rc == -EBUSY) {
+ FCM_LOG_DBG("%s: netlink returned -EBUSY, retry\n",
+ __func__);
+ fcm_link_getlink();
+ }
}
/*
--
2.6.6

View File

@@ -1,10 +1,10 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="url">https://github.com/morbidrsa/fcoe-utils.git</param>
<param name="url">https://github.com/openSUSE/fcoe-utils.git</param>
<param name="scm">git</param>
<param name="filename">fcoe-utils</param>
<param name="versionformat">1.0.32</param>
<param name="revision">v1.0.32</param>
<param name="versionformat">1.0.33</param>
<param name="revision">v1.0.33</param>
<param name="exclude">.git</param>
</service>
<service name="recompress" mode="disabled">

View File

@@ -1,15 +0,0 @@
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,7 +2,7 @@
sbin_PROGRAMS = fcoeadm fcoemon fcping fipvlan fcnsq fcrls
## all targets should look for headers in the include directory
-AM_CPPFLAGS = -I${srcdir}/include -I${builddir}/include
+AM_CPPFLAGS = -I${srcdir}/include -I${builddir}/include -I/lib/modules/`rpm -q --list kernel | grep "^/lib/modules/.*/build$$" | cut -f4 -d"/" | sort -r | head -1`/build/include
## pass the sysconfdir into the C proprocessor
AM_CPPFLAGS += -DSYSCONFDIR="\"${sysconfdir}\"" -D_FORTIFY_SOURCE=2
AM_CFLAGS = -Wall -Wformat=2 -Wmissing-prototypes -Wstrict-prototypes

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7d04e4ae49ecaab9971c84de0cfa4d427110f3ecad0a0ceda2a663bbd7577079
size 121536

3
fcoe-utils-1.0.33.tar.xz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:55fcb7ba7d6605b7db9347ca72dc721e87b615064f83f694bd677d56675b331a
size 121980

View File

@@ -1,42 +0,0 @@
diff -aurp fcoe-utils-1.0.32.orig/debug/dcbcheck.sh fcoe-utils-1.0.32/debug/dcbcheck.sh
--- fcoe-utils-1.0.32.orig/debug/dcbcheck.sh 2017-01-17 04:19:20.000000000 -0800
+++ fcoe-utils-1.0.32/debug/dcbcheck.sh 2020-04-02 18:44:06.511563546 -0700
@@ -27,7 +27,7 @@ if [ "${IFNAME}" == "" ] ; then
fi
# Ensure that the interface name provided is valid
-if ifconfig ${IFNAME} 2>&1 | grep -q "Device not found" ; then
+if ip link show dev ${IFNAME} 2>&1 | grep -q "does not exist" ; then
echo "Please provide a valid interface name." >&2
exit 1
fi
Only in fcoe-utils-1.0.32.orig/debug: .dcbcheck.sh.swp
diff -aurp fcoe-utils-1.0.32.orig/debug/fcoedump.sh fcoe-utils-1.0.32/debug/fcoedump.sh
--- fcoe-utils-1.0.32.orig/debug/fcoedump.sh 2017-01-17 04:19:20.000000000 -0800
+++ fcoe-utils-1.0.32/debug/fcoedump.sh 2020-04-02 18:43:46.195599808 -0700
@@ -78,8 +78,10 @@ adapter_info()
ethtool -i $DEVICE
echo -e "#ethtool offloads:"
ethtool -k $DEVICE
- echo -e "#ifconfig:"
- ifconfig $DEVICE
+ echo -e "#ip link:"
+ ip link show dev $DEVICE
+ echo -e "#ip addr:"
+ ip addr show dev $DEVICE
fi
echo -e "\n###Adapter INFO $PHYSDEV"
@@ -93,8 +95,10 @@ adapter_info()
ethtool -k $PHYSDEV
echo -e "#ethtool stats:"
ethtool -S $PHYSDEV
- echo -e "#ifconfig:"
- ifconfig $PHYSDEV
+ echo -e "#ip link:"
+ ip link show dev $PHYSDEV
+ echo -e "#ip addr:"
+ ip addr show dev $PHYSDEV
}
dcbtool_info()

View File

@@ -1,3 +1,31 @@
-------------------------------------------------------------------
Tue Jun 9 15:57:49 UTC 2020 - Lee Duncan <lduncan@suse.com>
- Updated with latest upstream v1.0.33 from v1.0.32:
* Added "-Wextra" and enabled "-Werror" for compiling
* Ignore auto-generated files
* Update systemd service files (several updates)
* A bunch of gcc-10-related fixes, such as marking unused
arguments, fixing strncpy()s, string truncation/overflow
* better error handling/retry for link issues (like EBUSY)
* replace use of "ifconfig" with "ip" in debug scripts
* fix long-standing issue with netlink buffer resizing
* move bash completions to proper system directory
This replaces fcoe-utils-v1.0.32.tar.xz with
fcoe-utils-v1.0.33.tar.xz, and it does away with the
following patches, since they are all fixed upstream:
* 0003-systemctl-cannot-start-fcoemon.socket.patch
* 0004-fcoemon-Correctly-handle-options-in-the-service-file.patch
* 0005-fcoe.service-Add-foreground-to-prevent-fcoemon-to-be.patch
* 0006-fipvlan-fixup-return-value-on-error.patch
* 0008-Use-correct-socket-for-fcoemon.socket.patch
* 0012-fcoemon-Retry-fcm_link_getlink-on-EBUSY.patch
* fcoe-utils-1.0.29-make.patch
* fcoe-utils-stop-using-ifconfig.patch
And the following patch was removed because we can
successfully compile with "-Werror" now:
* 0009-disable-Werror-building.patch
-------------------------------------------------------------------
Fri Apr 3 01:50:30 UTC 2020 - Lee Duncan <lduncan@suse.com>

View File

@@ -17,7 +17,7 @@
Name: fcoe-utils
URL: http://www.open-fcoe.org
URL: https://github.com/openSUSE/fcoe-utils
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libpciaccess-devel
@@ -25,31 +25,20 @@ BuildRequires: libtool
BuildRequires: open-lldp-devel
BuildRequires: pkg-config
BuildRequires: pkgconfig(libsystemd)
PreReq: %fillup_prereq
Requires: device-mapper
Requires: iproute
Requires: open-lldp
Requires: pkgconfig(systemd)
%systemd_ordering
Version: 1.0.32
Version: 1.0.33
Release: 0
Summary: FCoE userspace management tools
# git://open-fcoe.org/fcoe/fcoe-utils.git
License: GPL-2.0-only
Group: System/Daemons
Source0: %{name}-%{version}.tar.xz
# Patches to be upstreamed
Patch3: 0003-systemctl-cannot-start-fcoemon.socket.patch
Patch4: 0004-fcoemon-Correctly-handle-options-in-the-service-file.patch
Patch5: 0005-fcoe.service-Add-foreground-to-prevent-fcoemon-to-be.patch
Patch6: 0006-fipvlan-fixup-return-value-on-error.patch
Patch8: 0008-Use-correct-socket-for-fcoemon.socket.patch
Patch9: 0009-disable-Werror-building.patch
Patch12: 0012-fcoemon-Retry-fcm_link_getlink-on-EBUSY.patch
Patch15: %{name}-stop-using-ifconfig.patch
# Patches from Fedora
Patch101: fcoe-utils-1.0.29-make.patch
Source: %{name}-%{version}.tar.xz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{?systemd_requires}
%description
Userspace tools to manage FibreChannel over Ethernet (FCoE)
@@ -58,15 +47,6 @@ connections.
%prep
%setup -q
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch8 -p1
%patch9 -p1
%patch12 -p1
%patch15 -p1
%patch101 -p1
%build
autoreconf -vi
@@ -90,21 +70,17 @@ for file in \
done
%pre
%service_add_pre fcoe.service
exit 0
%service_add_pre fcoe.service fcoemon.socket
%post
%service_add_post fcoe.service
%service_add_post fcoe.service fcoemon.socket
%fillup_only -n fcoe
exit 0
%preun
%service_del_preun fcoe.service
exit 0
%service_del_preun fcoe.service fcoemon.socket
%postun
%service_del_postun fcoe.service
exit 0
%service_del_postun fcoe.service fcoemon.socket
%files
%defattr(-,root,root,-)
@@ -117,7 +93,7 @@ exit 0
%{_sysconfdir}/fcoe/
%config(noreplace) %{_sysconfdir}/fcoe/config
%config(noreplace) %{_sysconfdir}/fcoe/cfg-ethx
%config %{_sysconfdir}/bash_completion.d/
%{_datadir}/bash-completion/completions/
%{_libexecdir}/fcoe/
%changelog