diff --git a/kae_driver-1.2.1.tar.gz b/kae_driver-1.2.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..84093c57d316375b53259bfc2ca1dde4375274cb Binary files /dev/null and b/kae_driver-1.2.1.tar.gz differ diff --git a/kae_driver.spec b/kae_driver.spec new file mode 100644 index 0000000000000000000000000000000000000000..e035143bbe37c1b5da9dd0ec7a11ccfc30907237 --- /dev/null +++ b/kae_driver.spec @@ -0,0 +1,80 @@ +Name: kae_driver +Summary: Kunpeng Accelerator Engine Kernel Driver +Version: 1.2.1 +Release: 1 +Source: %{name}-%{version}.tar.gz +Vendor: Huawei Corporation +License: GPL-2.0 +ExclusiveOS: linux +Group: System Environment/Kernel +Provides: %{name} = %{version} +URL:https://support.huawei.com +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +Conflicts: %{name} < %{version} +BuildRequires: kernel-devel, gcc, make + +%define kernel_version %(uname -r) + +%description +This package contains the Kunpeng Accelerator Engine Kernel Driver + +%prep +%global debug_package %{nil} +%setup -c -n %{name}-%{version} + +%build +cd kmodules +make + + +%install +mkdir -p ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra +install -p -m 0644 kmodules/uacce/uacce.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra +install -p -m 0644 kmodules/hisilicon/hisi_qm.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra +install -p -m 0644 kmodules/hisilicon/sec2/hisi_sec2.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra +install -p -m 0644 kmodules/hisilicon/hpre/hisi_hpre.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra +mkdir -p ${RPM_BUILD_ROOT}/etc/modprobe.d +install -p -m 0644 kmodules/conf/hisi_sec2.conf ${RPM_BUILD_ROOT}/etc/modprobe.d +install -p -m 0644 kmodules/conf/hisi_hpre.conf ${RPM_BUILD_ROOT}/etc/modprobe.d + +%clean +rm -rf ${RPM_BUILD_ROOT} + + +%files +%defattr(644,root,root) +/lib/modules/%{kernel_version}/extra/uacce.ko +/lib/modules/%{kernel_version}/extra/hisi_qm.ko +/lib/modules/%{kernel_version}/extra/hisi_sec2.ko +/lib/modules/%{kernel_version}/extra/hisi_hpre.ko + +%config(noreplace) /etc/modprobe.d/hisi_sec2.conf +%config(noreplace) /etc/modprobe.d/hisi_hpre.conf + +%pre +echo "checking installed modules" +if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update + echo "%{name} modules start to install" +fi + +%post +if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update + /sbin/depmod -a > /dev/null 2>&1 || true +fi +echo "%{name} modules installed" + +%preun +if [ "$1" = "0" ] ; then #0: uninstall + echo "%{name} modules uninstalling" +fi + +%postun +if [ "$1" = "0" ] ; then #0: uninstall + /sbin/depmod -a > /dev/null 2>&1 || true +fi +echo "%{name} modules uninstalled" + +%changelog + +