-
Notifications
You must be signed in to change notification settings - Fork 575
/
Copy pathmft_kernel-signed.spec
110 lines (80 loc) · 3.58 KB
/
mft_kernel-signed.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
%global debug_package %{nil}
# The default %%__os_install_post macro ends up stripping the signatures off of the kernel module.
%define __os_install_post %{__os_install_post_leave_signatures} %{nil}
%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}
Name: mft_kernel
Summary: %{name} Kernel Module for the %{KVERSION} kernel
Version: 4.30.0
Release: 11%{?dist}
License: Dual BSD/GPLv2
Group: System Environment/Kernel
#
# 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: mst_pci.ko
Source2: mst_pciconf.ko
Vendor: Microsoft Corporation
Distribution: Azure Linux
ExclusiveArch: x86_64
Requires: kernel = %{target_kernel_version_full}
Requires: kmod
# 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 add a "Provides" for kernel-mft.
Provides: kernel-mft = %{version}-%{release}
%description
mft kernel module(s)
%prep
%build
mkdir rpm_contents
pushd rpm_contents
# This spec's whole purpose is to inject the signed modules
rpm2cpio %{SOURCE0} | cpio -idmv
cp -rf %{SOURCE1} ./lib/modules/%{KVERSION}/updates/mst_pci.ko
cp -rf %{SOURCE2} ./lib/modules/%{KVERSION}/updates/mst_pciconf.ko
popd
%install
pushd rpm_contents
# Don't use * wildcard. It does not copy over hidden files in the root folder...
cp -rp ./. %{buildroot}/
popd
%post
/sbin/depmod %{KVERSION}
%postun
/sbin/depmod %{KVERSION}
%files
%defattr(-,root,root,-)
%license %{_defaultlicensedir}/%{name}/COPYING
/lib/modules/%{KVERSION}/updates/
%changelog
* Mon Mar 10 2025 Chris Co <[email protected]> - 4.30.0-11
- Bump release to rebuild for new kernel release
* Wed Mar 05 2025 Rachel Menge <[email protected]> - 4.30.0-10
- Bump release to rebuild for new kernel release
* Tue Mar 04 2025 Rachel Menge <[email protected]> - 4.30.0-9
- Bump release to rebuild for new kernel release
* Wed Feb 19 2025 Chris Co <[email protected]> - 4.30.0-8
- Bump release to rebuild for new kernel release
* Tue Feb 11 2025 Rachel Menge <[email protected]> - 4.30.0-7
- Bump release to rebuild for new kernel release
* Wed Feb 05 2025 Tobias Brick <[email protected]> - 4.30.0-6
- Bump release to rebuild for new kernel release
* Tue Feb 04 2025 Alberto David Perez Guevara <[email protected]> - 4.30.0-5
- Bump release to rebuild for new kernel release
* Fri Jan 31 2025 Alberto David Perez Guevara <[email protected]> - 4.30.0-4
- Bump release to rebuild for new kernel release
* Fri Jan 31 2025 Alberto David Perez Guevara <[email protected]> - 4.30.0-3
- Bump release to match kernel
* Thu Jan 30 2025 Rachel Menge <[email protected]> - 4.30.0-2
- Bump release to match kernel
* Tue Dec 17 2024 Binu Jose Philip <[email protected]> - 4.30.0-1
- Creating signed spec
- Initial Azure Linux import from NVIDIA (license: GPLv2)
- License verified