From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 915CE1FF0C0 for ; Wed, 04 Nov 2026 14:50:15 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E45AD2168C; Wed, 04 Nov 2026 14:49:28 +0100 (CET) From: Hannes Laimer To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox v6 6/6] ebpf: debian: package the crate as a Rust library Date: Wed, 4 Nov 2026 14:49:05 +0100 Message-ID: <20261104134905.1623451-7-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261104134905.1623451-1-h.laimer@proxmox.com> References: <20261104134905.1623451-1-h.laimer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1793800155315 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.309 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) KAM_SHORT 0.001 Use of a URL Shortener for very short URL RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 2CEVOQQAPMT6PTTDIZWTZXUYWLHWJMVN X-Message-ID-Hash: 2CEVOQQAPMT6PTTDIZWTZXUYWLHWJMVN X-MailFrom: h.laimer@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The overlay in debian/ builds it through debcargo, like the other Rust crates. The BPF programs are compiled by the build script, so building against the crate pulls in clang and the libbpf headers as well. Signed-off-by: Hannes Laimer --- proxmox-ebpf/Cargo.toml | 1 + proxmox-ebpf/build.rs | 6 ++++ proxmox-ebpf/debian/changelog | 5 ++++ proxmox-ebpf/debian/control | 50 +++++++++++++++++++++++++++++++ proxmox-ebpf/debian/copyright | 18 +++++++++++ proxmox-ebpf/debian/debcargo.toml | 13 ++++++++ 6 files changed, 93 insertions(+) create mode 100644 proxmox-ebpf/debian/changelog create mode 100644 proxmox-ebpf/debian/control create mode 100644 proxmox-ebpf/debian/copyright create mode 100644 proxmox-ebpf/debian/debcargo.toml diff --git a/proxmox-ebpf/Cargo.toml b/proxmox-ebpf/Cargo.toml index 4cfd0b3258ed..d4607d83e6ff 100644 --- a/proxmox-ebpf/Cargo.toml +++ b/proxmox-ebpf/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "proxmox-ebpf" +description = "Proxmox VE eBPF" version = "0.1.0" authors.workspace = true edition.workspace = true diff --git a/proxmox-ebpf/build.rs b/proxmox-ebpf/build.rs index 33032c61013e..f32a00ffc12e 100644 --- a/proxmox-ebpf/build.rs +++ b/proxmox-ebpf/build.rs @@ -99,6 +99,12 @@ fn main() { ); println!("cargo:rustc-link-search=native={}", out_dir.display()); println!("cargo:rustc-link-lib=static=bpf_native"); + // the archive holds code compiled from the crate's C sources, dh-cargo lists that in the + // Built-Using of a package linking it + println!( + "dh-cargo:deb-built-using=bpf_native=1={}", + manifest_dir.display() + ); } // native build against the shim headers, so tests call the program as a plain function diff --git a/proxmox-ebpf/debian/changelog b/proxmox-ebpf/debian/changelog new file mode 100644 index 000000000000..c816e8ecbfaa --- /dev/null +++ b/proxmox-ebpf/debian/changelog @@ -0,0 +1,5 @@ +rust-proxmox-ebpf (0.1.0-1) trixie; urgency=medium + + * Initial release. + + -- Proxmox Support Team Wed, 02 Sep 2026 10:00:00 +0200 diff --git a/proxmox-ebpf/debian/control b/proxmox-ebpf/debian/control new file mode 100644 index 000000000000..d51e260ef386 --- /dev/null +++ b/proxmox-ebpf/debian/control @@ -0,0 +1,50 @@ +Source: rust-proxmox-ebpf +Section: rust +Priority: optional +Build-Depends: debhelper-compat (= 13), + dh-sequence-cargo +Build-Depends-Arch: cargo:native , + rustc:native (>= 1.88) , + libstd-rust-dev , + librust-anyhow-1+default-dev , + librust-aya-0.13+default-dev , + librust-log-0.4+default-dev (>= 0.4.17-~~) , + librust-nix-0.29+default-dev , + librust-nix-0.29+fs-dev , + clang-21 , + libbpf-dev , + proxmox-kernel-libc-dev +Maintainer: Proxmox Support Team +Standards-Version: 4.7.2 +Vcs-Git: git://git.proxmox.com/git/proxmox.git +Vcs-Browser: https://git.proxmox.com/?p=proxmox.git +Homepage: https://proxmox.com +X-Cargo-Crate: proxmox-ebpf + +Package: librust-proxmox-ebpf-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-anyhow-1+default-dev, + librust-aya-0.13+default-dev, + librust-log-0.4+default-dev (>= 0.4.17-~~), + librust-nix-0.29+default-dev, + librust-nix-0.29+fs-dev, + clang-21, + libbpf-dev, + proxmox-kernel-libc-dev +Provides: + librust-proxmox-ebpf+bpf-debug-dev (= ${binary:Version}), + librust-proxmox-ebpf+default-dev (= ${binary:Version}), + librust-proxmox-ebpf-0-dev (= ${binary:Version}), + librust-proxmox-ebpf-0+bpf-debug-dev (= ${binary:Version}), + librust-proxmox-ebpf-0+default-dev (= ${binary:Version}), + librust-proxmox-ebpf-0.1-dev (= ${binary:Version}), + librust-proxmox-ebpf-0.1+bpf-debug-dev (= ${binary:Version}), + librust-proxmox-ebpf-0.1+default-dev (= ${binary:Version}), + librust-proxmox-ebpf-0.1.0-dev (= ${binary:Version}), + librust-proxmox-ebpf-0.1.0+bpf-debug-dev (= ${binary:Version}), + librust-proxmox-ebpf-0.1.0+default-dev (= ${binary:Version}) +Description: Proxmox VE eBPF - Rust source code + Source code for Debianized Rust crate "proxmox-ebpf" diff --git a/proxmox-ebpf/debian/copyright b/proxmox-ebpf/debian/copyright new file mode 100644 index 000000000000..01138fa0482f --- /dev/null +++ b/proxmox-ebpf/debian/copyright @@ -0,0 +1,18 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ + +Files: + * +Copyright: 2026 Proxmox Server Solutions GmbH +License: AGPL-3.0-or-later + This program is free software: you can redistribute it and/or modify it under + the terms of the GNU Affero General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) any + later version. + . + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more + details. + . + You should have received a copy of the GNU Affero General Public License along + with this program. If not, see . diff --git a/proxmox-ebpf/debian/debcargo.toml b/proxmox-ebpf/debian/debcargo.toml new file mode 100644 index 000000000000..04e8c8f52d4f --- /dev/null +++ b/proxmox-ebpf/debian/debcargo.toml @@ -0,0 +1,13 @@ +overlay = "." +crate_src_path = ".." +maintainer = "Proxmox Support Team " + +# the BPF programs and the harness's own are C sources of this crate, not vendored code +whitelist = ["src/*/bpf/*.c", "tests/bpf/*.c"] + +[source] +vcs_git = "git://git.proxmox.com/git/proxmox.git" +vcs_browser = "https://git.proxmox.com/?p=proxmox.git" + +[packages.lib] +depends = ["clang-21", "libbpf-dev", "proxmox-kernel-libc-dev"] -- 2.47.3