add kernel version patch

(cherry picked from commit c748cfc9096463b058b740cb88528a20eddff2f7)
This commit is contained in:
z00590711 2022-02-14 09:31:25 +08:00 committed by openeuler-sync-bot
parent 478fcc689e
commit ab39b40101
2 changed files with 246 additions and 246 deletions

Binary file not shown.

View File

@ -1,246 +1,246 @@
%global debug_package %{nil} %global debug_package %{nil}
Name: kae_driver Name: kae_driver
Summary: Kunpeng Accelerator Engine Kernel Driver Summary: Kunpeng Accelerator Engine Kernel Driver
Version: 1.3.10 Version: 1.3.10
Release: 1 Release: 1
License: GPL-2.0 License: GPL-2.0
Source: %{name}-%{version}.tar.gz Source: %{name}-%{version}.tar.gz
Vendor: Huawei Corporation Vendor: Huawei Corporation
ExclusiveOS: linux ExclusiveOS: linux
URL: https://support.huawei.com URL: https://support.huawei.com
BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRoot: %{_tmppath}/%{name}-%{version}-root
Conflicts: %{name} < %{version}-%{release} Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release} Provides: %{name} = %{version}-%{release}
BuildRequires: kernel-devel, gcc, make BuildRequires: kernel-devel, gcc, make
ExclusiveArch: aarch64 ExclusiveArch: aarch64
Patch0001: 0001-ci-kernel-version-patch.patch Patch0001: 0001-ci-kernel-version-patch.patch
%define kernel_version %(uname -r) %define kernel_version %(uname -r)
%define kae_driver_path %{_builddir}/%{name}-%{version}/%{name} %define kae_driver_path %{_builddir}/%{name}-%{version}/%{name}
%description %description
This package contains the Kunpeng Accelerator Engine Kernel Driver This package contains the Kunpeng Accelerator Engine Kernel Driver
%package -n uacce %package -n uacce
Summary: Unified/User-space-access-intended Accelerator Framework Summary: Unified/User-space-access-intended Accelerator Framework
Conflicts: %{name} < %{version}-%{release} Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release} Provides: %{name} = %{version}-%{release}
%description -n uacce %description -n uacce
This package contains the Unified/User-space-access-intended Accelerator Framework. This package contains the Unified/User-space-access-intended Accelerator Framework.
%package -n hisi_sec2 %package -n hisi_sec2
Summary: Huawei Hisilicon SEC Accelerator Driver Summary: Huawei Hisilicon SEC Accelerator Driver
Requires: uacce >= %{version}-%{release} Requires: uacce >= %{version}-%{release}
Conflicts: %{name} < %{version}-%{release} Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release} Provides: %{name} = %{version}-%{release}
%description -n hisi_sec2 %description -n hisi_sec2
This package contains the Huawei Hisilicon SEC Accelerator Driver. This package contains the Huawei Hisilicon SEC Accelerator Driver.
%package -n hisi_hpre %package -n hisi_hpre
Summary: Huawei Hisilicon HPRE Accelerator Driver Summary: Huawei Hisilicon HPRE Accelerator Driver
Requires: uacce >= %{version}-%{release} Requires: uacce >= %{version}-%{release}
Conflicts: %{name} < %{version}-%{release} Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release} Provides: %{name} = %{version}-%{release}
%description -n hisi_hpre %description -n hisi_hpre
This package contains the Huawei Hisilicon HPRE Accelerator Driver. This package contains the Huawei Hisilicon HPRE Accelerator Driver.
%package -n hisi_zip %package -n hisi_zip
Summary: Huawei Hisilicon ZIP Accelerator Driver Summary: Huawei Hisilicon ZIP Accelerator Driver
Requires: uacce >= %{version}-%{release} Requires: uacce >= %{version}-%{release}
Conflicts: %{name} < %{version}-%{release} Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release} Provides: %{name} = %{version}-%{release}
%description -n hisi_zip %description -n hisi_zip
This package contains the Huawei Hisilicon ZIP Accelerator Driver. This package contains the Huawei Hisilicon ZIP Accelerator Driver.
%package -n hisi_trng_v2 %package -n hisi_trng_v2
Summary: Huawei Hisilicon TRNG Accelerator Driver Summary: Huawei Hisilicon TRNG Accelerator Driver
Requires: uacce >= %{version}-%{release} Requires: uacce >= %{version}-%{release}
Conflicts: %{name} < %{version}-%{release} Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release} Provides: %{name} = %{version}-%{release}
%description -n hisi_trng_v2 %description -n hisi_trng_v2
This package contains the Huawei Hisilicon TRNG Accelerator Driver. This package contains the Huawei Hisilicon TRNG Accelerator Driver.
%prep %prep
%autosetup -c -n %{name}-%{version} -p1 %autosetup -c -n %{name}-%{version} -p1
%build %build
cd kae_driver cd kae_driver
make make
%install %install
mkdir -p ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra mkdir -p ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
mkdir -p ${RPM_BUILD_ROOT}/etc/modprobe.d mkdir -p ${RPM_BUILD_ROOT}/etc/modprobe.d
install -b -m644 %{kae_driver_path}/uacce/uacce.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra install -b -m644 %{kae_driver_path}/uacce/uacce.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m644 %{kae_driver_path}/hisilicon/hisi_qm.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra install -b -m644 %{kae_driver_path}/hisilicon/hisi_qm.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m644 %{kae_driver_path}/hisilicon/sec2/hisi_sec2.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra install -b -m644 %{kae_driver_path}/hisilicon/sec2/hisi_sec2.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m644 %{kae_driver_path}/conf/hisi_sec2.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_sec2.conf install -b -m644 %{kae_driver_path}/conf/hisi_sec2.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_sec2.conf
install -b -m644 %{kae_driver_path}/hisilicon/hpre/hisi_hpre.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra install -b -m644 %{kae_driver_path}/hisilicon/hpre/hisi_hpre.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m644 %{kae_driver_path}/conf/hisi_hpre.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_hpre.conf install -b -m644 %{kae_driver_path}/conf/hisi_hpre.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_hpre.conf
install -b -m644 %{kae_driver_path}/hisilicon/zip/hisi_zip.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra install -b -m644 %{kae_driver_path}/hisilicon/zip/hisi_zip.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m644 %{kae_driver_path}/conf/hisi_zip.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_zip.conf install -b -m644 %{kae_driver_path}/conf/hisi_zip.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_zip.conf
install -b -m644 %{kae_driver_path}/hisilicon/rde/hisi-trng-v2.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra install -b -m644 %{kae_driver_path}/hisilicon/rde/hisi-trng-v2.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m644 %{kae_driver_path}/conf/hisi_trng_v2.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_trng_v2.conf install -b -m644 %{kae_driver_path}/conf/hisi_trng_v2.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_trng_v2.conf
%clean %clean
rm -rf ${RPM_BUILD_ROOT} rm -rf ${RPM_BUILD_ROOT}
%pre -n uacce %pre -n uacce
echo "checking installed modules" echo "checking installed modules"
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
echo "uacce modules start to install" echo "uacce modules start to install"
fi fi
%pre -n hisi_sec2 %pre -n hisi_sec2
echo "checking installed modules" echo "checking installed modules"
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
echo "hisi_sec2 modules start to install" echo "hisi_sec2 modules start to install"
fi fi
%pre -n hisi_hpre %pre -n hisi_hpre
echo "checking installed modules" echo "checking installed modules"
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
echo "hisi_hpre modules start to install" echo "hisi_hpre modules start to install"
fi fi
%pre -n hisi_zip %pre -n hisi_zip
echo "checking installed modules" echo "checking installed modules"
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
echo "hisi_zip modules start to install" echo "hisi_zip modules start to install"
fi fi
%pre -n hisi_trng_v2 %pre -n hisi_trng_v2
echo "checking installed modules" echo "checking installed modules"
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
echo "hisi_trng_v2 modules start to install" echo "hisi_trng_v2 modules start to install"
fi fi
%post -n uacce %post -n uacce
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
/sbin/depmod -a > /dev/null 2>&1 || true /sbin/depmod -a > /dev/null 2>&1 || true
fi fi
echo "uacce modules installed" echo "uacce modules installed"
%post -n hisi_sec2 %post -n hisi_sec2
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
/sbin/depmod -a > /dev/null 2>&1 || true /sbin/depmod -a > /dev/null 2>&1 || true
fi fi
echo "hisi_sec2 modules installed" echo "hisi_sec2 modules installed"
%post -n hisi_hpre %post -n hisi_hpre
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
/sbin/depmod -a > /dev/null 2>&1 || true /sbin/depmod -a > /dev/null 2>&1 || true
fi fi
echo "hisi_hpre modules installed" echo "hisi_hpre modules installed"
%post -n hisi_zip %post -n hisi_zip
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
/sbin/depmod -a > /dev/null 2>&1 || true /sbin/depmod -a > /dev/null 2>&1 || true
fi fi
echo "hisi_zip modules installed" echo "hisi_zip modules installed"
%post -n hisi_trng_v2 %post -n hisi_trng_v2
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
/sbin/depmod -a > /dev/null 2>&1 || true /sbin/depmod -a > /dev/null 2>&1 || true
fi fi
echo "hisi_trng_v2 modules installed" echo "hisi_trng_v2 modules installed"
%preun -n uacce %preun -n uacce
if [ "$1" = "0" ] ; then #0: uninstall if [ "$1" = "0" ] ; then #0: uninstall
echo "uacce modules uninstalling" echo "uacce modules uninstalling"
fi fi
%preun -n hisi_sec2 %preun -n hisi_sec2
if [ "$1" = "0" ] ; then #0: uninstall if [ "$1" = "0" ] ; then #0: uninstall
echo "hisi_sec2 modules uninstalling" echo "hisi_sec2 modules uninstalling"
fi fi
%preun -n hisi_hpre %preun -n hisi_hpre
if [ "$1" = "0" ] ; then #0: uninstall if [ "$1" = "0" ] ; then #0: uninstall
echo "hisi_hpre modules uninstalling" echo "hisi_hpre modules uninstalling"
fi fi
%preun -n hisi_zip %preun -n hisi_zip
if [ "$1" = "0" ] ; then #0: uninstall if [ "$1" = "0" ] ; then #0: uninstall
echo "hisi_zip modules uninstalling" echo "hisi_zip modules uninstalling"
fi fi
%preun -n hisi_trng_v2 %preun -n hisi_trng_v2
if [ "$1" = "0" ] ; then #0: uninstall if [ "$1" = "0" ] ; then #0: uninstall
echo "hisi_trng_v2 modules uninstalling" echo "hisi_trng_v2 modules uninstalling"
fi fi
%postun -n uacce %postun -n uacce
if [ "$1" = "0" ] ; then #0: uninstall if [ "$1" = "0" ] ; then #0: uninstall
/sbin/depmod -a > /dev/null 2>&1 || true /sbin/depmod -a > /dev/null 2>&1 || true
fi fi
echo "uacce modules uninstalled" echo "uacce modules uninstalled"
%postun -n hisi_sec2 %postun -n hisi_sec2
if [ "$1" = "0" ] ; then #0: uninstall if [ "$1" = "0" ] ; then #0: uninstall
/sbin/depmod -a > /dev/null 2>&1 || true /sbin/depmod -a > /dev/null 2>&1 || true
fi fi
echo "hisi_sec2 modules uninstalled" echo "hisi_sec2 modules uninstalled"
%postun -n hisi_hpre %postun -n hisi_hpre
if [ "$1" = "0" ] ; then #0: uninstall if [ "$1" = "0" ] ; then #0: uninstall
/sbin/depmod -a > /dev/null 2>&1 || true /sbin/depmod -a > /dev/null 2>&1 || true
fi fi
echo "hisi_hpre modules uninstalled" echo "hisi_hpre modules uninstalled"
%postun -n hisi_zip %postun -n hisi_zip
if [ "$1" = "0" ] ; then #0: uninstall if [ "$1" = "0" ] ; then #0: uninstall
/sbin/depmod -a > /dev/null 2>&1 || true /sbin/depmod -a > /dev/null 2>&1 || true
fi fi
echo "hisi_zip modules uninstalled" echo "hisi_zip modules uninstalled"
%postun -n hisi_trng_v2 %postun -n hisi_trng_v2
if [ "$1" = "0" ] ; then #0: uninstall if [ "$1" = "0" ] ; then #0: uninstall
/sbin/depmod -a > /dev/null 2>&1 || true /sbin/depmod -a > /dev/null 2>&1 || true
fi fi
echo "hisi_trng_v2 modules uninstalled" echo "hisi_trng_v2 modules uninstalled"
%files -n uacce %files -n uacce
%defattr(644,root,root) %defattr(644,root,root)
/lib/modules/%{kernel_version}/extra/uacce.ko /lib/modules/%{kernel_version}/extra/uacce.ko
/lib/modules/%{kernel_version}/extra/hisi_qm.ko /lib/modules/%{kernel_version}/extra/hisi_qm.ko
%files -n hisi_sec2 %files -n hisi_sec2
%defattr(644,root,root) %defattr(644,root,root)
/lib/modules/%{kernel_version}/extra/hisi_sec2.ko /lib/modules/%{kernel_version}/extra/hisi_sec2.ko
%config(noreplace) /etc/modprobe.d/hisi_sec2.conf %config(noreplace) /etc/modprobe.d/hisi_sec2.conf
%files -n hisi_hpre %files -n hisi_hpre
%defattr(644,root,root) %defattr(644,root,root)
/lib/modules/%{kernel_version}/extra/hisi_hpre.ko /lib/modules/%{kernel_version}/extra/hisi_hpre.ko
%config(noreplace) /etc/modprobe.d/hisi_hpre.conf %config(noreplace) /etc/modprobe.d/hisi_hpre.conf
%files -n hisi_zip %files -n hisi_zip
%defattr(644,root,root) %defattr(644,root,root)
/lib/modules/%{kernel_version}/extra/hisi_zip.ko /lib/modules/%{kernel_version}/extra/hisi_zip.ko
%config(noreplace) /etc/modprobe.d/hisi_zip.conf %config(noreplace) /etc/modprobe.d/hisi_zip.conf
%files -n hisi_trng_v2 %files -n hisi_trng_v2
%defattr(644,root,root) %defattr(644,root,root)
/lib/modules/%{kernel_version}/extra/hisi-trng-v2.ko /lib/modules/%{kernel_version}/extra/hisi-trng-v2.ko
%config(noreplace) /etc/modprobe.d/hisi_trng_v2.conf %config(noreplace) /etc/modprobe.d/hisi_trng_v2.conf
%changelog %changelog
* Wed Nov 11 2020 wangyue <wangyue92@huawei.com> - 1.3.9-1 * Wed Nov 11 2020 wangyue <wangyue92@huawei.com> - 1.3.9-1
- Fix kae_driver build error on kernel 5.10 - Fix kae_driver build error on kernel 5.10
* Sun Mar 15 2020 zhangtao <zhangtao221@huawei.com> 1.2.10-3 * Sun Mar 15 2020 zhangtao <zhangtao221@huawei.com> 1.2.10-3
- specify aarch64 compilation - specify aarch64 compilation
* Tue Mar 03 2020 catastrowings <jianghuhao1994@163.com> 1.2.10-2 * Tue Mar 03 2020 catastrowings <jianghuhao1994@163.com> 1.2.10-2
- openEuler init - openEuler init
* Tue Jan 07 2020 jinbinhua <jinbinhua@huawei.com> 1.2.7-1 * Tue Jan 07 2020 jinbinhua <jinbinhua@huawei.com> 1.2.7-1
- First Spec Version Include all Kunpeng Accelerator Engine Kernel Driver Code - First Spec Version Include all Kunpeng Accelerator Engine Kernel Driver Code