|
| 1 | +# |
| 2 | +# Copyright (c) 2024 Nvidia Inc. All rights reserved. |
| 3 | +# |
| 4 | +# This software is available to you under a choice of one of two |
| 5 | +# licenses. You may choose to be licensed under the terms of the GNU |
| 6 | +# General Public License (GPL) Version 2, available from the file |
| 7 | +# COPYING in the main directory of this source tree, or the |
| 8 | +# OpenIB.org BSD license below: |
| 9 | +# |
| 10 | +# Redistribution and use in source and binary forms, with or |
| 11 | +# without modification, are permitted provided that the following |
| 12 | +# conditions are met: |
| 13 | +# |
| 14 | +# - Redistributions of source code must retain the above |
| 15 | +# copyright notice, this list of conditions and the following |
| 16 | +# disclaimer. |
| 17 | +# |
| 18 | +# - Redistributions in binary form must reproduce the above |
| 19 | +# copyright notice, this list of conditions and the following |
| 20 | +# disclaimer in the documentation and/or other materials |
| 21 | +# provided with the distribution. |
| 22 | +# |
| 23 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 24 | +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 25 | +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 26 | +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 27 | +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 28 | +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 29 | +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 30 | +# SOFTWARE. |
| 31 | +# |
| 32 | + |
| 33 | +%global target_kernel_version_full %(/bin/rpm -q --queryformat '%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}' $(/bin/rpm -q --whatprovides kernel-headers)) |
| 34 | +%global target_azurelinux_build_kernel_version %(/bin/rpm -q --queryformat '%{RPMTAG_VERSION}' $(/bin/rpm -q --whatprovides kernel-headers)) |
| 35 | +%global target_kernel_release %(/bin/rpm -q --queryformat '%{RPMTAG_RELEASE}' $(/bin/rpm -q --whatprovides kernel-headers) | /bin/cut -d . -f 1) |
| 36 | + |
| 37 | +%global KVERSION %{target_kernel_version_full} |
| 38 | + |
| 39 | +%{!?_name: %define _name fwctl} |
| 40 | + |
| 41 | +Summary: %{_name} Driver |
| 42 | +Name: %{_name} |
| 43 | +Version: 24.10 |
| 44 | +Release: 1%{?dist} |
| 45 | +License: GPLv2 |
| 46 | +Url: http://nvidia.com |
| 47 | +Group: System Environment/Base |
| 48 | + |
| 49 | +# |
| 50 | +# To populate these sources: |
| 51 | +# 1. Build the unsigned packages as normal |
| 52 | +# 2. Sign the desired binary |
| 53 | +# 3. Place the unsigned package and signed binary in this spec's folder |
| 54 | +# 4. Build this spec |
| 55 | + |
| 56 | +Source0: %{name}-%{version}-%{release}.%{_arch}.rpm |
| 57 | +Source1: fwctl.ko |
| 58 | +Source2: mlx5_fwctl.ko |
| 59 | + |
| 60 | +Vendor: Microsoft Corporation |
| 61 | +Distribution: Azure Linux |
| 62 | +ExclusiveArch: x86_64 |
| 63 | + |
| 64 | +Requires: mlnx-ofa_kernel = %{_version} |
| 65 | +Requires: mlnx-ofa_kernel-modules = %{_version} |
| 66 | +Requires: kernel = %{target_kernel_version_full} |
| 67 | +Requires: kmod |
| 68 | + |
| 69 | +%description |
| 70 | +fwctl signed kernel modules |
| 71 | + |
| 72 | +%prep |
| 73 | + |
| 74 | +%build |
| 75 | + |
| 76 | +%install |
| 77 | +rpm2cpio %{SOURCE0} | cpio -idmv -D %{buildroot} |
| 78 | + |
| 79 | +cp -r %{SOURCE1} %{buildroot}/lib/modules/%{KVERSION}/updates/fwctl/fwctl.ko |
| 80 | +cp -r %{SOURCE2} %{buildroot}/lib/modules/%{KVERSION}/updates/fwctl/mlx5/mlx5_fwctl.ko |
| 81 | + |
| 82 | +%clean |
| 83 | +rm -rf %{buildroot} |
| 84 | + |
| 85 | +%post |
| 86 | +if [ $1 -ge 1 ]; then # 1 : This package is being installed or reinstalled |
| 87 | + /sbin/depmod %{KVERSION} |
| 88 | +fi # 1 : closed |
| 89 | +# END of post |
| 90 | + |
| 91 | +%postun |
| 92 | +/sbin/depmod %{KVERSION} |
| 93 | + |
| 94 | +%files |
| 95 | +%defattr(-,root,root,-) |
| 96 | +%license %{_datadir}/licenses/%{name}/copyright |
| 97 | +/lib/modules/%{KVERSION}/updates/ |
| 98 | +%config(noreplace) %{_sysconfdir}/depmod.d/zz02-%{name}-*.conf |
| 99 | + |
| 100 | + |
| 101 | +%changelog |
| 102 | +* Tue Dec 16 2024 Binu Jose Philip <bphilip@microsoft.com> - 24.10.0.6.7.1 |
| 103 | +- Creating signed spec |
| 104 | +- Initial Azure Linux import from NVIDIA (license: GPLv2) |
| 105 | +- License verified |
0 commit comments