Skip to content

Commit fc01664

Browse files
authored
Prevent stripping of BTF data from kernel modules (#13813)
Add `%define _find_debuginfo_opts --keep-section '.BTF'` to the kernel specs to ensure that the BTF section is preserved in kernel modules. This allows modules to retain BTF info required for eBPF and kernel introspection tools and populates the sys/kernel/btf sysfs with the data.
1 parent 35d3ba3 commit fc01664

12 files changed

Lines changed: 45 additions & 15 deletions

File tree

SPECS-EXTENDED/kernel-ipe/kernel-ipe.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
%undefine _unique_debug_names
1515
%global _missing_build_ids_terminate_build 1
1616
%global _no_recompute_build_ids 1
17+
# Prevent find_debuginfo.sh from removing the BTF section from modules
18+
%define _find_debuginfo_opts --keep-section '.BTF'
1719

1820
%ifarch x86_64
1921
%define arch x86_64
@@ -31,7 +33,7 @@
3133
Summary: Linux Kernel
3234
Name: kernel-ipe
3335
Version: 6.6.92.2
34-
Release: 1%{?dist}
36+
Release: 2%{?dist}
3537
License: GPLv2
3638
Vendor: Microsoft Corporation
3739
Distribution: Azure Linux
@@ -451,6 +453,9 @@ echo "initrd of kernel %{uname_r} removed" >&2
451453
%{_sysconfdir}/bash_completion.d/bpftool
452454

453455
%changelog
456+
* Mon Jun 09 2025 Rachel Menge <rachelmenge@microsoft.com> - 6.6.92.2-2
457+
- Prevent debuginfo from stripping BTF data
458+
454459
* Fri May 30 2025 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 6.6.92.2-1
455460
- Auto-upgrade to 6.6.92.2
456461

SPECS-SIGNED/kernel-64k-signed/kernel-64k-signed.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Summary: Signed Linux Kernel for %{buildarch} systems
88
Name: kernel-64k-signed-%{buildarch}
99
Version: 6.6.92.2
10-
Release: 1%{?dist}
10+
Release: 2%{?dist}
1111
License: GPLv2
1212
Vendor: Microsoft Corporation
1313
Distribution: Azure Linux
@@ -105,6 +105,9 @@ echo "initrd of kernel %{uname_r} removed" >&2
105105
%exclude /module_info.ld
106106

107107
%changelog
108+
* Mon Jun 09 2025 Rachel Menge <rachelmenge@microsoft.com> - 6.6.92.2-2
109+
- Bump release to match kernel
110+
108111
* Fri May 30 2025 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 6.6.92.2-1
109112
- Auto-upgrade to 6.6.92.2
110113

SPECS-SIGNED/kernel-signed/kernel-signed.spec

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Summary: Signed Linux Kernel for %{buildarch} systems
1111
Name: kernel-signed-%{buildarch}
1212
Version: 6.6.92.2
13-
Release: 1%{?dist}
13+
Release: 2%{?dist}
1414
License: GPLv2
1515
Vendor: Microsoft Corporation
1616
Distribution: Azure Linux
@@ -145,6 +145,9 @@ echo "initrd of kernel %{uname_r} removed" >&2
145145
%exclude /module_info.ld
146146

147147
%changelog
148+
* Mon Jun 09 2025 Rachel Menge <rachelmenge@microsoft.com> - 6.6.92.2-2
149+
- Bump release to match kernel
150+
148151
* Fri May 30 2025 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 6.6.92.2-1
149152
- Auto-upgrade to 6.6.92.2
150153

@@ -376,7 +379,7 @@ echo "initrd of kernel %{uname_r} removed" >&2
376379
* Fri Feb 23 2024 Chris Gunn <chrisgun@microsoft.com> - 6.6.14.1-3
377380
- Rename initrd.img-<kver> to initramfs-<kver>.img
378381

379-
* Tue Jan 30 2024 Cameron Baird <cameronbaird@microsoft.com> - 6.6.14.1-2
382+
* Tue Feb 20 2024 Cameron Baird <cameronbaird@microsoft.com> - 6.6.14.1-2
380383
- Remove legacy /boot/mariner.cfg
381384
- Introduce /etc/default/grub.d/10_kernel.cfg
382385

@@ -419,7 +422,7 @@ echo "initrd of kernel %{uname_r} removed" >&2
419422
* Tue Sep 26 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 5.15.133.1-1
420423
- Auto-upgrade to 5.15.133.1
421424

422-
* Tue Sep 22 2023 Cameron Baird <cameronbaird@microsoft.com> - 5.15.131.1-3
425+
* Thu Sep 21 2023 Cameron Baird <cameronbaird@microsoft.com> - 5.15.131.1-3
423426
- Bump release to match kernel
424427

425428
* Wed Sep 20 2023 Jon Slobodzian <joslobo@microsoft.com> - 5.15.131.1-2

SPECS-SIGNED/kernel-uki-signed/kernel-uki-signed.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Summary: Signed Unified Kernel Image for %{buildarch} systems
77
Name: kernel-uki-signed-%{buildarch}
88
Version: 6.6.92.2
9-
Release: 1%{?dist}
9+
Release: 2%{?dist}
1010
License: GPLv2
1111
Vendor: Microsoft Corporation
1212
Distribution: Azure Linux
@@ -68,6 +68,9 @@ popd
6868
/boot/efi/EFI/Linux/vmlinuz-uki-%{kernelver}.efi
6969

7070
%changelog
71+
* Mon Jun 09 2025 Rachel Menge <rachelmenge@microsoft.com> - 6.6.92.2-2
72+
- Bump release to match kernel
73+
7174
* Fri May 30 2025 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 6.6.92.2-1
7275
- Auto-upgrade to 6.6.92.2
7376

SPECS/kernel-64k/kernel-64k.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
%undefine _unique_debug_names
1515
%global _missing_build_ids_terminate_build 1
1616
%global _no_recompute_build_ids 1
17+
# Prevent find_debuginfo.sh from removing the BTF section from modules
18+
%define _find_debuginfo_opts --keep-section '.BTF'
1719

1820
%ifarch aarch64
1921
%global __provides_exclude_from %{_libdir}/debug/.build-id/
@@ -25,7 +27,7 @@
2527
Summary: Linux Kernel
2628
Name: kernel-64k
2729
Version: 6.6.92.2
28-
Release: 1%{?dist}
30+
Release: 2%{?dist}
2931
License: GPLv2
3032
Vendor: Microsoft Corporation
3133
Distribution: Azure Linux
@@ -371,6 +373,9 @@ echo "initrd of kernel %{uname_r} removed" >&2
371373
%{_sysconfdir}/bash_completion.d/bpftool
372374

373375
%changelog
376+
* Mon Jun 09 2025 Rachel Menge <rachelmenge@microsoft.com> - 6.6.92.2-2
377+
- Prevent debuginfo from stripping BTF data
378+
374379
* Fri May 30 2025 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 6.6.92.2-1
375380
- Auto-upgrade to 6.6.92.2
376381

SPECS/kernel-headers/kernel-headers.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
Summary: Linux API header files
1515
Name: kernel-headers
1616
Version: 6.6.92.2
17-
Release: 1%{?dist}
17+
Release: 2%{?dist}
1818
License: GPLv2
1919
Vendor: Microsoft Corporation
2020
Distribution: Azure Linux
@@ -75,6 +75,9 @@ done
7575
%endif
7676

7777
%changelog
78+
* Mon Jun 09 2025 Rachel Menge <rachelmenge@microsoft.com> - 6.6.92.2-2
79+
- Bump release to match kernel
80+
7881
* Fri May 30 2025 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 6.6.92.2-1
7982
- Auto-upgrade to 6.6.92.2
8083

SPECS/kernel/kernel-uki.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Summary: Unified Kernel Image
1414
Name: kernel-uki
1515
Version: 6.6.92.2
16-
Release: 1%{?dist}
16+
Release: 2%{?dist}
1717
License: GPLv2
1818
Vendor: Microsoft Corporation
1919
Distribution: Azure Linux
@@ -70,6 +70,9 @@ cp %{buildroot}/boot/vmlinuz-uki-%{kernelver}.efi %{buildroot}/boot/efi/EFI/Linu
7070
/boot/efi/EFI/Linux/vmlinuz-uki-%{kernelver}.efi
7171

7272
%changelog
73+
* Mon Jun 09 2025 Rachel Menge <rachelmenge@microsoft.com> - 6.6.92.2-2
74+
- Bump release to match kernel
75+
7376
* Fri May 30 2025 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 6.6.92.2-1
7477
- Auto-upgrade to 6.6.92.2
7578

SPECS/kernel/kernel.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
%undefine _unique_debug_names
1414
%global _missing_build_ids_terminate_build 1
1515
%global _no_recompute_build_ids 1
16+
# Prevent find_debuginfo.sh from removing the BTF section from modules
17+
%define _find_debuginfo_opts --keep-section '.BTF'
1618

1719
%ifarch x86_64
1820
%define arch x86_64
@@ -30,7 +32,7 @@
3032
Summary: Linux Kernel
3133
Name: kernel
3234
Version: 6.6.92.2
33-
Release: 1%{?dist}
35+
Release: 2%{?dist}
3436
License: GPLv2
3537
Vendor: Microsoft Corporation
3638
Distribution: Azure Linux
@@ -428,6 +430,9 @@ echo "initrd of kernel %{uname_r} removed" >&2
428430
%{_sysconfdir}/bash_completion.d/bpftool
429431

430432
%changelog
433+
* Mon Jun 09 2025 Rachel Menge <rachelmenge@microsoft.com> - 6.6.92.2-2
434+
- Prevent debuginfo from stripping BTF data
435+
431436
* Fri May 30 2025 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 6.6.92.2-1
432437
- Auto-upgrade to 6.6.92.2
433438

toolkit/resources/manifests/package/pkggen_core_aarch64.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
filesystem-1.1-21.azl3.aarch64.rpm
2-
kernel-headers-6.6.92.2-1.azl3.noarch.rpm
2+
kernel-headers-6.6.92.2-2.azl3.noarch.rpm
33
glibc-2.38-10.azl3.aarch64.rpm
44
glibc-devel-2.38-10.azl3.aarch64.rpm
55
glibc-i18n-2.38-10.azl3.aarch64.rpm

toolkit/resources/manifests/package/pkggen_core_x86_64.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
filesystem-1.1-21.azl3.x86_64.rpm
2-
kernel-headers-6.6.92.2-1.azl3.noarch.rpm
2+
kernel-headers-6.6.92.2-2.azl3.noarch.rpm
33
glibc-2.38-10.azl3.x86_64.rpm
44
glibc-devel-2.38-10.azl3.x86_64.rpm
55
glibc-i18n-2.38-10.azl3.x86_64.rpm

0 commit comments

Comments
 (0)