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
changed files
.gitignore patch | view | blame | history
.kmod-redhat-megaraid_sas.metadata patch | view | blame | history
README.md patch | view | blame | history
SPECS/megaraid_sas.spec patch | view | blame | history
.gitignore
....@@ -0,0 +1 @@
1
+SOURCES/megaraid_sas-redhat-07.700.00.00.tar.bz2
.kmod-redhat-megaraid_sas.metadata
....@@ -0,0 +1 @@
1
+df7ecccae64739127867c7bb25fae614d54b5dd3 SOURCES/megaraid_sas-redhat-07.700.00.00.tar.bz2
README.md
deleted file mode 100644
....@@ -1,4 +0,0 @@
1
-The master branch has no content
2
-
3
-Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6
4
-If you find this file in a distro specific branch, it means that no content has been checked in yet
SPECS/megaraid_sas.spec
....@@ -0,0 +1,120 @@
1
+%define kmod_name megaraid_sas
2
+%define kmod_vendor redhat
3
+%define kmod_driver_version 07.700.00.00
4
+%define kmod_rpm_release rh1
5
+%define kmod_kernel_version 3.10.0-514.el7
6
+%define kmod_kbuild_dir drivers/scsi/megaraid
7
+
8
+%{!?dist: %define dist .el7_3}
9
+
10
+Source0: %{kmod_name}-%{kmod_vendor}-%{kmod_driver_version}.tar.bz2
11
+
12
+
13
+%define findpat %( echo "%""P" )
14
+%define __find_requires /usr/lib/rpm/redhat/find-requires.ksyms
15
+%define __find_provides /usr/lib/rpm/redhat/find-provides.ksyms %{kmod_name} %{?epoch:%{epoch}:}%{version}-%{release}
16
+
17
+Name: kmod-redhat-megaraid_sas
18
+Version: %{kmod_driver_version}
19
+Release: %{kmod_rpm_release}%{?dist}
20
+Summary: megaraid_sas module for Driver Update Program.
21
+Group: System/Kernel
22
+License: GPLv2
23
+URL: http://www.kernel.org/
24
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
25
+BuildRequires: kernel-devel = %kmod_kernel_version kmod redhat-rpm-config kernel-abi-whitelists
26
+ExclusiveArch: x86_64
27
+%global kernel_source() /usr/src/kernels/%{kmod_kernel_version}.$(arch)
28
+
29
+%global _use_internal_dependency_generator 0
30
+Provides: kernel-modules = %kmod_kernel_version.%{_target_cpu}
31
+Provides: %{kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
32
+Requires(post): /usr/sbin/depmod
33
+Requires(postun): /usr/sbin/depmod
34
+Requires: kernel >= 3.10.0-514.el7
35
+Requires: kernel < 3.10.0-515.el7
36
+# if there are multiple kmods for the same driver from different vendors,
37
+# they should coflict with each other.
38
+Conflicts: %{kmod_name}-kmod
39
+
40
+%description
41
+megaraid_sas module for Driver Update Program.
42
+
43
+
44
+%post
45
+modules=( $(find /lib/modules/%{kmod_kernel_version}.%(arch)/extra/kmod-%{kmod_vendor}-%{kmod_name} | grep '\.ko$') )
46
+if [ -x "/sbin/weak-modules" ]; then
47
+ printf '%s\n' "${modules[@]}" \
48
+ | /sbin/weak-modules --add-modules
49
+fi
50
+
51
+%preun
52
+rpm -ql kmod-redhat-megaraid_sas-%{kmod_driver_version}-%{kmod_rpm_release}%{?dist}.$(arch) | grep '\.ko$' > /var/run/rpm-kmod-%{kmod_name}-modules
53
+
54
+%postun
55
+modules=( $(cat /var/run/rpm-kmod-%{kmod_name}-modules) )
56
+rm /var/run/rpm-kmod-%{kmod_name}-modules
57
+if [ -x "/sbin/weak-modules" ]; then
58
+ printf '%s\n' "${modules[@]}" \
59
+ | /sbin/weak-modules --remove-modules
60
+fi
61
+
62
+%files
63
+%defattr(644,root,root,755)
64
+/lib/modules/%{kmod_kernel_version}.%(arch)
65
+/etc/depmod.d/megaraid_sas.conf
66
+/usr/share/doc/kmod-megaraid_sas/greylist.txt
67
+
68
+%prep
69
+%setup -n megaraid_sas-redhat-07.700.00.00
70
+
71
+set -- *
72
+mkdir source
73
+mv "$@" source/
74
+mkdir obj
75
+
76
+%build
77
+rm -rf obj
78
+cp -r source obj
79
+make -C %{kernel_source} M=$PWD/obj/%{kmod_kbuild_dir} \
80
+ NOSTDINC_FLAGS="-I $PWD/obj/include"
81
+# mark modules executable so that strip-to-file can strip them
82
+find obj/%{kmod_kbuild_dir} -name "*.ko" -type f -exec chmod u+x '{}' +
83
+
84
+whitelist="/lib/modules/kabi-current/kabi_whitelist_%{_target_cpu}"
85
+for modules in $( find obj/%{kmod_kbuild_dir} -name "*.ko" -type f -printf "%{findpat}\n" | sed 's|\.ko$||' | sort -u ) ; do
86
+ # update depmod.conf
87
+ module_weak_path=$(echo $modules | sed 's/[\/]*[^\/]*$//')
88
+ if [ -z "$module_weak_path" ]; then
89
+ module_weak_path=%{name}
90
+ else
91
+ module_weak_path=%{name}/$module_weak_path
92
+ fi
93
+ echo "override $(echo $modules | sed 's/.*\///') $(echo %{kmod_kernel_version} | sed 's/\.[^\.]*$//').* weak-updates/$module_weak_path" >> source/depmod.conf
94
+
95
+ # update greylist
96
+ nm -u obj/%{kmod_kbuild_dir}/$modules.ko | sed 's/.*U //' | sed 's/^\.//' | sort -u | while read -r symbol; do
97
+ grep -q "^\s*$symbol\$" $whitelist || echo "$symbol" >> source/greylist
98
+ done
99
+done
100
+sort -u source/greylist | uniq > source/greylist.txt
101
+
102
+%install
103
+export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
104
+export INSTALL_MOD_DIR=extra/%{name}
105
+make -C %{kernel_source} modules_install \
106
+ M=$PWD/obj/%{kmod_kbuild_dir}
107
+# Cleanup unnecessary kernel-generated module dependency files.
108
+find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \;
109
+
110
+install -m 644 -D source/depmod.conf $RPM_BUILD_ROOT/etc/depmod.d/%{kmod_name}.conf
111
+install -m 644 -D source/greylist.txt $RPM_BUILD_ROOT/usr/share/doc/kmod-%{kmod_name}/greylist.txt
112
+
113
+%clean
114
+rm -rf $RPM_BUILD_ROOT
115
+
116
+%changelog
117
+* Tue Feb 28 2017 Eugene Syromiatnikov <esyr@redhat.com> 07.700.00.00
118
+- 5c36dd7d22747abb333b0c2541bac9544c358e3b
119
+- Resolves: #bz1427425
120
+- megaraid_sas module for Driver Update Program.