Skip to content

linuxPackages.ebpf-headers: init - #569786

Merged
RaitoBezarius merged 2 commits into
NixOS:staging-nixosfrom
RaitoBezarius:systemd-kernel-vmlinux
Oct 5, 2026
Merged

RaitoBezarius merged 2 commits into
NixOS:staging-nixosfrom
RaitoBezarius:systemd-kernel-vmlinux

Conversation

@RaitoBezarius

Copy link
Copy Markdown
Member

Things done

This adds vmlinux.h extracted from BTF for downstream consumers such as systemd. Discussed multiple times in #404715 #404864.

This is part 1.
Next part is to introduce linuxPackages.systemd (part 2), after that: enable nsresourced/mountfsd with a test (part 3), finally: NixOS can default to the current kernel's systemd (part 4).

Previously vmlinux (and therefore its .BTF section) was only copied to the
dev output for modular kernels. BPF CO-RE consumers need the kernel's BTF
regardless of whether modules are enabled, so always populate $dev.
@RaitoBezarius
RaitoBezarius requested review from Ma27 and nikstur October 3, 2026 12:45

@nixpkgs-branch-check nixpkgs-branch-check Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR's base branch is set to staging-nixos, but this PR causes 1924 rebuilds.
It is therefore considered a mass rebuild.
Please change the base branch to the right base branch for your changes (probably staging).

@nixpkgs-ci
nixpkgs-ci Bot requested review from a team, Atemu, AxerTheAxe, JerrySM64, andir, eljamm, lovesegfault, moni-dz, thiagokokada, thoughtpolice and zzzsyyy and removed request for a team October 3, 2026 12:51
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 6.topic: kernel The Linux kernel labels Oct 3, 2026
@RaitoBezarius
RaitoBezarius changed the base branch from master to staging-nixos October 3, 2026 12:52
@nixpkgs-ci nixpkgs-ci Bot closed this Oct 3, 2026
@nixpkgs-ci nixpkgs-ci Bot reopened this Oct 3, 2026
@nixpkgs-ci
nixpkgs-ci Bot requested a review from a team October 3, 2026 12:58
@Ma27
Ma27 dismissed nixpkgs-branch-check[bot]’s stale review October 4, 2026 20:02

This only causes rebuilds due to (whitespace) changes to the kernel build. In other words, this can stay on staging-next, no reason to force this through a staging cycle.

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Oct 4, 2026
Expose, per kernel package set, a vmlinux.h extracted from that kernel's
BTF (bpftool btf dump on $dev/vmlinux). This is the pure equivalent of
systemd's vmlinux-h=generated, which reads /sys/kernel/btf/vmlinux, and
it lets BPF CO-RE consumers compile against the kernel they run on
instead of a synthetic one.

More on this: BPF CO-RE is not yet a complete solution for a stable BPF
ABI. At the time of writing, CO-RE is only about offset/type relocation.
The history of the kernel private ABI evolution has shown this is not
enough, e.g. task_struct->utime/stime jiffies → nsecs after 4.6.
Operational expertise of BPF CO-RE is not great at the moment as well:
BPF verifier bugs can lead to rejection of valid programs, see
https://ebpfchirp.substack.com/p/why-does-my-ebpf-program-work-on.

For reminders, BTF is arch independent, so cross builds are fine.

@nixpkgs-branch-check nixpkgs-branch-check Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR's base branch is set to staging-nixos, but this PR causes 1924 rebuilds.
It is therefore considered a mass rebuild.
Please change the base branch to the right base branch for your changes (probably staging).

@RaitoBezarius
RaitoBezarius added this pull request to the merge queue Oct 5, 2026
Merged via the queue into NixOS:staging-nixos with commit a1c1119 Oct 5, 2026
29 checks passed
@RaitoBezarius
RaitoBezarius deleted the systemd-kernel-vmlinux branch October 5, 2026 09:50
@emilazy emilazy mentioned this pull request Oct 10, 2026
3 of 13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: kernel The Linux kernel 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants