Skip to content

Commit

Permalink
Change kernel-mft rpm name to mft_kernel (#12025)
Browse files Browse the repository at this point in the history
Co-authored-by: Binu Jose Philip <[email protected]>
  • Loading branch information
binujp and Binu Jose Philip authored Jan 24, 2025
1 parent 53fa283 commit 255237f
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 99 deletions.
31 changes: 20 additions & 11 deletions SPECS-SIGNED/mft_kernel-signed/mft_kernel-signed.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@

%global KVERSION %{target_kernel_version_full}

%global _name kernel-mft

Name: %{_name}
Summary: %{name} Kernel Module for the %{KVERSION} kernel
Version: 4.30.0
Release: 1%{?dist}
License: Dual BSD/GPLv2
Group: System Environment/Kernel
Name: mft_kernel
Summary: %{name} Kernel Module for the %{KVERSION} kernel
Version: 4.30.0
Release: 1%{?dist}
License: Dual BSD/GPLv2
Group: System Environment/Kernel

#
# To populate these sources:
Expand All @@ -21,7 +19,7 @@ Group: System Environment/Kernel
# 3. Place the unsigned package and signed binary in this spec's folder
# 4. Build this spec

Source0: %{name}-%{version}-%{release}.%{_arch}.rpm
Source0: kernel-mft-%{version}-%{release}.%{_arch}.rpm
Source1: mst_pci.ko
Source2: mst_pciconf.ko
Vendor: Microsoft Corporation
Expand All @@ -34,6 +32,17 @@ Requires: kmod
%description
mft kernel module(s)

# Azure Linux attempts to match the spec file name and the "Name" tag.
# Upstream's mft_kernel spec set rpm name as kernel-mft. To comply, we
# set "Name" as mft_kernel but force a build of kernel-mft rpm and
# prevent mft_kernel rpm. A %files section is declared for kernel-mft
# but not for mft_kernel which is the default rpm.
%package -n kernel-mft
Summary: kernel-mft Kernel Module for the %{KVERSION} kernel

%description -n kernel-mft
This package provides a kernel-mft kernel module.

%global debug_package %{nil}

%prep
Expand All @@ -56,9 +65,9 @@ rm -rf %{buildroot}
%postun
/sbin/depmod %{KVERSION}

%files
%files -n kernel-mft
%defattr(-,root,root,-)
%license %{_datadir}/licenses/%{name}/COPYING
%license %{_defaultlicensedir}/kernel-mft/COPYING
/lib/modules/%{KVERSION}/updates/

%changelog
Expand Down
27 changes: 18 additions & 9 deletions SPECS/mft_kernel/mft_kernel.spec
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,11 @@
# 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}

%if "%{KMP}" == "1"
%global _name kernel-mft-mlnx
%else
%global _name kernel-mft
%endif

%{!?version: %global version 4.30.0}
%{!?_release: %global _release 1}
%global _kmp_rel %{_release}%{?_kmp_build_num}%{?_dist}

Name: kernel-mft
Name: mft_kernel
Summary: %{name} Kernel Module for the %{KVERSION} kernel
Version: 4.30.0
Release: 1%{?dist}
Expand All @@ -59,10 +53,21 @@ BuildRequires: kmod
Requires: kernel = %{target_kernel_version_full}
Requires: kmod


%description
mft kernel module(s)

# Azure Linux attempts to match the spec file name and the "Name" tag.
# Upstream's mft_kernel spec set rpm name as kernel-mft. To comply, we
# set "Name" as mft_kernel but force a build of kernel-mft rpm and
# prevent mft_kernel rpm. A %files section is declared for kernel-mft
# but not for mft_kernel which is the default rpm.
%package -n kernel-mft
Summary: kernel-mft Kernel Module for the %{KVERSION} kernel

%description -n kernel-mft
This package provides a kernel-mft kernel module.


%global debug_package %{nil}

%global IS_RHEL_VENDOR "%{_vendor}" == "redhat" || "%{_vendor}" == "bclinux" || "%{_vendor}" == "openEuler"
Expand Down Expand Up @@ -209,8 +214,12 @@ find %{buildroot} -type f -name \*.ko -exec %{__strip} -p --strip-debug --discar
%postun
/sbin/depmod %{KVERSION}

# Install license file to %{_defaultlicensedir}/kernel-mft for %files to pick-up
# and set license metadata correct
%define licensedir %{_defaultlicensedir}/kernel-mft/

%if "%{KMP}" != "1"
%files
%files -n kernel-mft
%defattr(-,root,root,-)
%license source/COPYING
/lib/modules/%{KVERSION}/%{install_mod_dir}/
Expand Down
Loading

0 comments on commit 255237f

Please sign in to comment.