Rebase mstflint to latest upstream release v4.8.0-2

Resolves: bz1526293

Signed-off-by: Honggang Li <honli@redhat.com>
This commit is contained in:
Honggang Li 2017-12-15 03:15:50 -05:00
parent 8618aa9e59
commit 2ae396f254
4 changed files with 57 additions and 15 deletions

1
.gitignore vendored
View File

@ -21,3 +21,4 @@ noarch/
/mstflint-4.3.0-1.49.g9b9af70.tar.gz /mstflint-4.3.0-1.49.g9b9af70.tar.gz
/mstflint-4.4.0-1.12.gd1edd58.tar.gz /mstflint-4.4.0-1.12.gd1edd58.tar.gz
/mstflint-4.6.0.tar.gz /mstflint-4.6.0.tar.gz
/mstflint-4.8.0.tar.gz

View File

@ -0,0 +1,33 @@
From 1a097ee9a70a92dd8e81618e42ee3795e2dad004 Mon Sep 17 00:00:00 2001
From: Honggang Li <honli@redhat.com>
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 <honli@redhat.com>
---
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

View File

@ -1,48 +1,56 @@
Name: mstflint Name: mstflint
Summary: Mellanox firmware burning tool Summary: Mellanox firmware burning tool
Version: 4.6.0 Version: 4.8.0
Release: 4%{?dist} Release: 3%{?dist}
License: GPLv2+ or BSD License: GPLv2+ or BSD
Group: Applications/System Group: Applications/System
Source: https://github.com/Mellanox/%{name}/releases/download/v4.6.0-1/%{name}-%{version}.tar.gz Source: https://github.com/Mellanox/%{name}/files/1457191/%{name}-%{version}.tar.gz
Patch1: 0001-Extend-buffer-for-a-few-arrays.patch 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 Url: https://github.com/Mellanox/mstflint
BuildRequires: libstdc++-devel BuildRequires: libstdc++-devel, zlib-devel, libibmad-devel, gcc-c++
BuildRequires: zlib-devel BuildRequires: libcurl-devel, boost-devel, libxml2-devel, openssl-devel
BuildRequires: libibmad-devel >= 1.3.12
Obsoletes: openib-mstflint <= 1.4 openib-tvflash <= 0.9.2 tvflash <= 0.9.0 Obsoletes: openib-mstflint <= 1.4 openib-tvflash <= 0.9.2 tvflash <= 0.9.0
ExcludeArch: s390 %{arm} ExcludeArch: s390 s390x %{arm}
%description %description
This package contains a burning tool for Mellanox manufactured HCA cards. This package contains firmware update tool, vpd dump and register dump tools
It also provides access to the relevant source code. for network adapters based on Mellanox Technologies chips.
%prep %prep
%setup -q %setup -q
%patch1 -p1 %patch1 -p1
%patch2 -p1
find . -type f -iname '*.[ch]' -exec chmod a-x '{}' ';' find . -type f -iname '*.[ch]' -exec chmod a-x '{}' ';'
find . -type f -iname '*.cpp' -exec chmod a-x '{}' ';' find . -type f -iname '*.cpp' -exec chmod a-x '{}' ';'
%build %build
export CFLAGS="$RPM_OPT_FLAGS -Wno-implicit-fallthrough" export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS -std=gnu++98 -Wno-c++11-compat -Wno-implicit-fallthrough" export CXXFLAGS="$RPM_OPT_FLAGS -std=gnu++98 -Wno-c++11-compat"
%configure %configure --enable-fw-mgr
make %make_build
%install %install
make DESTDIR=%{buildroot} install make DESTDIR=%{buildroot} install
# Remove the devel files that we don't ship # Remove the devel files that we don't ship
rm -fr %{buildroot}%{_includedir} rm -fr %{buildroot}%{_includedir}
rm -fr %{buildroot}%{_libdir} find %{buildroot} -type f -name '*.la' -delete
find %{buildroot} -type f -name libmtcr_ul.a -delete
%files %files
%doc README %doc README
%_bindir/* %_bindir/*
%{_sysconfdir}/mstflint
%{_libdir}/mstflint
%{_datadir}/mstflint %{_datadir}/mstflint
%{_mandir}/man1/* %{_mandir}/man1/*
%changelog %changelog
* Fri Dec 15 2017 Honggang Li <honli@redhat.com> - 4.8.0-3
- Rebase mstflint to latest upstream release v4.8.0-2
- Resolves: bz1526293
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.6.0-4 * Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.6.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (mstflint-4.6.0.tar.gz) = aefe60a60bb9d566026f22a420eedda2ac5cf18f05d1c4bf4c351ec740526858acdd2e5a9385af2c4a3f722ce25797b8f3386ac0d577b12d0411857dcddfd835 SHA512 (mstflint-4.8.0.tar.gz) = 76c7aabdc087da86891526145173a7f23482922fdea78a6a1e3decdcb62911e664f10fee97b9c90579797e55d61ae316801eda1ce7d8d246bdebb0fd509265c2