代码拉取完成,页面将自动刷新
同步操作将从 anolis/kmod-intel-QAT20 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
%define anolis_release 1
%define debug_package %{nil}
%define QAT_release 00004
%global pkg intel-QAT20
%global kernel kernel version
%define pkg_version L.0.9.4
Name: kmod-%{pkg}
Version: %(echo %{kernel} | sed -E 's/-/~/g; s/\.(an|al)[0-9]+$//g')
Release: %{pkg_version}__%{QAT_release}~%{anolis_release}%{?dist}
Summary: QAT package(Library and sample application)
Group: QAT/Base
License: BSD and (BSD or GPLv2)
URL: https://www.intel.com/content/www/us/en/download/19081/intel-quickassist-technology-intel-qat-driver-for-linux-for-intel-server-boards-and-systems-based-on-intel-62x-chipset.html
Source: kmod-%{pkg}-%{pkg_version}-%{QAT_release}.tar.gz
Requires: kernel >= %{kernel}
Requires(posttrans): %{_sbindir}/depmod
Requires(postun): %{_sbindir}/depmod
Requires(posttrans): %{_sbindir}/weak-modules
Requires(postun): %{_sbindir}/weak-modules
Requires(posttrans): %{_bindir}/sort
Requires(postun): %{_bindir}/sort
BuildRequires: kernel-devel = %{kernel}
BuildRequires: kernel-headers = %{kernel}
BuildRequires: gcc gcc-c++ make systemd-devel openssl-devel zlib-devel yasm
BuildRequires: libudev-devel >= 1.47
BuildRequires: boost-devel
Provides: kmod-intel-QAT20 = %{version}-%{release}
Obsoletes: kmod-intel-QAT20 < %{version}-%{release}
Obsoletes: kmod-intel-QAT20 < %{version}-%{release}.%{anolis_release}%{?dist}
Provides: kmod-%{pkg}-%{kernel}.%{_arch} = %{version}-%{release}
Obsoletes: kmod-%{pkg}-%{kernel}.%{_arch} < %{version}-%{release}
ExclusiveArch: x86_64
%description
Intel(R) QuickAssist Technology user space library and sample application Linux
version %{version}
%prep
%setup -q -n kmod-%{pkg}-%{pkg_version}-%{QAT_release}
%build
pushd src
unset ICP_ROOT ICP_ARCH_USER ICP_BUILDSYSTEM_PATH ICP_BUILD_OUTPUT ICP_ENV_DIR ICP_TOOLS_TARGET
%configure
%make_build qat-driver-all quickassist-all
popd
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/etc/init.d
mkdir -p %{buildroot}/etc/udev/rules.d
mkdir -p %{buildroot}/%{_libdir}
mkdir -p %{buildroot}%{_sbindir}
mkdir -p %{buildroot}/usr/bin/QAT
mkdir -p %{buildroot}/usr/bin/QAT/build
mkdir -p %{buildroot}/lib/firmware
MODPATH=drivers/crypto/qat
KERNEL_VER=%{kernel}.%{_arch}
SRCMODDIR=${RPM_BUILD_DIR}/kmod-%{pkg}-%{pkg_version}-%{QAT_release}/src/quickassist/qat/${MODPATH}
DSTMODDIR=%{buildroot}/lib/modules/${KERNEL_VER}/extra/${MODPATH}
mkdir -p ${DSTMODDIR}/qat_common/
mkdir -p ${DSTMODDIR}/qat_4xxx/
mkdir -p ${DSTMODDIR}/qat_4xxxvf/
mkdir -p ${DSTMODDIR}/qat_vqat/
/usr/bin/install -D -m 750 ${SRCMODDIR}/qat_common/intel_qat.ko ${DSTMODDIR}/qat_common/
/usr/bin/install -D -m 750 ${SRCMODDIR}/qat_common/qat_vdcm.ko ${DSTMODDIR}/qat_common/
/usr/bin/install -D -m 750 ${SRCMODDIR}/qat_4xxx/qat_4xxx.ko ${DSTMODDIR}/qat_4xxx/qat_4xxx.ko
/usr/bin/install -D -m 750 ${SRCMODDIR}/qat_4xxxvf/qat_4xxxvf.ko ${DSTMODDIR}/qat_4xxxvf/qat_4xxxvf.ko
/usr/bin/install -D -m 750 ${SRCMODDIR}/qat_vqat/qat_vqat.ko ${DSTMODDIR}/qat_vqat/qat_vqat.ko
/usr/bin/install -D -m 750 src/build/usdm_drv.ko %{buildroot}/lib/modules/${KERNEL_VER}/extra/
/usr/bin/install -D -m 750 src/quickassist/qat/fw/qat_4xxx.bin %{buildroot}/lib/firmware/qat_4xxx_oot.bin
/usr/bin/install -D -m 750 src/quickassist/qat/fw/qat_4xxx_mmp.bin %{buildroot}/lib/firmware/qat_4xxx_mmp_oot.bin
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
for kmod in $(find %{buildroot}/lib/modules/%{kernel}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
do
echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
echo "override $(basename $kmod .ko) * extra/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
done
%clean
rm -rf $RPM_BUILD_ROOT
%verifyscript
%files
/lib/modules/%{kernel}.%{_arch}/extra/drivers/crypto/qat/qat_common/intel_qat.ko
/lib/modules/%{kernel}.%{_arch}/extra/drivers/crypto/qat/qat_common/qat_vdcm.ko
/lib/modules/%{kernel}.%{_arch}/extra/drivers/crypto/qat/qat_4xxx/qat_4xxx.ko
/lib/modules/%{kernel}.%{_arch}/extra/drivers/crypto/qat/qat_4xxxvf/qat_4xxxvf.ko
/lib/modules/%{kernel}.%{_arch}/extra/drivers/crypto/qat/qat_vqat/qat_vqat.ko
/lib/modules/%{kernel}.%{_arch}/extra/usdm_drv.ko
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
/lib/firmware/qat_4xxx_oot.bin
/lib/firmware/qat_4xxx_mmp_oot.bin
%post
ECHO=/usr/bin/echo
${ECHO} "Creating module.dep file for QAT released kernel object"
${ECHO} "This will take a few moments";
depmod -a
# 将该模块的ko都注册到weak-modules,如果当前环境有安装其他的kABI兼容的内核,那么会在兼容的内核下的weak-updates目录生成软链接。
if [ -x "/usr/sbin/weak-modules" ]; then
printf '%s\n' "/lib/modules/%{kernel}.%{_arch}/extra/drivers/crypto/qat/qat_common/intel_qat.ko" | /usr/sbin/weak-modules --no-initramfs --add-modules > /dev/null 2>&1
printf '%s\n' "/lib/modules/%{kernel}.%{_arch}/extra/drivers/crypto/qat/qat_common/qat_vdcm.ko" | /usr/sbin/weak-modules --no-initramfs --add-modules > /dev/null 2>&1
printf '%s\n' "/lib/modules/%{kernel}.%{_arch}/extra/drivers/crypto/qat/qat_4xxx/qat_4xxx.ko" | /usr/sbin/weak-modules --no-initramfs --add-modules > /dev/null 2>&1
printf '%s\n' "/lib/modules/%{kernel}.%{_arch}/extra/drivers/crypto/qat/qat_4xxxvf/qat_4xxxvf.ko" | /usr/sbin/weak-modules --no-initramfs --add-modules > /dev/null 2>&1
printf '%s\n' "/lib/modules/%{kernel}.%{_arch}/extra/drivers/crypto/qat/qat_vqat/qat_vqat.ko" | /usr/sbin/weak-modules --no-initramfs --add-modules > /dev/null 2>&1
printf '%s\n' "/lib/modules/%{kernel}.%{_arch}/extra/usdm_drv.ko" | /usr/sbin/weak-modules --no-initramfs --add-modules > /dev/null 2>&1
fi
%preun
# 这里换成自己的ko路径,目的是将ko路径都保存到一个临时文件里然后在%postun阶段从weak-modules里注销。
echo "/lib/modules/%{kernel}.%{_arch}/extra/usdm_drv.ko" >> /var/run/rpm-%{pkg}-modules.list
echo "/lib/modules/%{kernel}.%{_arch}/extra/drivers/crypto/qat/qat_common/intel_qat.ko" >> /var/run/rpm-%{pkg}-modules.list
echo "/lib/modules/%{kernel}.%{_arch}/extra/drivers/crypto/qat/qat_common/qat_vdcm.ko" >> /var/run/rpm-%{pkg}-modules.list
echo "/lib/modules/%{kernel}.%{_arch}/extra/drivers/crypto/qat/qat_4xxx/qat_4xxx.ko" >> /var/run/rpm-%{pkg}-modules.list
echo "/lib/modules/%{kernel}.%{_arch}/extra/drivers/crypto/qat/qat_4xxxvf/qat_4xxxvf.ko" >> /var/run/rpm-%{pkg}-modules.list
echo "/lib/modules/%{kernel}.%{_arch}/extra/drivers/crypto/qat/qat_vqat/qat_vqat.ko" >> /var/run/rpm-%{pkg}-modules.list
%postun
depmod -a
# 将模块的ko从weak-modules里注销,这里的rpm-%{pkg}-modules.list是在%preun阶段生成的。
if [ -x "/usr/sbin/weak-modules" ]; then
modules=( $(cat /var/run/rpm-%{pkg}-modules.list) )
printf '%s\n' "${modules[@]}" | /usr/sbin/weak-modules --no-initramfs --remove-modules > /dev/null 2>&1
fi
rm /var/run/rpm-%{pkg}-modules.list
%changelog
* Thu Dec 21 2023 Xingrui Yi <yixingrui@linux.alibaba.com> - 0.9.4-00004.3
- Remove dracut
* Thu Dec 14 2023 Xingrui Yi <yixingrui@linux.alibaba.com> - 0.9.4-00004.2
- Change qat_4xxx fw patch
* Mon Nov 13 2023 Xingrui Yi <yixingrui@linux.alibaba.com> - 0.9.4-00004.1
- Change spec for oot weak module
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。