diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2045b45 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/mstflint-4.8.0.tar.gz diff --git a/.mstflint.metadata b/.mstflint.metadata new file mode 100644 index 0000000..05933a1 --- /dev/null +++ b/.mstflint.metadata @@ -0,0 +1 @@ +be896725828c4274c423ae198efa9f47c7803d7e SOURCES/mstflint-4.8.0.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/0001-Extend-buffer-for-a-few-arrays.patch b/SOURCES/0001-Extend-buffer-for-a-few-arrays.patch new file mode 100644 index 0000000..ffac349 --- /dev/null +++ b/SOURCES/0001-Extend-buffer-for-a-few-arrays.patch @@ -0,0 +1,47 @@ +From b947fc631d499fa6e041b6c460320bcd253f4671 Mon Sep 17 00:00:00 2001 +From: Honggang Li +Date: Wed, 22 Feb 2017 01:42:25 -0500 +Subject: [PATCH] Extend buffer for a few arrays + +Signed-off-by: Honggang Li +--- + mtcr_ul/mtcr_ul_com.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/mtcr_ul/mtcr_ul_com.c b/mtcr_ul/mtcr_ul_com.c +index 50a663f..1335b43 100644 +--- a/mtcr_ul/mtcr_ul_com.c ++++ b/mtcr_ul/mtcr_ul_com.c +@@ -1353,7 +1353,7 @@ int mdevices_v_ul(char *buf, int len, int mask, int verbosity) + } + + char inbuf[64]; +- char fname[64]; ++ char fname[300]; + + d = opendir("/sys/bus/pci/devices"); + if (d == NULL) { +@@ -1369,7 +1369,7 @@ int mdevices_v_ul(char *buf, int len, int mask, int verbosity) + continue; + } else if (sz > 4 && strcmp(dir->d_name + sz - 4, "00.0") && !verbosity) { + // Skip virtual functions +- char physfn[64]; ++ char physfn[300]; + DIR* physfndir; + sprintf(physfn, "/sys/bus/pci/devices/%s/physfn", dir->d_name); + if ((physfndir = opendir(physfn)) != NULL) { +@@ -1993,9 +1993,9 @@ int mclose_ul(mfile *mf) + return 0; + } + +-#define IBDR_MAX_NAME_SIZE 128 ++#define IBDR_MAX_NAME_SIZE 300 + #define BDF_NAME_SIZE 12 +-#define DEV_DIR_MAX_SIZE 128 ++#define DEV_DIR_MAX_SIZE 300 + static + int get_inband_dev_from_pci(char* inband_dev, char* pci_dev) + { +-- +2.7.4 + diff --git a/SOURCES/0001-Return-zero-when-fread-reach-the-end-of-vpd-file.patch b/SOURCES/0001-Return-zero-when-fread-reach-the-end-of-vpd-file.patch new file mode 100644 index 0000000..e69a33d --- /dev/null +++ b/SOURCES/0001-Return-zero-when-fread-reach-the-end-of-vpd-file.patch @@ -0,0 +1,33 @@ +From 1a097ee9a70a92dd8e81618e42ee3795e2dad004 Mon Sep 17 00:00:00 2001 +From: Honggang Li +Date: Wed, 6 Dec 2017 23:59:43 -0500 +Subject: [PATCH] Return zero when fread reach the end of vpd file + +Fixes: 4201e56ec8e8 (Title: use mvpd in mstvpd) +Signed-off-by: Honggang Li +--- + mtcr_ul/mtcr_ul_com.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/mtcr_ul/mtcr_ul_com.c b/mtcr_ul/mtcr_ul_com.c +index ddafd0a..9f328b5 100644 +--- a/mtcr_ul/mtcr_ul_com.c ++++ b/mtcr_ul/mtcr_ul_com.c +@@ -2575,9 +2575,11 @@ int mvpd_read4_ul_int(mfile *mf, unsigned int offset, u_int8_t value[4]){ + return errno; + } + if (fread(value, 1, 4, f) < 1) { +- //fprintf(stderr, "Failed to read from (%s): %s\n", proc_dev, strerror(errno)); +- fclose(f); +- return errno; ++ if (!feof(f)) { ++ //fprintf(stderr, "Failed to read from (%s): %s\n", proc_dev, strerror(errno)); ++ fclose(f); ++ return errno; ++ } + } + fclose(f); + return 0; +-- +1.8.3.1 + diff --git a/SPECS/mstflint.spec b/SPECS/mstflint.spec new file mode 100644 index 0000000..26888f2 --- /dev/null +++ b/SPECS/mstflint.spec @@ -0,0 +1,160 @@ +Name: mstflint +Summary: Mellanox firmware burning tool +Version: 4.8.0 +Release: 3%{?dist} +License: GPLv2+ or BSD +Group: Applications/System +Source: https://github.com/Mellanox/%{name}/files/1457191/%{name}-%{version}.tar.gz +Patch1: 0001-Extend-buffer-for-a-few-arrays.patch +Patch2: 0001-Return-zero-when-fread-reach-the-end-of-vpd-file.patch +Url: https://github.com/Mellanox/mstflint +BuildRequires: libstdc++-devel, zlib-devel, libibmad-devel +BuildRequires: libcurl-devel, boost-devel, libxml2-devel, openssl-devel +Obsoletes: openib-mstflint <= 1.4 openib-tvflash <= 0.9.2 tvflash <= 0.9.0 +ExcludeArch: s390 s390x + +%description +This package contains firmware update tool, vpd dump and register dump tools +for network adapters based on Mellanox Technologies chips. + +%prep +%setup -q +%patch1 -p1 +%patch2 -p1 +find . -type f -iname '*.[ch]' -exec chmod a-x '{}' ';' +find . -type f -iname '*.cpp' -exec chmod a-x '{}' ';' + +%build +export CFLAGS="$RPM_OPT_FLAGS" +export CXXFLAGS="$RPM_OPT_FLAGS -std=gnu++98 -Wno-c++11-compat" +%configure --enable-fw-mgr +%make_build + +%install +make DESTDIR=%{buildroot} install +# Remove the devel files that we don't ship +rm -fr %{buildroot}%{_includedir} +find %{buildroot} -type f -name '*.la' -delete +find %{buildroot} -type f -name libmtcr_ul.a -delete + +%files +%doc README +%_bindir/* +%{_sysconfdir}/mstflint +%{_libdir}/mstflint + +%{_datadir}/mstflint +%{_mandir}/man1/* + +%changelog +* Thu Dec 7 2017 Honggang Li - 4.8.0-3 +- Fixes mstvpd for mlx5 devices +- Resolves: bz1515993 + +* Sun Nov 12 2017 Honggang Li - 4.8.0-2 +- Remove redundant file from mstflint +- Resolves: bz1512368 + +* Wed Nov 1 2017 Honggang Li - 4.8.0-1 +- Rebase to upstream latest release 4.8.0 +- Resolves: bz1456545 + +* Fri Oct 6 2017 Honggang Li - 4.7.0-1 +- Rebase to upstream latest release 4.7.0 +- Resolves: bz1456545 + +* Tue Mar 7 2017 Honggang Li - 4.6.0-2 +- Fix manpage issues reported by lexgrog. +- Resolves: bz948474 + +* Mon Feb 27 2017 Honggang Li - 4.6.0-1 +- Rebase to latest upstream from github. +- Add man pages. +- Resolves: bz948474, bz1416697 + +* Wed Apr 20 2016 Honggang Li - 4.3.0-1.49.g9b9af70.1 +- Rebase to latest upstream version 4.3.0-1.49.g9b9af70. +- Spec file cleanup. +- Related: bz1277500 + +* Mon Jun 22 2015 Michal Schmidt - 4.0.1-1 +- Update to latest upstream release. +- Related: bz1164542 + +* Fri Oct 17 2014 Doug Ledford - 3.7.1-1 +- Update to latest upstream release for added arch support +- Related: bz1055716 + +* Sat Mar 01 2014 Doug Ledford - 3.5.0-1 +- Update to latest release for ConnectIB fixes +- Resolves: bz1060514 + +* Thu Jan 23 2014 Doug Ledford - 3.0-0.7.g6961daa.2 +- Fix for build on arm arches +- Resolves: bz1055716 + +* Fri Dec 27 2013 Daniel Mach - 3.0-0.7.g6961daa.1 +- Mass rebuild 2013-12-27 + +* Fri Aug 16 2013 Doug Ledford - 3.0-0.6.g6961daa.1 +- Update to latest upstream version, which resovles some licensing issues + on some of the source files + +* Fri Aug 09 2013 Doug Ledford - 3.0-0.5.gff93670.1 +- Update to latest upstream version, which include ConnectIB support + +* Sat Aug 03 2013 Fedora Release Engineering - 1.4-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 1.4-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Fri Jul 20 2012 Fedora Release Engineering - 1.4-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Jan 13 2012 Doug Ledford - 1.4-7 +- The upstream tarball as provided is broken. Clean up the tarball so + the package builds properly + +* Fri Jan 06 2012 Doug Ledford - 1.4-6 +- Initial import into Fedora + +* Wed Oct 26 2011 Doug Ledford - 1.4-5.el6 +- Update to a version that will support the latest Mellanox CX3 hardware +- Resolves: bz748244 + +* Mon Aug 08 2011 Doug Ledford - 1.4-4.el6 +- Fix a bug in mmio space unmapping +- Resolves: bz729061 +- Related: bz725016 + +* Fri Feb 19 2010 Doug Ledford - 1.4-3.el6 +- Don't include mtcr.h as we don't really expect anything to need Mellanox + card register definitions except this program, and we already have the + file. +- Change to ExcludeArch instead of ExclusiveArch so we build in all the right + places. +- Related: bz543948 + +* Mon Jan 25 2010 Doug Ledford - 1.4-2.el6 +- Update to tarball from URL instead of from OFED +- Minor tweaks for pkgwrangler import +- Related: bz543948 + +* Sat Apr 18 2009 Doug Ledford - 1.4-1.el5 +- Update to ofed 1.4.1-rc3 version +- Related: bz459652 + +* Tue Apr 01 2008 Doug Ledford - 1.3-1 +- Update to OFED 1.3 final bits +- Related: bz428197 + +* Sun Jan 27 2008 Doug Ledford - 1.2-2 +- Obsolete the old openib-mstflint package + +* Fri Jan 25 2008 Doug Ledford - 1.2-1 +- Initial import into CVS +- Related: bz428197 + +* Thu Jul 19 2007 - Vladimir Sokolovsky vlad@mellanox.co.il +- Initial Package, Version 1.2