megaraid_sas module for Driver Update Program.
6954e9231ab2a1cde0c4a257ef67aaef5474cbcf..ed8469e4671ccd7ebf253771d85384991fca397f
2017-03-14 CentOS Sources
import kmod-redhat-megaraid_sas-07.700.00.00-rh1.el7_3
ed8469 diff | tree
3 files added
1 files deleted
126 ■■■■■ changed files
.gitignore 1 ●●●● patch | view | raw | blame | history
.kmod-redhat-megaraid_sas.metadata 1 ●●●● patch | view | raw | blame | history
README.md 4 ●●●● patch | view | raw | blame | history
SPECS/megaraid_sas.spec 120 ●●●●● patch | view | raw | blame | history
.gitignore
New file
@@ -0,0 +1 @@
SOURCES/megaraid_sas-redhat-07.700.00.00.tar.bz2
.kmod-redhat-megaraid_sas.metadata
New file
@@ -0,0 +1 @@
df7ecccae64739127867c7bb25fae614d54b5dd3 SOURCES/megaraid_sas-redhat-07.700.00.00.tar.bz2
README.md
File was deleted
SPECS/megaraid_sas.spec
New file
@@ -0,0 +1,120 @@
%define kmod_name        megaraid_sas
%define kmod_vendor        redhat
%define kmod_driver_version    07.700.00.00
%define kmod_rpm_release    rh1
%define kmod_kernel_version    3.10.0-514.el7
%define kmod_kbuild_dir        drivers/scsi/megaraid
%{!?dist: %define dist .el7_3}
Source0:    %{kmod_name}-%{kmod_vendor}-%{kmod_driver_version}.tar.bz2
%define findpat %( echo "%""P" )
%define __find_requires /usr/lib/rpm/redhat/find-requires.ksyms
%define __find_provides /usr/lib/rpm/redhat/find-provides.ksyms %{kmod_name} %{?epoch:%{epoch}:}%{version}-%{release}
Name:        kmod-redhat-megaraid_sas
Version:    %{kmod_driver_version}
Release:    %{kmod_rpm_release}%{?dist}
Summary:    megaraid_sas module for Driver Update Program.
Group:        System/Kernel
License:    GPLv2
URL:        http://www.kernel.org/
BuildRoot:    %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires:    kernel-devel = %kmod_kernel_version kmod redhat-rpm-config kernel-abi-whitelists
ExclusiveArch:    x86_64
%global kernel_source() /usr/src/kernels/%{kmod_kernel_version}.$(arch)
%global _use_internal_dependency_generator 0
Provides:    kernel-modules = %kmod_kernel_version.%{_target_cpu}
Provides:    %{kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
Requires(post):    /usr/sbin/depmod
Requires(postun):    /usr/sbin/depmod
Requires:    kernel >= 3.10.0-514.el7
Requires:    kernel < 3.10.0-515.el7
# if there are multiple kmods for the same driver from different vendors,
# they should coflict with each other.
Conflicts:    %{kmod_name}-kmod
%description
megaraid_sas module for Driver Update Program.
%post
modules=( $(find /lib/modules/%{kmod_kernel_version}.%(arch)/extra/kmod-%{kmod_vendor}-%{kmod_name} | grep '\.ko$') )
if [ -x "/sbin/weak-modules" ]; then
    printf '%s\n' "${modules[@]}" \
    | /sbin/weak-modules --add-modules
fi
%preun
rpm -ql kmod-redhat-megaraid_sas-%{kmod_driver_version}-%{kmod_rpm_release}%{?dist}.$(arch) | grep '\.ko$' > /var/run/rpm-kmod-%{kmod_name}-modules
%postun
modules=( $(cat /var/run/rpm-kmod-%{kmod_name}-modules) )
rm /var/run/rpm-kmod-%{kmod_name}-modules
if [ -x "/sbin/weak-modules" ]; then
    printf '%s\n' "${modules[@]}" \
    | /sbin/weak-modules --remove-modules
fi
%files
%defattr(644,root,root,755)
/lib/modules/%{kmod_kernel_version}.%(arch)
/etc/depmod.d/megaraid_sas.conf
/usr/share/doc/kmod-megaraid_sas/greylist.txt
%prep
%setup -n megaraid_sas-redhat-07.700.00.00
set -- *
mkdir source
mv "$@" source/
mkdir obj
%build
rm -rf obj
cp -r source obj
make -C %{kernel_source} M=$PWD/obj/%{kmod_kbuild_dir} \
    NOSTDINC_FLAGS="-I $PWD/obj/include"
# mark modules executable so that strip-to-file can strip them
find obj/%{kmod_kbuild_dir} -name "*.ko" -type f -exec chmod u+x '{}' +
whitelist="/lib/modules/kabi-current/kabi_whitelist_%{_target_cpu}"
for modules in $( find obj/%{kmod_kbuild_dir} -name "*.ko" -type f -printf "%{findpat}\n" | sed 's|\.ko$||' | sort -u ) ; do
    # update depmod.conf
    module_weak_path=$(echo $modules | sed 's/[\/]*[^\/]*$//')
    if [ -z "$module_weak_path" ]; then
        module_weak_path=%{name}
    else
        module_weak_path=%{name}/$module_weak_path
    fi
    echo "override $(echo $modules | sed 's/.*\///') $(echo %{kmod_kernel_version} | sed 's/\.[^\.]*$//').* weak-updates/$module_weak_path" >> source/depmod.conf
    # update greylist
    nm -u obj/%{kmod_kbuild_dir}/$modules.ko | sed 's/.*U //' |  sed 's/^\.//' | sort -u | while read -r symbol; do
        grep -q "^\s*$symbol\$" $whitelist || echo "$symbol" >> source/greylist
    done
done
sort -u source/greylist | uniq > source/greylist.txt
%install
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=extra/%{name}
make -C %{kernel_source} modules_install \
    M=$PWD/obj/%{kmod_kbuild_dir}
# Cleanup unnecessary kernel-generated module dependency files.
find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \;
install -m 644 -D source/depmod.conf $RPM_BUILD_ROOT/etc/depmod.d/%{kmod_name}.conf
install -m 644 -D source/greylist.txt $RPM_BUILD_ROOT/usr/share/doc/kmod-%{kmod_name}/greylist.txt
%clean
rm -rf $RPM_BUILD_ROOT
%changelog
* Tue Feb 28 2017 Eugene Syromiatnikov <esyr@redhat.com> 07.700.00.00
- 5c36dd7d22747abb333b0c2541bac9544c358e3b
- Resolves: #bz1427425
- megaraid_sas module for Driver Update Program.