From patchwork Fri Oct 18 18:55:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Boccassi X-Patchwork-Id: 1999348 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XVYqH64HDz1xw2 for ; Sat, 19 Oct 2024 05:57:30 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1t1sA2-0000Re-FX; Fri, 18 Oct 2024 18:57:18 +0000 Received: from mail-wm1-f53.google.com ([209.85.128.53]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1t1sA0-0000RN-G1 for kernel-team@lists.ubuntu.com; Fri, 18 Oct 2024 18:57:16 +0000 Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4314c4cb752so24752805e9.2 for ; Fri, 18 Oct 2024 11:57:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729277835; x=1729882635; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LW/4NVpXwVZmKT25PuV6VGFAMhFnl22UetCihtp7I1E=; b=DHXSS6n/KcGCqbVIYrcElUTzKou2tC1vcKEvpXSuM/0pKKLYXtlWviEgvFLvgMo5ai hc2zX93G4rgMl80f3g//1Ns5PPFCGoKgFdzjE55lIFkU4fAVY1u9WKlVIoP4JgWAofn7 4/mgoO435/7L/mJaSR/+m0TkJj3ewo5pPSQAf7TSYhvBF1NP7LsIaGKnGCCbcBu0ngSD sWrBvpFL5SmKB4e2D6YM9X/nno8xjDwR1r1EOmq1JuOy4vJmo3t01WjuHhFI9x0Dbdxs TmkzLmfNvsVRUX7z2ZVgOlaxDkXPz8kdJYR0TfYiv0Xgql8Cu4M1N9SoD5Ky1yaCcNPa 91Lg== X-Gm-Message-State: AOJu0Yx59gVwfvdK2eg6Y1yixhJcmEr+ag/pkVHNmy0BMfATWV9lKH8R eVzoNblePRVkbQQv8NqzrURoa/RbbvHB+ync3yMx2YUuG8HXbVhOOBm7/Q== X-Google-Smtp-Source: AGHT+IHpK3iNOqgpcTIpowk5dafJWxVKZNRnOB8/8adDcY0mq5fIerC/bQjKCUyhb+Bh9owDQNiiyQ== X-Received: by 2002:a05:600c:474e:b0:42c:a8cb:6a75 with SMTP id 5b1f17b1804b1-4316164179fmr31831215e9.17.1729277833743; Fri, 18 Oct 2024 11:57:13 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:6d9a:63bf:709b:f801]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43160694e5csm34006285e9.21.2024.10.18.11.57.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 11:57:12 -0700 (PDT) From: luca.boccassi@gmail.com To: kernel-team@lists.ubuntu.com Subject: [PATCH noble] UBUNTU: [Packaging] add linux-bpf-dev package Date: Fri, 18 Oct 2024 19:55:59 +0100 Message-ID: <20241018185709.955590-1-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.128.53; envelope-from=luca.boccassi@gmail.com; helo=mail-wm1-f53.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Luca Boccassi BugLink: https://bugs.launchpad.net/bugs/2050083 Add a new binary linux-bpf-dev package that ships a generated vmlinux.h header. This can be used by packages building CO-RE BPF programs instead of generating it at build time based on the kernel running on the package build system, which might or might not match the kernel that is actually shipped. It ensures that a matching header can always be used. Matches changes in Debian, including the package name and header installation location, so that we do not have to ifdef: https://salsa.debian.org/kernel-team/linux/-/commit/f52d006f3915ac4358dc8c98aa417477ebee026e This is already used by systemd to build various CO-RE programs, and right now on Ubuntu due to the lack of this package the header is generated from sysfs in the build system where the systemd packages are built. Signed-off-by: Luca Boccassi --- This has been in Oracular for a while, if possible it would be great to have the new package also in Noble, so that we can use it in the systemd upstream build and CI. debian/control.d/linux-bpf-dev.stub | 7 +++++++ debian/rules | 1 + debian/rules.d/2-binary-arch.mk | 8 ++++++++ 3 files changed, 16 insertions(+) create mode 100644 debian/control.d/linux-bpf-dev.stub diff --git a/debian/control.d/linux-bpf-dev.stub b/debian/control.d/linux-bpf-dev.stub new file mode 100644 index 000000000000..2967299aec18 --- /dev/null +++ b/debian/control.d/linux-bpf-dev.stub @@ -0,0 +1,7 @@ +Package: linux-bpf-dev +Architecture: amd64 armhf arm64 i386 ppc64el riscv64 s390x +Depends: ${misc:Depends} +Multi-Arch: same +Description: Headers for BPF development + The vmlinux.h header is provided to allow userspace to build BPF CO-RE + programs targeting the packaged kernel. diff --git a/debian/rules b/debian/rules index 43eae8d5aaa8..5fd39b2b0bcc 100755 --- a/debian/rules +++ b/debian/rules @@ -175,6 +175,7 @@ ifeq ($(src_pkg_name),linux) control_files += debian/control.d/linux-tools-host.stub control_files += debian/control.d/linux-source.stub control_files += debian/control.d/linux-doc.stub + control_files += debian/control.d/linux-bpf-dev.stub endif # Calculate Ubuntu Compatible Signing levels diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index fe66f8a0c088..9958f9bcfa22 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -618,6 +618,9 @@ endif ifeq ($(do_cloud_tools),true) $(call dh_all,$(pkgcloud)) endif +ifeq ($(do_tools_bpftool),true) + $(call if_package, linux-bpf-dev, $(call dh_all,linux-bpf-dev)) +endif # # per-architecture packages @@ -670,6 +673,7 @@ endif ifeq ($(do_tools_bpftool),true) mv $(builddirpa)/tools/bpf/bpftool/vmlinux $(builddirpa)/vmlinux $(kmake) CROSS_COMPILE=$(CROSS_COMPILE) -C $(builddirpa)/tools/bpf/bpftool + $(builddirpa)/tools/bpf/bpftool/bpftool btf dump file $(builddirpa)/vmlinux format c > $(builddirpa)/vmlinux.h rm -f $(builddirpa)/vmlinux endif ifeq ($(do_tools_x86),true) @@ -722,6 +726,10 @@ endif ifeq ($(do_tools_bpftool),true) install -m755 $(builddirpa)/tools/bpf/bpftool/bpftool $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release) endif +ifeq ($(do_tools_bpftool),true) + install -d -m755 $(CURDIR)/debian/linux-bpf-dev/usr/include/$(DEB_HOST_MULTIARCH)/linux/ + install -m644 $(builddirpa)/vmlinux.h $(CURDIR)/debian/linux-bpf-dev/usr/include/$(DEB_HOST_MULTIARCH)/linux/vmlinux.h +endif ifeq ($(do_tools_x86),true) install -m755 \ $(addprefix $(builddirpa)/tools/power/x86/, x86_energy_perf_policy/x86_energy_perf_policy turbostat/turbostat) \