Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bphilip/add mofed and dependencies #11479

Draft
wants to merge 16 commits into
base: 3.0-dev
Choose a base branch
from
Draft
3 changes: 2 additions & 1 deletion LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 32 additions & 1 deletion LICENSES-AND-NOTICES/SPECS/data/licenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -2453,12 +2453,43 @@
"NVIDIA": {
"license": "[ASL 2.0 License and spec specific licenses](http://www.apache.org/licenses/LICENSE-2.0)",
"specs": [
"fwctl",
"fwctl-signed",
"ibarr",
"ibsim",
"iser",
"iser-signed",
"isert",
"isert-signed",
"knem",
"knem-modules-signed",
"libnvidia-container",
"mft_kernel",
"mft_kernel-signed",
"mlnx-ethtool",
"mlnx-iproute2",
"mlnx-nfsrdma",
"mlnx-nfsrdma-signed",
"mlnx-ofa_kernel",
"mlnx-ofa_kernel-modules-signed",
"mlnx-tools",
"mlx-bootctl",
"mlx-steering-dump",
"multiperf",
"nvidia-container-toolkit",
"ofed-scripts",
"perftest"
"perftest",
"rshim",
"srp",
"xpmem",
"xpmem-lib",
"xpmem-modules-signed"
]
},
"NVIDIA (BSD)": {
"license": "[BSD](https://github.com/Mellanox/sockperf/blob/sockperf_v2/copying)",
"specs": [
"sockperf"
]
},
"OpenEuler": {
Expand Down
143 changes: 143 additions & 0 deletions SPECS-SIGNED/fwctl-signed/fwctl-signed.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
#
# Copyright (c) 2024 Nvidia Inc. All rights reserved.
#
# This software is available to you under a choice of one of two
# licenses. You may choose to be licensed under the terms of the GNU
# General Public License (GPL) Version 2, available from the file
# COPYING in the main directory of this source tree, or the
# OpenIB.org BSD license below:
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# - Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# - Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#

%{!?_name: %define _name fwctl}
%{!?_version: %define _version 24.10}
%{!?_release: %define _release OFED.24.10.0.6.7.1}

%global target_kernel_version_full %(/bin/rpm -q --queryformat '%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}' $(/bin/rpm -q --whatprovides kernel-headers))
%global target_azurelinux_build_kernel_version %(/bin/rpm -q --queryformat '%{RPMTAG_VERSION}' $(/bin/rpm -q --whatprovides kernel-headers))
%global target_kernel_release %(/bin/rpm -q --queryformat '%{RPMTAG_RELEASE}' $(/bin/rpm -q --whatprovides kernel-headers) | /bin/cut -d . -f 1)

%global KVERSION %{target_kernel_version_full}
%global K_SRC /lib/modules/%{target_kernel_version_full}/build

# KMP is disabled by default
%{!?KMP: %global KMP 0}

# take kernel version or default to uname -r
# %{!?KVERSION: %global KVERSION %(uname -r)}
%{!?KVERSION: %global KVERSION %{target_kernel_version_full}}
%global kernel_version %{KVERSION}
%global krelver %(echo -n %{KVERSION} | sed -e 's/-/_/g')
# take path to kernel sources if provided, otherwise look in default location (for non KMP rpms).
%{!?K_SRC: %global K_SRC /lib/modules/%{KVERSION}/build}

# define release version
%{!?src_release: %global src_release %{_release}_%{krelver}}
%if "%{KMP}" != "1"
%global _release1 %{src_release}
%else
%global _release1 %{_release}
%endif
%global _kmp_rel %{_release1}%{?_kmp_build_num}%{?_dist}

Summary: %{_name} Driver
Name: %{_name}
Version: %{_version}
Release: 1%{?dist}
License: GPLv2
Url: http://nvidia.com
Group: System Environment/Base

# This package's "version" and "release" must reflect the unsigned version that
# was signed.
# An important consequence is that when making a change to this package, the
# unsigned version/release must be increased to keep the two versions consistent.
# Ideally though, this spec will not change much or at all, so the version will
# just track the unsigned package's version/release.
#
# To populate these sources:
# 1. Build the unsigned packages as normal
# 2. Sign the desired binary
# 3. Place the unsigned package and signed binary in this spec's folder
# 4. Build this spec

Source0: %{name}-%{version}-%{release}.%{_arch}.rpm
Source1: fwctl.ko
Source2: mlx5_fwctl.ko

BuildRoot: /var/tmp/%{name}-%{version}-build
Vendor: Microsoft Corporation
Distribution: Azure Linux

BuildRequires: gcc
BuildRequires: make
BuildRequires: kernel-devel = %{target_kernel_version_full}
BuildRequires: kernel-headers = %{target_kernel_version_full}
BuildRequires: binutils
BuildRequires: systemd
BuildRequires: kmod
BuildRequires: mlnx-ofa_kernel-devel = %{_version}
BuildRequires: mlnx-ofa_kernel-source = %{_version}

Requires: mlnx-ofa_kernel = %{_version}
Requires: mlnx-ofa_kernel-modules = %{_version}
Requires: kernel = %{target_kernel_version_full}
Requires: kmod

%description
fwctl signed kernel modules

%prep

%build
rpm2cpio %{Source0} | cpio -idmv -D %{buildroot}

%install
cp %{Source1} %{buildroot}/lib/modules/%{KVERSION}/updates/fwctl/fwctl.ko
cp %{Source2} %{buildroot}/lib/modules/%{KVERSION}/updates/fwctl/mlx5/mlx5_fwctl.ko

%clean
rm -rf %{buildroot}

%post
if [ $1 -ge 1 ]; then # 1 : This package is being installed or reinstalled
/sbin/depmod %{KVERSION}
fi # 1 : closed
# END of post

%postun
/sbin/depmod %{KVERSION}

%if "%{KMP}" != "1"
%files
%defattr(-,root,root,-)
/lib/modules/%{KVERSION}/%{install_mod_dir}/
%config(noreplace) %{_sysconfdir}/depmod.d/zz02-%{name}-*.conf
%endif

%changelog
* Tue Dec 16 2024 Binu Jose Philip <[email protected]> - 24.10.0.6.7.1
- Creating signed spec
- Initial Azure Linux import from NVIDIA (license: GPLv2)
- License verified
137 changes: 137 additions & 0 deletions SPECS-SIGNED/iser-signed/iser-signed.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
#
# Copyright (c) 2014 Mellanox Technologies. All rights reserved.
#
# This Software is licensed under one of the following licenses:
#
# 1) under the terms of the "Common Public License 1.0" a copy of which is
# available from the Open Source Initiative, see
# http://www.opensource.org/licenses/cpl.php.
#
# 2) under the terms of the "The BSD License" a copy of which is
# available from the Open Source Initiative, see
# http://www.opensource.org/licenses/bsd-license.php.
#
# 3) under the terms of the "GNU General Public License (GPL) Version 2" a
# copy of which is available from the Open Source Initiative, see
# http://www.opensource.org/licenses/gpl-license.php.
#
# Licensee has the right to choose one of the above licenses.
#
# Redistributions of source code must retain the above copyright
# notice and one of the license notices.
#
# Redistributions in binary form must reproduce both the above copyright
# notice, one of the license notices in the documentation
# and/or other materials provided with the distribution.
#
#

%global target_kernel_version_full %(/bin/rpm -q --queryformat '%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}' $(/bin/rpm -q --whatprovides kernel-headers))
%global target_azurelinux_build_kernel_version %(/bin/rpm -q --queryformat '%{RPMTAG_VERSION}' $(/bin/rpm -q --whatprovides kernel-headers))
%global target_kernel_release %(/bin/rpm -q --queryformat '%{RPMTAG_RELEASE}' $(/bin/rpm -q --whatprovides kernel-headers) | /bin/cut -d . -f 1)

%global KVERSION %{target_kernel_version_full}
%global K_SRC /lib/modules/%{target_kernel_version_full}/build

%{!?_name: %define _name iser}
%{!?_version: %define _version 24.10}
%{!?_release: %define _release OFED.24.10.0.6.7.1}

# KMP is disabled by default
%{!?KMP: %global KMP 0}

# take kernel version or default to uname -r
# %{!?KVERSION: %global KVERSION %(uname -r)}
%{!?KVERSION: %global KVERSION %{target_kernel_version_full}}
%global kernel_version %{KVERSION}
%global krelver %(echo -n %{KVERSION} | sed -e 's/-/_/g')
# take path to kernel sources if provided, otherwise look in default location (for non KMP rpms).
# %{!?K_SRC: %global K_SRC /lib/modules/%{KVERSION}/build}

# define release version
%{!?src_release: %global src_release %{_release}_%{krelver}}
%if "%{KMP}" != "1"
%global _release1 %{src_release}
%else
%global _release1 %{_release}
%endif
%global _kmp_rel %{_release1}%{?_kmp_build_num}%{?_dist}

Summary: %{_name} Driver
Name: %{_name}
Version: %{_version}
Release: 1%{?dist}
License: GPLv2
Url: http://www.mellanox.com
Group: System Environment/Base

# This package's "version" and "release" must reflect the unsigned version that
# was signed.
# An important consequence is that when making a change to this package, the
# unsigned version/release must be increased to keep the two versions consistent.
# Ideally though, this spec will not change much or at all, so the version will
# just track the unsigned package's version/release.
#
# To populate these sources:
# 1. Build the unsigned packages as normal
# 2. Sign the desired binary
# 3. Place the unsigned package and signed binary in this spec's folder
# 4. Build this spec

Source0: %{name}-%{version}-%{release}.%{_arch}.rpm
Source1: ib_iser.ko

BuildRoot: /var/tmp/%{name}-%{version}-build
Vendor: Microsoft Corporation
Distribution: Azure Linux

BuildRequires: gcc
BuildRequires: make
BuildRequires: kernel-devel = %{target_kernel_version_full}
BuildRequires: kernel-headers = %{target_kernel_version_full}
BuildRequires: binutils
BuildRequires: systemd
BuildRequires: kmod
BuildRequires: mlnx-ofa_kernel-devel = %{_version}
BuildRequires: mlnx-ofa_kernel-source = %{_version}

Requires: mlnx-ofa_kernel = %{_version}
Requires: mlnx-ofa_kernel-modules = %{_version}
Requires: kernel = %{target_kernel_version_full}
Requires: kmod

%description
iser signed kernel modules

%prep

%build
rpm2cpio %{Source0} | cpio -idmv -D %{buildroot}

%install
cp %{Source1} %{buildroot}/lib/modules/%{KVERSION}/updates/iser/ib_iser.ko

%clean
rm -rf %{buildroot}

%post
if [ $1 -ge 1 ]; then # 1 : This package is being installed or reinstalled
/sbin/depmod %{KVERSION}
fi # 1 : closed
# END of post

%postun
/sbin/depmod %{KVERSION}

%if "%{KMP}" != "1"
%files
%defattr(-,root,root,-)
/lib/modules/%{KVERSION}/%{install_mod_dir}/
%config(noreplace) %{_sysconfdir}/depmod.d/zz02-%{name}-*.conf
%endif

%changelog
* Tue Dec 16 2024 Binu Jose Philip <[email protected]> - 24.10.0.6.7.1
- Creating signed spec
- License verified
- Initial Azure Linux import from NVIDIA (license: GPLv2)
Loading
Loading