View Issue Details

IDProjectCategoryView StatusLast Update
0000956channel: elrepo/el8--elrepo--request-for-enhancement--public2019-10-17 00:25
Reporterodicha Assigned Topperry  
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Summary0000956: Add DUD for aacraid support
DescriptionAs other modules, some HW IDs have been removed from kernel
Additional InformationAttached patch, source and SPEC file. Also available SRPM RPM and ISO on request
TagsNo tags attached.
Attached Files
aacraid-kmod.spec (6,003 bytes)   
# Define the kmod package name here.
%define kmod_name	aacraid

# If kmod_kernel_version isn't defined on the rpmbuild line, define it here.
%{!?kmod_kernel_version: %define kmod_kernel_version 4.18.0-80.el8}

%{!?dist: %define dist .el8}

Name:		kmod-%{kmod_name}
Version:	07.707.50.00
Release:	1%{?dist}
Summary:	%{kmod_name} kernel module(s)
Group:		System Environment/Kernel
License:	GPLv2
URL:		http://www.kernel.org/

# Sources
Source0:	%{kmod_name}-%{version}.tar.gz
Source5:	GPL-v2.0.txt

# Source code patches
Patch0:		0000-aacraid-remove-device-support-removed.patch

%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}
%define dup_state_dir %{_localstatedir}/lib/rpm-state/kmod-dups
%define kver_state_dir %{dup_state_dir}/kver
%define kver_state_file %{kver_state_dir}/%{kmod_kernel_version}.%{_arch}
%define dup_module_list %{dup_state_dir}/rpm-kmod-%{kmod_name}-modules
%define debug_package %{nil}

%global _use_internal_dependency_generator 0
%global kernel_source() %{_usrsrc}/kernels/%{kmod_kernel_version}.%{_arch}

BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

ExclusiveArch:	x86_64

BuildRequires:	elfutils-libelf-devel
BuildRequires:	kernel-devel = %{kmod_kernel_version}
BuildRequires:	kernel-abi-whitelists
BuildRequires:	kernel-rpm-macros
BuildRequires:	redhat-rpm-config

Provides:	kernel-modules >= %{kmod_kernel_version}.%{_arch}
Provides:	kmod-%{kmod_name} = %{?epoch:%{epoch}:}%{version}-%{release}

Requires(post):	%{_sbindir}/weak-modules
Requires(postun):	%{_sbindir}/weak-modules
Requires:	kernel >= %{kmod_kernel_version}

%description
This package provides the %{kmod_name} kernel module(s).
It is built to depend upon the specific ABI provided by a range of releases
of the same variant of the Linux kernel and not on any one specific build.

%prep
%setup -q -n %{kmod_name}-%{version}
%patch0 -p1
echo "override %{kmod_name} * weak-updates/%{kmod_name}" > kmod-%{kmod_name}.conf

# Apply patch(es)
# % patch0 -p1

%build
%{__make} -C %{kernel_source} %{?_smp_mflags} modules M=$PWD

whitelist="/lib/modules/kabi-current/kabi_whitelist_%{_target_cpu}"
for modules in $( find . -name "*.ko" -type f -printf "%{findpat}\n" | sed 's|\.ko$||' | sort -u ) ; do
	# update greylist
	nm -u ./$modules.ko | sed 's/.*U //' |  sed 's/^\.//' | sort -u | while read -r symbol; do
		grep -q "^\s*$symbol\$" $whitelist || echo "$symbol" >> ./greylist
	done
done
sort -u greylist | uniq > greylist.txt

%install
%{__install} -d %{buildroot}/lib/modules/%{kmod_kernel_version}.%{_arch}/extra/%{kmod_name}/
%{__install} %{kmod_name}.ko %{buildroot}/lib/modules/%{kmod_kernel_version}.%{_arch}/extra/%{kmod_name}/
%{__install} -d %{buildroot}%{_sysconfdir}/depmod.d/
%{__install} -m 0644 kmod-%{kmod_name}.conf %{buildroot}%{_sysconfdir}/depmod.d/
%{__install} -d %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} -m 0644 %{SOURCE5} %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/
%{__install} -m 0644 greylist.txt %{buildroot}%{_defaultdocdir}/kmod-%{kmod_name}-%{version}/

# strip the modules(s)
find %{buildroot} -type f -name \*.ko -exec %{__strip} --strip-debug \{\} \;

# Sign the modules(s)
%if %{?_with_modsign:1}%{!?_with_modsign:0}
	# If the module signing keys are not defined, define them here.
	%{!?privkey: %define privkey %{_sysconfdir}/pki/SECURE-BOOT-KEY.priv}
	%{!?pubkey: %define pubkey %{_sysconfdir}/pki/SECURE-BOOT-KEY.der}
	for module in $(find %{buildroot} -type f -name \*.ko);
		do %{_usrsrc}/kernels/%{kmod_kernel_version}.%{_arch}/scripts/sign-file \
		sha256 %{privkey} %{pubkey} $module;
	done
%endif

%clean
%{__rm} -rf %{buildroot}

%post
modules=( $(find /lib/modules/%{kmod_kernel_version}.x86_64/extra/%{kmod_name} | grep '\.ko$') )
printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules --no-initramfs

mkdir -p "%{kver_state_dir}"
touch "%{kver_state_file}"

exit 0

%posttrans
# We have to re-implement part of weak-modules here because it doesn't allow
# calling initramfs regeneration separately
if [ -f "%{kver_state_file}" ]; then
	kver_base="%{kmod_kernel_version}"
	kvers=$(ls -d "/lib/modules/${kver_base%%.*}"*)

	for k_dir in $kvers; do
		k="${k_dir#/lib/modules/}"

		tmp_initramfs="/boot/initramfs-$k.tmp"
		dst_initramfs="/boot/initramfs-$k.img"

		# The same check as in weak-modules: we assume that the kernel present
		# if the symvers file exists.
		if [ -e "/boot/symvers-$k.gz" ]; then
			/usr/bin/dracut -f "$tmp_initramfs" "$k" || exit 1
			cmp -s "$tmp_initramfs" "$dst_initramfs"
			if [ "$?" = 1 ]; then
				mv "$tmp_initramfs" "$dst_initramfs"
			else
				rm -f "$tmp_initramfs"
			fi
		fi
	done

	rm -f "%{kver_state_file}"
	rmdir "%{kver_state_dir}" 2> /dev/null
fi

rmdir "%{dup_state_dir}" 2> /dev/null

exit 0

%preun
if rpm -q --filetriggers kmod 2> /dev/null| grep -q "Trigger for weak-modules call on kmod removal"; then
	mkdir -p "%{kver_state_dir}"
	touch "%{kver_state_file}"
fi

mkdir -p "%{dup_state_dir}"
rpm -ql kmod-%{kmod_name}-%{version}-%{release}.%{_arch} | grep '\.ko$' > "%{dup_module_list}"

%postun
if rpm -q --filetriggers kmod 2> /dev/null| grep -q "Trigger for weak-modules call on kmod removal"; then
	initramfs_opt="--no-initramfs"
else
	initramfs_opt=""
fi

modules=( $(cat "%{dup_module_list}") )
rm -f "%{dup_module_list}"
printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules $initramfs_opt

rmdir "%{dup_state_dir}" 2> /dev/null

exit 0

%files
%defattr(644,root,root,755)
/lib/modules/%{kmod_kernel_version}.%{_arch}/
%config /etc/depmod.d/kmod-%{kmod_name}.conf
%doc /usr/share/doc/kmod-%{kmod_name}-%{version}/

%changelog
* Sun Oct 13 2019 Jose Deniz <odi@odicha.net> 07.707.50.00-1
- Initial el8 build of the kmod package.
- Source code taken from RHEL kernel-4.18.0-80.el8.x86_64
- Revert RH patch to remove device IDs
aacraid-kmod.spec (6,003 bytes)   
0000-aacraid-remove-device-support-removed.patch (5,700 bytes)   
--- a/linit.c	2019-06-24 11:14:47.000000000 +0100
+++ b/linit.c	2019-10-10 20:04:17.270588704 +0100
@@ -165,77 +165,6 @@
 };
 MODULE_DEVICE_TABLE(pci, aac_pci_tbl);
 
-static const struct pci_device_id aac_pci_ids_removed[] = {
-	{ 0x1028, 0x0001, 0x1028, 0x0001, 0, 0, 0 }, /* PERC 2/Si (Iguana/PERC2Si) */
-	{ 0x1028, 0x0002, 0x1028, 0x0002, 0, 0, 1 }, /* PERC 3/Di (Opal/PERC3Di) */
-	{ 0x1028, 0x0003, 0x1028, 0x0003, 0, 0, 2 }, /* PERC 3/Si (SlimFast/PERC3Si */
-	{ 0x1028, 0x0004, 0x1028, 0x00d0, 0, 0, 3 }, /* PERC 3/Di (Iguana FlipChip/PERC3DiF */
-	{ 0x1028, 0x0002, 0x1028, 0x00d1, 0, 0, 4 }, /* PERC 3/Di (Viper/PERC3DiV) */
-	{ 0x1028, 0x0002, 0x1028, 0x00d9, 0, 0, 5 }, /* PERC 3/Di (Lexus/PERC3DiL) */
-	{ 0x1028, 0x000a, 0x1028, 0x0106, 0, 0, 6 }, /* PERC 3/Di (Jaguar/PERC3DiJ) */
-	{ 0x1028, 0x000a, 0x1028, 0x011b, 0, 0, 7 }, /* PERC 3/Di (Dagger/PERC3DiD) */
-	{ 0x1028, 0x000a, 0x1028, 0x0121, 0, 0, 8 }, /* PERC 3/Di (Boxster/PERC3DiB) */
-	{ 0x9005, 0x0283, 0x9005, 0x0283, 0, 0, 9 }, /* catapult */
-	{ 0x9005, 0x0284, 0x9005, 0x0284, 0, 0, 10 }, /* tomcat */
-	{ 0x9005, 0x0285, 0x9005, 0x0286, 0, 0, 11 }, /* Adaptec 2120S (Crusader) */
-	{ 0x9005, 0x0285, 0x9005, 0x0285, 0, 0, 12 }, /* Adaptec 2200S (Vulcan) */
-	{ 0x9005, 0x0285, 0x9005, 0x0287, 0, 0, 13 }, /* Adaptec 2200S (Vulcan-2m) */
-	{ 0x9005, 0x0285, 0x17aa, 0x0286, 0, 0, 14 }, /* Legend S220 (Legend Crusader) */
-	{ 0x9005, 0x0285, 0x17aa, 0x0287, 0, 0, 15 }, /* Legend S230 (Legend Vulcan) */
-
-	{ 0x9005, 0x0285, 0x9005, 0x0288, 0, 0, 16 }, /* Adaptec 3230S (Harrier) */
-	{ 0x9005, 0x0285, 0x9005, 0x0289, 0, 0, 17 }, /* Adaptec 3240S (Tornado) */
-	{ 0x9005, 0x0285, 0x9005, 0x028a, 0, 0, 18 }, /* ASR-2020ZCR SCSI PCI-X ZCR (Skyhawk) */
-	{ 0x9005, 0x0285, 0x9005, 0x028b, 0, 0, 19 }, /* ASR-2025ZCR SCSI SO-DIMM PCI-X ZCR (Terminator) */
-	{ 0x9005, 0x0286, 0x9005, 0x028c, 0, 0, 20 }, /* ASR-2230S + ASR-2230SLP PCI-X (Lancer) */
-	{ 0x9005, 0x0286, 0x9005, 0x028d, 0, 0, 21 }, /* ASR-2130S (Lancer) */
-	{ 0x9005, 0x0286, 0x9005, 0x029b, 0, 0, 22 }, /* AAR-2820SA (Intruder) */
-	{ 0x9005, 0x0286, 0x9005, 0x029c, 0, 0, 23 }, /* AAR-2620SA (Intruder) */
-	{ 0x9005, 0x0286, 0x9005, 0x029d, 0, 0, 24 }, /* AAR-2420SA (Intruder) */
-	{ 0x9005, 0x0286, 0x9005, 0x029e, 0, 0, 25 }, /* ICP9024RO (Lancer) */
-	{ 0x9005, 0x0286, 0x9005, 0x029f, 0, 0, 26 }, /* ICP9014RO (Lancer) */
-	{ 0x9005, 0x0286, 0x9005, 0x02a0, 0, 0, 27 }, /* ICP9047MA (Lancer) */
-	{ 0x9005, 0x0286, 0x9005, 0x02a1, 0, 0, 28 }, /* ICP9087MA (Lancer) */
-	{ 0x9005, 0x0286, 0x9005, 0x02a3, 0, 0, 29 }, /* ICP5445AU (Hurricane44) */
-	{ 0x9005, 0x0285, 0x9005, 0x02a4, 0, 0, 30 }, /* ICP9085LI (Marauder-X) */
-	{ 0x9005, 0x0285, 0x9005, 0x02a5, 0, 0, 31 }, /* ICP5085BR (Marauder-E) */
-	{ 0x9005, 0x0286, 0x9005, 0x02a6, 0, 0, 32 }, /* ICP9067MA (Intruder-6) */
-	{ 0x9005, 0x0287, 0x9005, 0x0800, 0, 0, 33 }, /* Themisto Jupiter Platform */
-	{ 0x9005, 0x0200, 0x9005, 0x0200, 0, 0, 33 }, /* Themisto Jupiter Platform */
-	{ 0x9005, 0x0286, 0x9005, 0x0800, 0, 0, 34 }, /* Callisto Jupiter Platform */
-	{ 0x9005, 0x0285, 0x9005, 0x028e, 0, 0, 35 }, /* ASR-2020SA SATA PCI-X ZCR (Skyhawk) */
-	{ 0x9005, 0x0285, 0x9005, 0x028f, 0, 0, 36 }, /* ASR-2025SA SATA SO-DIMM PCI-X ZCR (Terminator) */
-	{ 0x9005, 0x0285, 0x9005, 0x0290, 0, 0, 37 }, /* AAR-2410SA PCI SATA 4ch (Jaguar II) */
-	{ 0x9005, 0x0285, 0x1028, 0x0291, 0, 0, 38 }, /* CERC SATA RAID 2 PCI SATA 6ch (DellCorsair) */
-	{ 0x9005, 0x0285, 0x9005, 0x0292, 0, 0, 39 }, /* AAR-2810SA PCI SATA 8ch (Corsair-8) */
-	{ 0x9005, 0x0285, 0x9005, 0x0293, 0, 0, 40 }, /* AAR-21610SA PCI SATA 16ch (Corsair-16) */
-	{ 0x9005, 0x0285, 0x9005, 0x0294, 0, 0, 41 }, /* ESD SO-DIMM PCI-X SATA ZCR (Prowler) */
-	{ 0x9005, 0x0285, 0x103C, 0x3227, 0, 0, 42 }, /* AAR-2610SA PCI SATA 6ch */
-	{ 0x9005, 0x0285, 0x9005, 0x0296, 0, 0, 43 }, /* ASR-2240S (SabreExpress) */
-	{ 0x9005, 0x0285, 0x9005, 0x0297, 0, 0, 44 }, /* ASR-4005 */
-	{ 0x9005, 0x0285, 0x1014, 0x02F2, 0, 0, 45 }, /* IBM 8i (AvonPark) */
-	{ 0x9005, 0x0285, 0x1014, 0x0312, 0, 0, 45 }, /* IBM 8i (AvonPark Lite) */
-	{ 0x9005, 0x0286, 0x1014, 0x9580, 0, 0, 46 }, /* IBM 8k/8k-l8 (Aurora) */
-	{ 0x9005, 0x0286, 0x1014, 0x9540, 0, 0, 47 }, /* IBM 8k/8k-l4 (Aurora Lite) */
-	{ 0x9005, 0x0285, 0x9005, 0x0298, 0, 0, 48 }, /* ASR-4000 (BlackBird) */
-	{ 0x9005, 0x0285, 0x9005, 0x0299, 0, 0, 49 }, /* ASR-4800SAS (Marauder-X) */
-	{ 0x9005, 0x0285, 0x9005, 0x029a, 0, 0, 50 }, /* ASR-4805SAS (Marauder-E) */
-	{ 0x9005, 0x0286, 0x9005, 0x02a2, 0, 0, 51 }, /* ASR-3800 (Hurricane44) */
-
-	{ 0x9005, 0x0285, 0x1028, 0x0287, 0, 0, 52 }, /* Perc 320/DC*/
-	{ 0x1011, 0x0046, 0x9005, 0x0365, 0, 0, 53 }, /* Adaptec 5400S (Mustang)*/
-	{ 0x1011, 0x0046, 0x9005, 0x0364, 0, 0, 54 }, /* Adaptec 5400S (Mustang)*/
-	{ 0x1011, 0x0046, 0x9005, 0x1364, 0, 0, 55 }, /* Dell PERC2/QC */
-	{ 0x1011, 0x0046, 0x103c, 0x10c2, 0, 0, 56 }, /* HP NetRAID-4M */
-
-	{ 0x9005, 0x0285, 0x1028, PCI_ANY_ID, 0, 0, 57 }, /* Dell Catchall */
-	{ 0x9005, 0x0285, 0x17aa, PCI_ANY_ID, 0, 0, 58 }, /* Legend Catchall */
-	{ 0x9005, 0x0285, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 59 }, /* Adaptec Catch All */
-	{ 0x9005, 0x0286, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 60 }, /* Adaptec Rocket Catch All */
-	{ 0x9005, 0x0288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 61 }, /* Adaptec NEMER/ARK Catch All */
-	{ 0,}
-};
-
 /*
  * dmb - For now we add the number of channels to this structure.
  * In the future we should add a fib that reports the number of channels
@@ -1678,10 +1607,6 @@
 	int mask_bits = 0;
 	extern int aac_sync_mode;
 
-	if (pci_device_support_removed(aac_pci_tbl,
-				aac_pci_ids_removed, pdev))
-		return -ENODEV;
-
 	/*
 	 * Only series 7 needs freset.
 	 */

Activities

odicha

2019-10-13 23:59

reporter   ~0006602

Uploaded iso file. Able to be tested to support aacraid ids disabled in CentOS 8 (https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/considerations_in_adopting_rhel_8/hardware-enablement_considerations-in-adopting-rhel-8#removed-adapters_hardware-enablement)

toracat

2019-10-14 09:39

administrator   ~0006604

@odicha

I see that your patch removes the section for the removed devices. We only tweak the "-ENODEV" line. I think it is useful to leave the list of removed adapters intact in the code.

odicha

2019-10-14 10:41

reporter   ~0006605

@toracat

Modified to follow "-ENODEV" tweak. Uploaded dd-aacraid-1.2.1_src.tar.gz
It also fixes module version

pperry

2019-10-14 14:06

administrator   ~0006606

@odicha

Thank you for your contribution.

I've rebuilt and released the kmod-aacraid-1.2.1-1.el8_0.elrepo.x86_64 package to the elrepo repository:

https://elrepo.org/linux/elrepo/el8/x86_64/RPMS/

I've also created the ISO image and uploaded signed checksums to the dud directory:

https://elrepo.org/linux/dud/el8/x86_64/

these should show up shortly once mirrors have synced.

It would be great if you are able to confirm the released package works for you.

Thanks again for your help

odicha

2019-10-17 00:10

reporter   ~0006607

@pperry
Synced with my local elrepo mirror and tested with success (Adaptec 5805Z - Supermicro SAS enclosure - Seagate SAS disks). Some dmesg output down
Thanks a lot to all the team. You do an awesome job!

.........
[ 9.583697] Adaptec aacraid driver 1.2.1[50877]-custom
[ 9.583900] Warning: aacraid 0000:81:00.0 [9005:0285] - Support for this device has been removed in this major release. Please check the removed functionality section of the release notes.
.........
[ 23.670108] ISO 9660 Extensions: RRIP_1991A
[ 25.745179] aacraid: loading out-of-tree module taints kernel.
[ 25.745933] aacraid: module verification failed: signature and/or required key missing - tainting kernel
[ 25.748866] Adaptec aacraid driver 1.2.1[50877]-custom
[ 25.749742] Warning: aacraid 0000:81:00.0 [9005:0285] - Support for this device has been removed in this major release. Please check the removed functionality section of the release notes.
[ 25.751206] aacraid: elrepo version supporting all pci ids
[ 25.751725] aacraid: Comm Interface enabled
[ 25.962441] AAC0: kernel 5.2-0[18950] Jun 25 2012
[ 25.963275] AAC0: monitor 5.2-0[18950]
[ 25.964012] AAC0: bios 5.2-0[18950]
[ 25.964723] AAC0: serial 2C2311xxxxx
[ 25.965436] AAC0: Non-DASD support enabled.
[ 25.966150] AAC0: 64bit support enabled.
[ 25.966856] aacraid 0000:81:00.0: 64 Bit DAC enabled
[ 25.976260] scsi host6: aacraid
[ 26.036761] scsi 6:0:0:0: Direct-Access Adaptec system V1.0 PQ: 0 ANSI: 2
[ 26.087356] scsi 6:1:0:0: Direct-Access SEAGATE ST3300657SS ES62 PQ: 1 ANSI: 5
[ 26.089328] scsi 6:1:1:0: Direct-Access SEAGATE ST3300657SS ES64 PQ: 1 ANSI: 5
[ 26.091277] scsi 6:1:2:0: Direct-Access SEAGATE ST3300657SS ES64 PQ: 1 ANSI: 5
[ 26.093135] scsi 6:1:3:0: Direct-Access SEAGATE ST3300657SS ES64 PQ: 1 ANSI: 5
[ 26.256391] scsi 6:3:0:0: Enclosure ADAPTEC Virtual SGPIO 0 0001 PQ: 0 ANSI: 5
[ 26.608970] sd 6:0:0:0: [sda] 1170210816 512-byte logical blocks: (599 GB/558 GiB)
.........

pperry

2019-10-17 00:25

administrator   ~0006608

Brilliant. Thank you!

Marking this resolved. Please feel free to open further bugs against kmod-aacraid as required.

Issue History

Date Modified Username Field Change
2019-10-13 23:54 odicha New Issue
2019-10-13 23:54 odicha Status new => assigned
2019-10-13 23:54 odicha Assigned To => toracat
2019-10-13 23:54 odicha File Added: aacraid-kmod.spec
2019-10-13 23:55 odicha File Added: 0000-aacraid-remove-device-support-removed.patch
2019-10-13 23:55 odicha File Added: aacraid-07.707.50.00.tar.gz
2019-10-13 23:56 odicha File Added: kmod-aacraid-07.707.50.00-1.el8.src.rpm
2019-10-13 23:56 odicha File Added: kmod-aacraid-07.707.50.00-1.el8.x86_64.rpm
2019-10-13 23:57 odicha File Added: aacraid-07.707.50.00-1.el8_0.iso
2019-10-13 23:59 odicha Note Added: 0006602
2019-10-14 08:33 burakkucat Reproducibility always => N/A
2019-10-14 09:39 toracat Note Added: 0006604
2019-10-14 10:39 odicha File Added: dd-aacraid-1.2.1_src.tar.gz
2019-10-14 10:41 odicha Note Added: 0006605
2019-10-14 14:06 pperry Note Added: 0006606
2019-10-14 14:10 toracat Assigned To toracat => pperry
2019-10-14 14:10 toracat Status assigned => feedback
2019-10-17 00:10 odicha Note Added: 0006607
2019-10-17 00:25 pperry Note Added: 0006608
2019-10-17 00:25 pperry Status feedback => resolved
2019-10-17 00:25 pperry Resolution open => fixed