kae_driver/kae_driver.spec

241 lines
7.2 KiB
RPMSpec
Raw Normal View History

2020-01-20 16:18:04 +08:00
%global debug_package %{nil}
Name: kae_driver
Summary: Kunpeng Accelerator Engine Kernel Driver
2020-03-04 02:21:12 +08:00
Version: 1.2.10
Release: 2
2020-01-20 16:18:04 +08:00
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
2019-12-26 20:55:23 +08:00
2020-02-03 18:01:05 +08:00
Patch0000: change-sva-macros-to-version2.patch
2020-03-04 02:21:12 +08:00
%define kernel_version %(uname -r)
%define kae_driver_path %{_builddir}/%{name}-%{version}/%{name}
2019-12-26 20:55:23 +08:00
%description
This package contains the Kunpeng Accelerator Engine Kernel Driver
2020-01-20 16:18:04 +08:00
%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.
2020-03-04 02:21:12 +08:00
2019-12-26 20:55:23 +08:00
%prep
2020-03-04 02:21:12 +08:00
%autosetup -c -n %{name}-%{version} -p1
2019-12-26 20:55:23 +08:00
%build
2020-03-04 02:21:12 +08:00
cd kae_driver
2019-12-26 20:55:23 +08:00
make
%install
mkdir -p ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
mkdir -p ${RPM_BUILD_ROOT}/etc/modprobe.d
2020-02-03 18:01:05 +08:00
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
2019-12-26 20:55:23 +08:00
%clean
rm -rf ${RPM_BUILD_ROOT}
2020-01-20 16:18:04 +08:00
%pre -n uacce
echo "checking installed modules"
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
echo "uacce modules start to install"
fi
2019-12-26 20:55:23 +08:00
2020-01-20 16:18:04 +08:00
%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
2019-12-26 20:55:23 +08:00
2020-01-20 16:18:04 +08:00
%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
2019-12-26 20:55:23 +08:00
2020-01-20 16:18:04 +08:00
%pre -n hisi_rde
2019-12-26 20:55:23 +08:00
echo "checking installed modules"
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
2020-01-20 16:18:04 +08:00
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
2019-12-26 20:55:23 +08:00
fi
2020-01-20 16:18:04 +08:00
echo "hisi_zip modules installed"
2019-12-26 20:55:23 +08:00
2020-01-20 16:18:04 +08:00
%post -n hisi_rde
2019-12-26 20:55:23 +08:00
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
/sbin/depmod -a > /dev/null 2>&1 || true
fi
2020-01-20 16:18:04 +08:00
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
2019-12-26 20:55:23 +08:00
2020-01-20 16:18:04 +08:00
%preun -n hisi_zip
2019-12-26 20:55:23 +08:00
if [ "$1" = "0" ] ; then #0: uninstall
2020-01-20 16:18:04 +08:00
echo "hisi_zip modules uninstalling"
2019-12-26 20:55:23 +08:00
fi
2020-01-20 16:18:04 +08:00
%preun -n hisi_rde
if [ "$1" = "0" ] ; then #0: uninstall
echo "hisi_rde modules uninstalling"
fi
%postun -n uacce
2019-12-26 20:55:23 +08:00
if [ "$1" = "0" ] ; then #0: uninstall
/sbin/depmod -a > /dev/null 2>&1 || true
fi
2020-01-20 16:18:04 +08:00
echo "uacce modules uninstalled"
2019-12-26 20:55:23 +08:00
2020-01-20 16:18:04 +08:00
%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"
2019-12-26 20:55:23 +08:00
2020-01-20 16:18:04 +08:00
%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
2020-03-04 02:21:12 +08:00
* Tue Mar 03 2020 catastrowings <jianghuhao1994@163.com> 1.2.10-2
- openEuler init
2019-12-26 20:55:23 +08:00
2020-01-20 16:18:04 +08:00
* Tue Jan 07 2020 jinbinhua <jinbinhua@huawei.com> 1.2.7-1
- First Spec Version Include all Kunpeng Accelerator Engine Kernel Driver Code