1 Star 0 Fork 14

wuliaokanke/kae_driver

forked from src-openEuler/kae_driver 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
kae_driver.spec 7.59 KB
一键复制 编辑 原始数据 按行查看 历史
wang_yue111 提交于 2020-11-11 17:33 . fix kae_driver build error
%global debug_package %{nil}
Name: kae_driver
Summary: Kunpeng Accelerator Engine Kernel Driver
Version: 1.3.9
Release: 1
License: GPL-2.0
Source: %{name}-%{version}.tar.gz
Vendor: Huawei Corporation
ExclusiveOS: linux
URL: https://support.huawei.com
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release}
BuildRequires: kernel-devel, gcc, make
ExclusiveArch: aarch64
Patch0001: fix-vm_fault_t-conflict.patch
Patch0002: fix-Makefile-compilation-failed.patch
Patch0003: fix-value-not-ignored-as-it-ought-to-be.patch
Patch0004: support-kernel-5.7.0-compation.patch
%define kernel_version %(uname -r)
%define kae_driver_path %{_builddir}/%{name}-%{version}/%{name}
%description
This package contains the Kunpeng Accelerator Engine Kernel Driver
%package -n uacce
Summary: Unified/User-space-access-intended Accelerator Framework
Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release}
%description -n uacce
This package contains the Unified/User-space-access-intended Accelerator Framework.
%package -n hisi_sec2
Summary: Huawei Hisilicon SEC Accelerator Driver
Requires: uacce >= %{version}-%{release}
Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release}
%description -n hisi_sec2
This package contains the Huawei Hisilicon SEC Accelerator Driver.
%package -n hisi_hpre
Summary: Huawei Hisilicon HPRE Accelerator Driver
Requires: uacce >= %{version}-%{release}
Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release}
%description -n hisi_hpre
This package contains the Huawei Hisilicon HPRE Accelerator Driver.
%package -n hisi_zip
Summary: Huawei Hisilicon ZIP Accelerator Driver
Requires: uacce >= %{version}-%{release}
Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release}
%description -n hisi_zip
This package contains the Huawei Hisilicon ZIP Accelerator Driver.
%package -n hisi_rde
Summary: Huawei Hisilicon RDE Accelerator Driver
Requires: uacce >= %{version}-%{release}
Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release}
%description -n hisi_rde
This package contains the Huawei Hisilicon RDE Accelerator Driver.
%prep
%autosetup -c -n %{name}-%{version} -p1
%build
cd kae_driver
make
%install
mkdir -p ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
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}/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}/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}/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}/conf/hisi_zip.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_zip.conf
install -b -m644 %{kae_driver_path}/hisilicon/rde/hisi_rde.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m644 %{kae_driver_path}/conf/hisi_rde.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_rde.conf
%clean
rm -rf ${RPM_BUILD_ROOT}
%pre -n uacce
echo "checking installed modules"
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
echo "uacce modules start to install"
fi
%pre -n hisi_sec2
echo "checking installed modules"
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
echo "hisi_sec2 modules start to install"
fi
%pre -n hisi_hpre
echo "checking installed modules"
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
echo "hisi_hpre modules start to install"
fi
%pre -n hisi_zip
echo "checking installed modules"
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
echo "hisi_zip modules start to install"
fi
%pre -n hisi_rde
echo "checking installed modules"
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
echo "hisi_rde modules start to install"
fi
%post -n uacce
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
/sbin/depmod -a > /dev/null 2>&1 || true
fi
echo "uacce modules installed"
%post -n hisi_sec2
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
/sbin/depmod -a > /dev/null 2>&1 || true
fi
echo "hisi_sec2 modules installed"
%post -n hisi_hpre
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
/sbin/depmod -a > /dev/null 2>&1 || true
fi
echo "hisi_hpre modules installed"
%post -n hisi_zip
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
/sbin/depmod -a > /dev/null 2>&1 || true
fi
echo "hisi_zip modules installed"
%post -n hisi_rde
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
/sbin/depmod -a > /dev/null 2>&1 || true
fi
echo "hisi_rde modules installed"
%preun -n uacce
if [ "$1" = "0" ] ; then #0: uninstall
echo "uacce modules uninstalling"
fi
%preun -n hisi_sec2
if [ "$1" = "0" ] ; then #0: uninstall
echo "hisi_sec2 modules uninstalling"
fi
%preun -n hisi_hpre
if [ "$1" = "0" ] ; then #0: uninstall
echo "hisi_hpre modules uninstalling"
fi
%preun -n hisi_zip
if [ "$1" = "0" ] ; then #0: uninstall
echo "hisi_zip modules uninstalling"
fi
%preun -n hisi_rde
if [ "$1" = "0" ] ; then #0: uninstall
echo "hisi_rde modules uninstalling"
fi
%postun -n uacce
if [ "$1" = "0" ] ; then #0: uninstall
/sbin/depmod -a > /dev/null 2>&1 || true
fi
echo "uacce modules uninstalled"
%postun -n hisi_sec2
if [ "$1" = "0" ] ; then #0: uninstall
/sbin/depmod -a > /dev/null 2>&1 || true
fi
echo "hisi_sec2 modules uninstalled"
%postun -n hisi_hpre
if [ "$1" = "0" ] ; then #0: uninstall
/sbin/depmod -a > /dev/null 2>&1 || true
fi
echo "hisi_hpre modules uninstalled"
%postun -n hisi_zip
if [ "$1" = "0" ] ; then #0: uninstall
/sbin/depmod -a > /dev/null 2>&1 || true
fi
echo "hisi_zip modules uninstalled"
%postun -n hisi_rde
if [ "$1" = "0" ] ; then #0: uninstall
/sbin/depmod -a > /dev/null 2>&1 || true
fi
echo "hisi_rde modules uninstalled"
%files -n uacce
%defattr(644,root,root)
/lib/modules/%{kernel_version}/extra/uacce.ko
/lib/modules/%{kernel_version}/extra/hisi_qm.ko
%files -n hisi_sec2
%defattr(644,root,root)
/lib/modules/%{kernel_version}/extra/hisi_sec2.ko
%config(noreplace) /etc/modprobe.d/hisi_sec2.conf
%files -n hisi_hpre
%defattr(644,root,root)
/lib/modules/%{kernel_version}/extra/hisi_hpre.ko
%config(noreplace) /etc/modprobe.d/hisi_hpre.conf
%files -n hisi_zip
%defattr(644,root,root)
/lib/modules/%{kernel_version}/extra/hisi_zip.ko
%config(noreplace) /etc/modprobe.d/hisi_zip.conf
%files -n hisi_rde
%defattr(644,root,root)
/lib/modules/%{kernel_version}/extra/hisi_rde.ko
%config(noreplace) /etc/modprobe.d/hisi_rde.conf
%changelog
* Wed Nov 11 2020 wangyue <[email protected]> - 1.3.9-1
- Fix kae_driver build error on kernel 5.10
* Sun Mar 15 2020 zhangtao <[email protected]> 1.2.10-3
- specify aarch64 compilation
* Tue Mar 03 2020 catastrowings <[email protected]> 1.2.10-2
- openEuler init
* Tue Jan 07 2020 jinbinhua <[email protected]> 1.2.7-1
- First Spec Version Include all Kunpeng Accelerator Engine Kernel Driver Code
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wuliaokanke/kae_driver.git
[email protected]:wuliaokanke/kae_driver.git
wuliaokanke
kae_driver
kae_driver
master

搜索帮助