diff --git a/.fcoe-utils.metadata b/.fcoe-utils.metadata new file mode 100644 index 0000000..f48fb13 --- /dev/null +++ b/.fcoe-utils.metadata @@ -0,0 +1 @@ +abe32552df92953875f694960c50a6cd520b50ba SOURCES/fcoe-utils-1.0.29.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/fcoe-utils-1.0.18-help.patch b/SOURCES/fcoe-utils-1.0.18-help.patch new file mode 100644 index 0000000..c9ea696 --- /dev/null +++ b/SOURCES/fcoe-utils-1.0.18-help.patch @@ -0,0 +1,13 @@ +diff --git a/fcnsq.c b/fcnsq.c +index 8722b21..466a85e 100644 +--- a/fcnsq.c ++++ b/fcnsq.c +@@ -360,7 +360,7 @@ static void help(int status) + " --gspn \n" + " --gsnn \n" + "Options:\n" +- " --quiet print minimal results on success, and no error messages\n" ++ " --quiet|-q print minimal results on success, and no error messages\n" + "\n" + "Port IDs and World Wide Names must be specified in hexadecimal.\n" + ); diff --git a/SOURCES/fcoe-utils-1.0.28-format-strings.patch b/SOURCES/fcoe-utils-1.0.28-format-strings.patch new file mode 100644 index 0000000..c519817 --- /dev/null +++ b/SOURCES/fcoe-utils-1.0.28-format-strings.patch @@ -0,0 +1,118 @@ +diff --git a/fcnsq.c b/fcnsq.c +index 45dff40..c5b78b9 100644 +--- a/fcnsq.c ++++ b/fcnsq.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -227,7 +228,7 @@ static int gpn_id(int bsg, u32 fcid) + rjt = gn_id(bsg, fcid, FC_NS_GPN_ID, &wwpn); + if (rjt) + goto fail; +- print_result("Port Name", "%16.16llx\n", wwpn); ++ print_result("Port Name", "%16.16jx\n", (uintmax_t)wwpn); + return 0; + fail: + if (rjt == (u16) ~0) +@@ -248,7 +249,7 @@ static int gnn_id(int bsg, u32 fcid) + rjt = gn_id(bsg, fcid, FC_NS_GNN_ID, &wwnn); + if (rjt) + goto fail; +- print_result("Node Name", "%16.16llx\n", wwnn); ++ print_result("Node Name", "%16.16jx\n", (uintmax_t)wwnn); + return 0; + fail: + if (rjt == (u16) ~0) +@@ -373,11 +374,12 @@ int main(int argc, char *argv[]) + { + char *bsg; + int bsg_dev; +- u32 port_id; +- u64 wwnn; ++ u32 port_id = 0; ++ u64 wwnn = 0; + int rc = 0; + enum commands cmd = 0; + char c; ++ uintmax_t wwnn_tmp = 0; + + while(1) { + c = getopt_long_only(argc, argv, "", options, NULL); +@@ -402,7 +404,8 @@ int main(int argc, char *argv[]) + if (cmd) + help(-1); + cmd = c; +- sscanf(optarg, "%llx", &wwnn); ++ sscanf(optarg, "%jx", &wwnn_tmp); ++ wwnn = (u64)wwnn_tmp; + break; + } + } +diff --git a/fcoeadm_display.c b/fcoeadm_display.c +index e1cbd48..a6cf7a3 100644 +--- a/fcoeadm_display.c ++++ b/fcoeadm_display.c +@@ -1426,8 +1426,8 @@ void print_fcoe_fcf_device(void *ep, void *arg) + if (!buf) + buf = temp; + printf(" Connection Mode: %s\n", buf); +- printf(" Fabric Name: 0x%016lx\n", fcf->fabric_name); +- printf(" Switch Name 0x%016lx\n", fcf->switch_name); ++ printf(" Fabric Name: 0x%016" PRIx64 "\n", fcf->fabric_name); ++ printf(" Switch Name 0x%016" PRIx64 "\n", fcf->switch_name); + mac2str(fcf->mac, mac, MAX_STR_LEN); + printf(" MAC Address: %s\n", mac); + printf(" FCF Priority: %u\n", fcf->priority); +diff --git a/fcoemon.c b/fcoemon.c +index 80360fd..23fae9e 100644 +--- a/fcoemon.c ++++ b/fcoemon.c +@@ -2640,7 +2640,7 @@ static void fcm_dcbd_get_oper(struct fcm_netif *ff, char *resp, char *cp) + + if (ep) { + FCM_LOG_DEV(ff, "Invalid get oper response " +- "parse error byte %ld, resp %s", ep - cp, cp); ++ "parse error byte %td, resp %s", ep - cp, cp); + fcm_dcbd_state_set(ff, FCD_ERROR); + } else { + if (val && fcoe_config.debug) +diff --git a/fcping.c b/fcping.c +index bc51d5f..f92516f 100644 +--- a/fcping.c ++++ b/fcping.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -812,17 +813,17 @@ static void fp_check_data_len() + printf("Maximum ECHO data allowed by the Fabric (0x%06x) : %d bytes.\n" + "Maximum ECHO data allowed by the Source (0x%06x) : %d bytes.\n" + "Maximum ECHO data allowed by the Target (0x%06x) : %d bytes.\n" +- "Maximum ECHO data requested from user input (-s) : %lu " ++ "Maximum ECHO data requested from user input (-s) : %" PRIu32 " " + "(default %d) bytes.\n", + FC_WKA_FABRIC_CONTROLLER, flen, sid, slen, fp_did, dlen, +- fp_len - FP_LEN_ECHO, FP_LEN_DEF); ++ (uint32_t)(fp_len - FP_LEN_ECHO), FP_LEN_DEF); + + /* fp_len is the total payload, including 4 bytes for ECHO command */ + fp_len = MIN(fp_len, plen + FP_LEN_ECHO); +- printf("Actual FC ELS ECHO data size used : %lu bytes.\n" ++ printf("Actual FC ELS ECHO data size used : %" PRIu32 " bytes.\n" + "Actual FC ELS ECHO payload size used : %d bytes " +- "(including %ld bytes ECHO command).\n", +- fp_len - FP_LEN_ECHO, fp_len, FP_LEN_ECHO); ++ "(including %zu bytes ECHO command).\n", ++ (uint32_t)(fp_len - FP_LEN_ECHO), fp_len, FP_LEN_ECHO); + } + + /* diff --git a/SOURCES/fcoe-utils-1.0.28-systemd-doc.patch b/SOURCES/fcoe-utils-1.0.28-systemd-doc.patch new file mode 100644 index 0000000..ada3283 --- /dev/null +++ b/SOURCES/fcoe-utils-1.0.28-systemd-doc.patch @@ -0,0 +1,25 @@ +diff --git a/doc/fcoemon.8 b/doc/fcoemon.8 +index e9a045b..020394e 100644 +--- a/doc/fcoemon.8 ++++ b/doc/fcoemon.8 +@@ -358,7 +358,7 @@ indicates whether a FIP responder should be activated on this device to support + Note that the attached Ethernet peer device (e\&.g\&. FCoE capable switch port) must have compatible settings For DCB and FCoE to function properly\&. + .SS "/etc/init\&.d/fcoe" + .sp +-This is the \fBfcoe\fR system service script\&. This script is invoked by the init process or by the service command to start and stop the \fBfcoemon\fR\&. ++This is the \fBfcoe\fR system service script\&. This script is invoked by the init process or by the service command to start and stop the \fBfcoemon\fR\&. On systemd-enabled systems, \fBfcoemon\fR is controlled via the \fBfcoe.service\fR unit. + .SH "VLAN NAMING CONVENTIONS" + .sp + If a new VLAN device is created (see the description of the \fIAUTO_VLAN\fR setting above), it will have the name \fIdev\fR\&.\fIvlan\fR\-fcoe; where \fIdev\fR is the name of the Ethernet parent device and \fIvlan\fR is the discovered VLAN ID number\&. +diff --git a/doc/fcoemon.txt b/doc/fcoemon.txt +index ec15197..09ee5a2 100644 +--- a/doc/fcoemon.txt ++++ b/doc/fcoemon.txt +@@ -214,6 +214,7 @@ must have compatible settings For DCB and FCoE to function properly. + ~~~~~~~~~~~~~~~~ + This is the *fcoe* system service script. This script is invoked by the + init process or by the service command to start and stop the *fcoemon*. ++On systemd-enabled systems, *fcoemon* is controlled via the *fcoe.service* unit. + + VLAN NAMING CONVENTIONS + ----------------------- diff --git a/SOURCES/fcoe-utils-1.0.29-make.patch b/SOURCES/fcoe-utils-1.0.29-make.patch new file mode 100644 index 0000000..bb9978c --- /dev/null +++ b/SOURCES/fcoe-utils-1.0.29-make.patch @@ -0,0 +1,22 @@ +diff --git a/Makefile.am b/Makefile.am +index 5cbc15f..57bdbdb 100644 +--- 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 -Werror -Wmissing-prototypes -Wstrict-prototypes +@@ -67,7 +67,7 @@ init_d_SCRIPTS = etc/initd/fcoe + + dist_noinst_DATA = README COPYING INSTALL fcoe-utils.spec etc/config + +-BASH_COMPLETION_DIR=/etc/bash_completion.d/ ++BASH_COMPLETION_DIR=${DESTDIR}/etc/bash_completion.d/ + + install-data-hook: + if [ ! -f ${DESTDIR}${fcoe_configdir}/config ] ; then \ diff --git a/SOURCES/fcoe.config b/SOURCES/fcoe.config new file mode 100644 index 0000000..2166c39 --- /dev/null +++ b/SOURCES/fcoe.config @@ -0,0 +1,5 @@ +# All supported drivers listed here are loaded when service starts +SUPPORTED_DRIVERS="libfc fcoe bnx2fc" + +# Add --debug to enable debug messages +FCOEMON_OPTS="--syslog" diff --git a/SOURCES/fcoe.service b/SOURCES/fcoe.service new file mode 100644 index 0000000..8c438c7 --- /dev/null +++ b/SOURCES/fcoe.service @@ -0,0 +1,12 @@ +[Unit] +Description=Open-FCoE Inititator. +After=syslog.target network.target lldpad.service + +[Service] +Type=forking +EnvironmentFile=/etc/sysconfig/fcoe +ExecStartPre=/sbin/modprobe -qa $SUPPORTED_DRIVERS +ExecStart=/usr/sbin/fcoemon $FCOEMON_OPTS + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/quickstart.txt b/SOURCES/quickstart.txt new file mode 100644 index 0000000..fdb6e3f --- /dev/null +++ b/SOURCES/quickstart.txt @@ -0,0 +1,25 @@ +Quick Start guide for Open-FCoE +=============================== + +1. Install fcoe-utils package. This should also install dcbd, libhbaapi and + libhbalinux as dependencies. + +2. Rename /etc/fcoe/cfg-ethx so it corresponds with name of your network + interface (e.g. /etc/fcoe/cfg-eth0). Copy and rename this file accordingly + if you have more interfaces, which should be fcoe-enabled + +3. Modify configuration files to enable FCoE. Set FCOE_ENABLE="yes" and + DCB_REQUIRED="yes". + +3. Run 'systemctl enable fcoe.service' to start FCoE per run level. This + will setup FCoE to start on reboot. + +4. Run 'systemctl enable lldpad.service' to start LLDP agent per run + level. This will setup DCB to start on reboot. + +5. Run 'systemctl start lldpad.service' to start LLDP agent. + +6. Run 'dcbtool sc ethX dcb on; dcbtool sc ethX app:0 e:1;' for each fcoe-enabled + interface to setup DCB for FCoE. + +7. Run 'systemctl start fcoe.sertvice' to start FCoE. diff --git a/SPECS/fcoe-utils.spec b/SPECS/fcoe-utils.spec new file mode 100644 index 0000000..712224f --- /dev/null +++ b/SPECS/fcoe-utils.spec @@ -0,0 +1,284 @@ +# https://fedoraproject.org/wiki/Packaging:Guidelines#Compiler_flags +%define _hardened_build 1 + +Name: fcoe-utils +Version: 1.0.29 +Release: 2%{?dist} +Summary: Fibre Channel over Ethernet utilities +Group: Applications/System +License: GPLv2 +URL: http://www.open-fcoe.org +# git://open-fcoe.org/fcoe/fcoe-utils.git +Source0: %{name}-%{version}.tar.gz +Source1: quickstart.txt +Source2: fcoe.service +Source3: fcoe.config +ExcludeArch: ppc s390 s390x +# Generic Fedora patches +Patch1: fcoe-utils-1.0.29-make.patch +Patch2: fcoe-utils-1.0.18-help.patch +Patch3: fcoe-utils-1.0.28-format-strings.patch +Patch4: fcoe-utils-1.0.28-systemd-doc.patch +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libhbaapi-devel >= 2.2-12 +BuildRequires: libhbalinux-devel >= 1.0.13 +BuildRequires: libtool +BuildRequires: lldpad-devel >= 0.9.43 +BuildRequires: systemd +Requires: lldpad >= 0.9.43 +Requires: libhbalinux >= 1.0.13 +Requires: iproute +Requires: device-mapper-multipath +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd + +%description +Fibre Channel over Ethernet utilities +fcoeadm - command line tool for configuring FCoE interfaces +fcoemon - service to configure DCB Ethernet QOS filters, works with lldpad + +%prep +%setup -q +cp -v %{SOURCE1} quickstart.txt +%patch1 -p1 -b .make +%patch2 -p1 -b .help +%patch3 -p1 -b .format-strings +%patch4 -p1 -b .systemd-doc + +%build +./bootstrap.sh +%configure +make %{?_smp_mflags} + +%install +make install DESTDIR=%{buildroot} +rm -rf %{buildroot}/etc/init.d +mkdir -p %{buildroot}%{_sysconfdir}/sysconfig %{buildroot}%{_unitdir} +install -m 644 %{SOURCE2} %{buildroot}%{_unitdir} +install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/fcoe +mkdir -p %{buildroot}%{_libexecdir}/fcoe +for file in \ + contrib/*.sh \ + debug/*sh + do install -m 755 ${file} %{buildroot}%{_libexecdir}/fcoe/ +done +# We supply our own config for fcoe.service +rm -f %{buildroot}/%{_sysconfdir}/fcoe/config + +%post +%systemd_post fcoe.service + +%preun +%systemd_preun fcoe.service + +%postun +%systemd_postun_with_restart fcoe.service + +%files +%doc README COPYING QUICKSTART quickstart.txt +%{_sbindir}/* +%{_mandir}/man8/* +%{_unitdir}/fcoe.service +%{_sysconfdir}/fcoe/ +%config(noreplace) %{_sysconfdir}/fcoe/cfg-ethx +%config(noreplace) %{_sysconfdir}/sysconfig/fcoe +%{_sysconfdir}/bash_completion.d/ +%{_libexecdir}/fcoe/ + +%changelog +* Thu Nov 07 2013 Petr Šabata - 1.0.29-2 +- Bug #1024124: +- Don't install the old configuration file alongside the new one +- Add bnx2fc to the SUPPORTED_DRIVERS for consistency with previous configuration + +* Thu Aug 29 2013 Petr Šabata - 1.0.29-1 +- 1.0.29 bump + +* Wed Jul 31 2013 Petr Šabata - 1.0.28-4 +- Drop the initscript-specific config patch + +* Wed Jul 31 2013 Petr Šabata - 1.0.28-3 +- Require just 'systemd' instead of 'systemd-units' +- Patch the fcoemon manpage with a note for systemd users + +* Mon Jun 10 2013 Petr Šabata - 1.0.28-2 +- Enhance the format strings patch to fix ppc64 build failures too + +* Tue Jun 04 2013 Petr Šabata - 1.0.28-1 +- 1.0.28 bump + +* Wed Mar 06 2013 Petr Šabata - 1.0.27-1 +- 1.0.27 bump + +* Wed Feb 13 2013 Fedora Release Engineering - 1.0.25-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Jan 09 2013 Petr Šabata - 1.0.25-2 +- Don't build for s390x since it's not supported by kernel either + +* Tue Nov 27 2012 Petr Šabata - 1.0.25-1 +- 1.0.25 (with latest fixes) +- Simplify the spec a bit +- Fix bogus dates in changelog + +* Thu Nov 01 2012 Petr Šabata - 1.0.25-1 + +* Tue Aug 28 2012 Petr Šabata - 1.0.24-2 +- Migrate to systemd scriptlets (#850104) + +* Wed Aug 15 2012 Petr Šabata - 1.0.24-1 +- 1.0.24 bump + +* Mon Jul 23 2012 Petr Šabata - 1.0.23-3 +- Don't exclude s390x. +- Add AM_PROG_AR to configure.ac. + +* Thu Jul 19 2012 Fedora Release Engineering - 1.0.23-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Jun 25 2012 Petr Šabata - 1.0.23-1 +- Update to 1.0.23 +- Re-introduce ExcludeArch to be in line with EL. + +* Thu Feb 16 2012 Petr Šabata - 1.0.22-2 +- Fix the incorrect libhbalinux runtime dependency + +* Mon Jan 23 2012 Petr Šabata - 1.0.22-1 +- 1.0.22 bump +- Remove dcbd from Description + +* Fri Jan 13 2012 Fedora Release Engineering - 1.0.21-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Nov 24 2011 Petr Šabata - 1.0.21-1 +- 1.0.21 bump + +* Mon Oct 31 2011 Petr Sabata - 1.0.20-5 +- Remove useless PIDFile from fcoe.service unit file + +* Thu Oct 06 2011 Petr Sabata - 1.0.20-4 +- Do not enable fcoemon by default (#701999) +- Silence systemctl output + +* Fri Sep 23 2011 Petr Sabata - 1.0.20-3 +- Enable hardened build + +* Mon Jul 18 2011 Petr Sabata - 1.0.20-2 +- Drop SysV support in favor of systemd (#714683) +- Remove ancient scriptlets (pre-1.0.7 era) +- Update quickstart.txt to reflect new changes + +* Thu Jul 07 2011 Petr Sabata - 1.0.20-1 +- 1.0.20 bump + +* Thu Jun 02 2011 Petr Sabata - 1.0.19-1 +- 1.0.19 bump + +* Tue May 3 2011 Petr Sabata - 1.0.18-2 +- fcoemon: Do not create a world and group writable PID file + +* Wed Apr 20 2011 Petr Sabata - 1.0.18-1 +- 1.0.18 bump with latest bugfixes +- Removing ExcludeArch completely; not related for Fedora +- Buildroot cleanup + +* Tue Apr 19 2011 Karsten Hopp 1.0.17-1.1 +- remove excludearch ppc, required by anaconda.ppc + +* Thu Feb 24 2011 Fabio M. Di Nitto - 1.0.17-1 +- Pull in new upstream release (required to build) +- Fix git clone URL in comments +- Drop fcoe-utils-1.0.7-init.patch, fcoe-utils-1.0.7-init-condrestart.patch + and fcoe-utils-1.0.8-init-LSB.patch that are now upstream +- Drop fcoe-utils-1.0.8-includes.patch and use a copy of kernel headers + for all architectures (rename fcoe-sparc.patch to fcoe-include-headers.patch) + Upstream added detection to avoid inclusion of kernel headers in the build + and it expects to find the userland headers installed. Those have not + yet propagated in Fedora. + Use temporary this workaround, since fcoe is a requiment for anaconda + and it failed to build for a while +- Drop BuildRequires on kernel-devel +- Add BuildRequires on autoconf (it is used and not installed by default + on all build chroots) + +* Wed Feb 23 2011 Dennis Gilmore - 1.0.14-5 +- patch in headers used from kernel-devel on 32 bit sparc + +* Tue Feb 08 2011 Fedora Release Engineering - 1.0.14-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Nov 30 2010 Petr Sabata - 1.0.14-3 +- Removing dependency on vconfig, rhbz#658525 + +* Mon Jun 28 2010 Jan Zeleny - 1.0.14-2 +- added device-mapper-multipath to requires (#603242) +- added missing man pages for fcrls, fcnsq and fcping +- update of init script - added condrestart, try-restart + and force-reload options +- added vconfig to requires (#589608) + +* Mon May 24 2010 Jan Zeleny - 1.0.14-1 +- rebased to 1.0.14, see bug #593824 for complete changelog + +* Mon Apr 12 2010 Jan Zeleny - 1.0.13-1 +- rebased to v1.0.13, some bugfixes, new fcoe related scripts + +* Tue Mar 30 2010 Jan Zeleny - 1.0.12-2.20100323git +- some upstream updates +- better fipvlan support +- added fcoe_edd.sh script + +* Tue Mar 16 2010 Jan Zeleny - 1.0.12-1 +- rebased to version 1.0.12, improved functionality with lldpad + and dcbd +- removed /etc/fcoe/scripts/fcoeplumb + +* Thu Dec 10 2009 Jan Zeleny - 1.0.9-2.20091204git +- excluded s390 and ppc + +* Fri Dec 04 2009 Jan Zeleny - 1.0.9-1.20091204git +- rebase to latest version of fcoe-utils + +* Mon Sep 14 2009 Jan Zeleny - 1.0.8-3 +- update of init script to be LSB-compliant + +* Fri Jul 31 2009 Jan Zeleny - 1.0.8-2 +- patch for clean compilation without usage of upstream's ugly hack + +* Thu Jul 30 2009 Jan Zeleny - 1.0.8-1 +- rebase of fcoe-utils to 1.0.8, adjusted spec file + +* Fri Jul 24 2009 Fedora Release Engineering - 1.0.7-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Tue Jun 9 2009 Jan Zeleny - 1.0.7-7 +- added quickstart file to doc (#500759) + +* Thu May 14 2009 Jan Zeleny - 1.0.7-6 +- renamed init script to fcoe, changed lock filename to fcoe + (#497604) +- init script modified to do condrestart properly +- some modifications in spec file to apply previous change + to older versions od init script during update +- fixed issue with accepting long options (#498551) + +* Mon May 4 2009 Jan Zeleny - 1.0.7-5 +- fixed SIGSEGV when fcoe module isn't loaded (#498550) + +* Mon Apr 27 2009 Jan Zeleny - 1.0.7-4 +- added libhbalinux to Requires (#497605) +- correction of spec file (_initddir -> _initrddir) + +* Wed Apr 8 2009 Jan Zeleny - 1.0.7-3 +- more minor corrections in spec file + +* Thu Apr 2 2009 Jan Zeleny - 1.0.7-2 +- minor corrections in spec file +- moved init script to correct location +- correction in the init script (chkconfig directives) + +* Mon Mar 2 2009 Chris Leech - 1.0.7-1 +- initial rpm build of fcoe tools +