|
|
85383d |
%define kmod_name bnxt_en
|
|
|
85383d |
%define kmod_driver_version 1.2.0
|
|
|
85383d |
%define kmod_rpm_release 2
|
|
|
85383d |
%define kmod_git_hash e4188d763070e1b86d0e2d50c5c30ab7ed0c357f
|
|
|
85383d |
%define kmod_kernel_version 3.10.0-327.el7
|
|
|
85383d |
%define kernel_version 3.10.0-327.el7
|
|
|
85383d |
%define kmod_kbuild_dir drivers/net/ethernet/broadcom/bnxt
|
|
|
85383d |
|
|
|
85383d |
|
|
|
85383d |
%{!?dist: %define dist .el7}
|
|
|
85383d |
|
|
|
85383d |
Source0: %{kmod_name}-%{kmod_driver_version}.tar.bz2
|
|
|
85383d |
Source1: %{kmod_name}.files
|
|
|
85383d |
Source2: depmodconf
|
|
|
85383d |
Source3: find-requires.ksyms
|
|
|
85383d |
Source4: find-provides.ksyms
|
|
|
85383d |
Source5: kmodtool
|
|
|
85383d |
Source6: symbols.greylist-x86_64
|
|
|
85383d |
|
|
|
85383d |
Patch0: bnxt_en.patch
|
|
|
85383d |
|
|
|
85383d |
%define __find_requires %_sourcedir/find-requires.ksyms
|
|
|
85383d |
%define __find_provides %_sourcedir/find-provides.ksyms %{kmod_name} %{?epoch:%{epoch}:}%{version}-%{release}
|
|
|
85383d |
|
|
|
85383d |
Name: %{kmod_name}
|
|
|
85383d |
Version: %{kmod_driver_version}
|
|
|
85383d |
Release: %{kmod_rpm_release}%{?dist}
|
|
|
85383d |
Summary: %{kmod_name} kernel module
|
|
|
85383d |
|
|
|
85383d |
Group: System/Kernel
|
|
|
85383d |
License: GPLv2
|
|
|
85383d |
URL: http://www.kernel.org/
|
|
|
85383d |
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
|
|
85383d |
BuildRequires: %kernel_module_package_buildreqs
|
|
|
85383d |
ExclusiveArch: x86_64
|
|
|
85383d |
|
|
|
85383d |
|
|
|
85383d |
# Build only for standard kernel variant(s); for debug packages, append "debug"
|
|
|
85383d |
# after "default" (separated by space)
|
|
|
85383d |
%kernel_module_package -s %{SOURCE5} -f %{SOURCE1} default
|
|
|
85383d |
|
|
|
85383d |
%description
|
|
|
85383d |
%{kmod_name} - driver update
|
|
|
85383d |
|
|
|
85383d |
%prep
|
|
|
85383d |
%setup
|
|
|
85383d |
%patch0 -p1
|
|
|
85383d |
set -- *
|
|
|
85383d |
mkdir source
|
|
|
85383d |
mv "$@" source/
|
|
|
85383d |
cp %{SOURCE6} source/
|
|
|
85383d |
mkdir obj
|
|
|
85383d |
|
|
|
85383d |
%build
|
|
|
85383d |
for flavor in %flavors_to_build; do
|
|
|
85383d |
rm -rf obj/$flavor
|
|
|
85383d |
cp -r source obj/$flavor
|
|
|
85383d |
|
|
|
85383d |
# update symvers file if existing
|
|
|
85383d |
symvers=source/Module.symvers-%{_target_cpu}
|
|
|
85383d |
if [ -e $symvers ]; then
|
|
|
85383d |
cp $symvers obj/$flavor/%{kmod_kbuild_dir}/Module.symvers
|
|
|
85383d |
fi
|
|
|
85383d |
|
|
|
85383d |
make -C %{kernel_source $flavor} M=$PWD/obj/$flavor/%{kmod_kbuild_dir} \
|
|
|
85383d |
NOSTDINC_FLAGS="-I $PWD/obj/$flavor/include"
|
|
|
85383d |
|
|
|
85383d |
# mark modules executable so that strip-to-file can strip them
|
|
|
85383d |
find obj/$flavor/%{kmod_kbuild_dir} -name "*.ko" -type f -exec chmod u+x '{}' +
|
|
|
85383d |
done
|
|
|
85383d |
|
|
|
85383d |
%{SOURCE2} %{name} %{kmod_kernel_version} obj > source/depmod.conf
|
|
|
85383d |
|
|
|
85383d |
greylist=source/symbols.greylist-%{_target_cpu}
|
|
|
85383d |
if [ -f $greylist ]; then
|
|
|
85383d |
cp $greylist source/symbols.greylist
|
|
|
85383d |
else
|
|
|
85383d |
touch source/symbols.greylist
|
|
|
85383d |
fi
|
|
|
85383d |
|
|
|
85383d |
if [ -d source/firmware ]; then
|
|
|
85383d |
make -C source/firmware
|
|
|
85383d |
fi
|
|
|
85383d |
|
|
|
85383d |
%install
|
|
|
85383d |
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
|
|
|
85383d |
export INSTALL_MOD_DIR=extra/%{name}
|
|
|
85383d |
for flavor in %flavors_to_build ; do
|
|
|
85383d |
make -C %{kernel_source $flavor} modules_install \
|
|
|
85383d |
M=$PWD/obj/$flavor/%{kmod_kbuild_dir}
|
|
|
85383d |
# Cleanup unnecessary kernel-generated module dependency files.
|
|
|
85383d |
find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \;
|
|
|
85383d |
done
|
|
|
85383d |
|
|
|
85383d |
install -m 644 -D source/depmod.conf $RPM_BUILD_ROOT/etc/depmod.d/%{kmod_name}.conf
|
|
|
85383d |
install -m 644 -D source/symbols.greylist $RPM_BUILD_ROOT/usr/share/doc/kmod-%{kmod_name}/greylist.txt
|
|
|
85383d |
|
|
|
85383d |
if [ -d source/firmware ]; then
|
|
|
85383d |
make -C source/firmware INSTALL_PATH=$RPM_BUILD_ROOT INSTALL_DIR=updates install
|
|
|
85383d |
fi
|
|
|
85383d |
|
|
|
85383d |
%clean
|
|
|
85383d |
rm -rf $RPM_BUILD_ROOT
|
|
|
85383d |
|
|
|
85383d |
%changelog
|
|
|
85383d |
* Wed Jul 27 2016 Petr Oros <poros@redhat.com> 1.2.0 2
|
|
|
85383d |
- Rebuild with right target
|
|
|
85383d |
- Resolves: #1363615
|
|
|
85383d |
|
|
|
85383d |
* Wed Jul 27 2016 Petr Oros <poros@redhat.com> 1.2.0 1
|
|
|
85383d |
- bnxt_en DUP module
|
|
|
85383d |
- Resolves: #1363615
|