Hello again, as you have probably seen, I tried to upstream the Python3 binding for binwalk3.
My rust skills are still rusty, so I won't commit anything until 1) upstream accepts the new python3 binding (optional) 2) diffoscope maintainers are ok with it 3) you review the packaging changes I'm attaching to this email :) G. Il giorno giovedì 3 dicembre 2026 alle ore 21:12:10 CET, Gianfranco Costamagna <[email protected]> ha scritto: Hello, I did the porting work (thanks to AI), checked, built, checked if we could remove cpio (not yet), and did some sanity checks, opened a MR https://salsa.debian.org/reproducible-builds/diffoscope/-/merge_requests/178 thank you Gianfranco Il giorno giovedì 3 dicembre 2026 alle ore 19:03:09 CET, Gianfranco Costamagna <[email protected]> ha scritto: Hello, thank you *so* much! G. Il giorno giovedì 3 dicembre 2026 alle ore 16:45:00 CET, Fukui Daichi <[email protected]> ha scritto: Hi Gianfranco, rust-binwalk 3.1.0+ds-1 has been accepted into unstable, and the source and binary packages (binwalk3 and librust-binwalk-dev) are now available: https://packages.debian.org/source/sid/rust-binwalk binwalk3 installs /usr/bin/binwalk3, so it coexists with binwalk 2.x for now. You're listed as an Uploader. Thank you for your support. As planned, my next step is a wishlist bug for the diffoscope maintainers, leaving them time to move off the Python API. We can then revisit your idea of providing binwalk as a drop-in replacement. Best regards, -- Fukui Daichi GPG key: 4096R/9EF66C2D2315BB7C
From e27abe9b6023966a9cc7b20c0e66b73cad534e29 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna <[email protected]> Date: Sun, 6 Dec 2026 08:38:50 +0100 Subject: [PATCH] Add binwalk-python3 --- debian/control | 32 ++++++++++++++++---------------- debian/rules | 23 ++++++++++++++++++----- 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/debian/control b/debian/control index f5ab7e9..990ca25 100644 --- a/debian/control +++ b/debian/control @@ -91,22 +91,6 @@ Provides: Description: Analyzes data for embedded file types - Rust source code Source code for Debianized Rust crate "binwalk" -Package: python3-binwalk3 -Architecture: any -Section: python -Depends: - ${misc:Depends}, - ${python3:Depends}, - ${shlibs:Depends} -Description: Python 3 binding for the binwalk3 firmware analysis library - Exposes the binwalk3 signature scanner and extractor to Python 3 through a - binwalk v2-compatible API (binwalk3.scan()), so that Python programs can read - embedded file offsets without running the binwalk3 binary and parsing its - output. - . - This is not the Python binwalk 2.x module; it is a shim over the Rust library - and supports only the options listed in binwalk3.py. - Package: binwalk3 Architecture: any Section: devel @@ -140,3 +124,19 @@ Description: firmware analysis tool for finding and extracting embedded files . This is the Rust rewrite of binwalk (version 3). It is installed as binwalk3 so it can coexist with the Python binwalk 2.x package. + +Package: python3-binwalk3 +Architecture: any +Section: python +Depends: + ${misc:Depends}, + ${python3:Depends}, + ${shlibs:Depends} +Description: Python 3 binding for the binwalk3 firmware analysis library + Exposes the binwalk3 signature scanner and extractor to Python 3 through a + binwalk v2-compatible API (binwalk3.scan()), so that Python programs can read + embedded file offsets without running the binwalk3 binary and parsing its + output. + . + This is not the Python binwalk 2.x module; it is a shim over the Rust library + and supports only the options listed in binwalk3.py. diff --git a/debian/rules b/debian/rules index 8eedca4..b896f9b 100755 --- a/debian/rules +++ b/debian/rules @@ -1,11 +1,24 @@ #!/usr/bin/make -f + +#include /usr/share/dpkg/default.mk +include /usr/share/rustc/architecture.mk +#export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS +export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE +#export PATH := /usr/share/cargo/bin:$(PATH) +export CARGO=/usr/share/cargo/bin/cargo +export CARGO_HOME=$(CURDIR)/debian/cargo_home +#export CARGO_REGISTRY=debian/cargo_registry +#export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM) +#export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow + + %: dh $@ --buildsystem cargo -execute_after_dh_install: - install -D -m 0644 target/*/release/libbinwalk.so debian/python3-binwalk3/usr/lib/python3/dist-packages/_binwalk3.so - install -D -m 0644 python/binwalk3.py debian/python3-binwalk3/usr/lib/python3/dist-packages/binwalk3.py - override_dh_auto_test: - dh_auto_test -- build --release --lib --features python dh_auto_test -- test --all + +execute_after_dh_auto_install: + $(CARGO) build --release --lib --features python + install -D -m 0644 target/*/release/libbinwalk.so debian/python3-binwalk3/usr/lib/python3/dist-packages/_binwalk3.so + install -D -m 0644 python/binwalk3.py debian/python3-binwalk3/usr/lib/python3/dist-packages/binwalk3.py -- 2.43.0

