From f3dd1c1886de9e045979ce5381104cddfa8b6e22 Mon Sep 17 00:00:00 2001 From: Markus Fritsche Date: Mon, 18 May 2026 18:25:46 +0000 Subject: [PATCH] =?UTF-8?q?debian/daedalus-v4l2-dkms:=20new=20package=20?= =?UTF-8?q?=E2=80=94=20kernel=20module=20via=20DKMS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirror of arch/daedalus-v4l2-dkms into the Debian tree. Architecture: all (source package — DKMS rebuilds per-kernel at install time). Same pin (f04d700, Phase 8.13 close). Installs kernel/ source to /usr/src/daedalus_v4l2-/ with generated dkms.conf. postinst runs `dkms add` + `dkms autoinstall` so the module builds against the running kernel's headers automatically. prerm runs `dkms remove --all`. Same Makefile-include-path flattening as the Arch sibling: copies daedalus_v4l2_proto.h into kernel/include/ and patches the Makefile's -I path. Co-Authored-By: Claude Opus 4.7 (1M context) --- debian/daedalus-v4l2-dkms/build-deb.sh | 131 +++++++++++++++++++++ debian/daedalus-v4l2-dkms/debian/changelog | 11 ++ debian/daedalus-v4l2-dkms/debian/control | 24 ++++ debian/daedalus-v4l2-dkms/debian/copyright | 21 ++++ 4 files changed, 187 insertions(+) create mode 100755 debian/daedalus-v4l2-dkms/build-deb.sh create mode 100644 debian/daedalus-v4l2-dkms/debian/changelog create mode 100644 debian/daedalus-v4l2-dkms/debian/control create mode 100644 debian/daedalus-v4l2-dkms/debian/copyright diff --git a/debian/daedalus-v4l2-dkms/build-deb.sh b/debian/daedalus-v4l2-dkms/build-deb.sh new file mode 100755 index 000000000..c027e0395 --- /dev/null +++ b/debian/daedalus-v4l2-dkms/build-deb.sh @@ -0,0 +1,131 @@ +#!/bin/bash +# Build daedalus-v4l2-dkms__all.deb (kernel module via DKMS). +# +# Installs kernel/ source tree to /usr/src/daedalus_v4l2-${PKGVER}/ +# plus a dkms.conf. Postinst registers with DKMS (dkms add + build + +# install). Prerm deregisters. Result: the daedalus_v4l2 module +# auto-rebuilds against any installed kernel headers without users +# needing to remember to dkms-add it. +# +# Architecture: all. The kernel module itself is per-kernel-version, +# but the SOURCE package is arch-independent. +# +# Sibling Arch package: ../../arch/daedalus-v4l2-dkms/PKGBUILD +# Sibling userspace package: ../daedalus-v4l2/build-deb.sh +set -euo pipefail + +UPSTREAM_COMMIT=f04d7000f858fe51d867aba14a529d3aef4fbd54 +PKGVER=0.1.0+r15+gf04d700 +PKGREL=1 +MODULE_NAME=daedalus_v4l2 + +HERE=$(dirname "$(readlink -f "$0")") + +# Reproducible build. 2026-05-18 23:00 UTC — Phase 8.13 close. +export SOURCE_DATE_EPOCH=1779231600 + +work=$(mktemp -d) +trap "rm -rf $work" EXIT + +cd "$work" +curl -sSLfo daedalus-v4l2.tar.gz \ + "https://git.reauktion.de/reauktion/daedalus-v4l2/archive/${UPSTREAM_COMMIT}.tar.gz" +tar xzf daedalus-v4l2.tar.gz +SRCDIR=daedalus-v4l2 + +ROOT="$work/pkgroot" +SRCROOT="$ROOT/usr/src/${MODULE_NAME}-${PKGVER}" + +mkdir -p "$SRCROOT/include" \ + "$ROOT/DEBIAN" \ + "$ROOT/usr/share/doc/daedalus-v4l2-dkms" + +# Copy kernel/ source files to the DKMS source dir. +cp -r "$work/$SRCDIR/kernel/." "$SRCROOT/" + +# Embed the shared protocol header inline (rather than referencing +# ../include/ which doesn't exist after DKMS extracts the tree). +# Patch the Makefile to find it at $SRCROOT/include/ instead. +install -m 644 "$work/$SRCDIR/include/daedalus_v4l2_proto.h" \ + "$SRCROOT/include/daedalus_v4l2_proto.h" +sed -i 's|-I\$(src)/\.\./include|-I$(src)/include|' "$SRCROOT/Makefile" + +# Generate dkms.conf with the actual version substituted. +cat > "$SRCROOT/dkms.conf" < "$ROOT/DEBIAN/postinst" </dev/null 2>&1; then + dkms add "\$NAME/\$VERSION" 2>/dev/null || true + dkms autoinstall "\$NAME/\$VERSION" || true +fi + +#DEBHELPER# +EOF +chmod 755 "$ROOT/DEBIAN/postinst" + +cat > "$ROOT/DEBIAN/prerm" </dev/null 2>&1; then + dkms remove "\$NAME/\$VERSION" --all || true +fi + +#DEBHELPER# +EOF +chmod 755 "$ROOT/DEBIAN/prerm" + +cat > "$ROOT/DEBIAN/control" <= 2.1.0.0) +Recommends: daedalus-v4l2, linux-headers-generic | linux-headers +Maintainer: Markus Fritsche +Homepage: https://git.reauktion.de/reauktion/daedalus-v4l2 +Description: V4L2 stateless decoder shim kernel module (DKMS) — Pi 5 / CM5 + Out-of-tree V4L2 m2m kernel module for the daedalus-v4l2 stack on + Raspberry Pi 5 / CM5. Registers /dev/videoNN (V4L2 stateless m2m + decoder), /dev/mediaNN (media controller with request API), and + /dev/daedalus-v4l2 (chardev bridge to the userspace daemon). + . + The actual decode happens in the userspace daemon shipped by the + daedalus-v4l2 package — this module is just the kernel-side V4L2 + plumbing. Install both to actually serve VAAPI / V4L2 clients. + . + Built via DKMS against the running kernel's headers. +EOF + +DEB_OUT="daedalus-v4l2-dkms_${PKGVER}-${PKGREL}_all.deb" +dpkg-deb --root-owner-group --build "$ROOT" "$HERE/$DEB_OUT" +echo "built: $HERE/$DEB_OUT" diff --git a/debian/daedalus-v4l2-dkms/debian/changelog b/debian/daedalus-v4l2-dkms/debian/changelog new file mode 100644 index 000000000..26c83642f --- /dev/null +++ b/debian/daedalus-v4l2-dkms/debian/changelog @@ -0,0 +1,11 @@ +daedalus-v4l2-dkms (0.1.0+r15+gf04d700-1) bookworm trixie; urgency=medium + + * Initial Debian DKMS packaging for the daedalus_v4l2 kernel module. + * Pinned to f04d700 (Phase 8.13 close): kernel-side framework + integration (V4L2 m2m, dmabuf-export, media controller, request + API, NV12 single-plane + NV12M + P010 CAPTURE) that closes the + libva→/dev/video0→daemon round-trip with byte-exact pixels. + * Auto-builds via DKMS against the running kernel's headers. + * Companion userspace package: daedalus-v4l2 (daemon + tools). + + -- Markus Fritsche Mon, 18 May 2026 23:00:00 +0000 diff --git a/debian/daedalus-v4l2-dkms/debian/control b/debian/daedalus-v4l2-dkms/debian/control new file mode 100644 index 000000000..15ff67b35 --- /dev/null +++ b/debian/daedalus-v4l2-dkms/debian/control @@ -0,0 +1,24 @@ +Source: daedalus-v4l2-dkms +Section: kernel +Priority: optional +Maintainer: Markus Fritsche +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.6.2 +Homepage: https://git.reauktion.de/reauktion/daedalus-v4l2 + +Package: daedalus-v4l2-dkms +Architecture: all +Depends: ${misc:Depends}, dkms (>= 2.1.0.0) +Recommends: daedalus-v4l2, + linux-headers-generic | linux-headers +Description: V4L2 stateless decoder shim kernel module (DKMS) — Pi 5 / CM5 + Out-of-tree V4L2 m2m kernel module for the daedalus-v4l2 stack on + Raspberry Pi 5 / CM5. Registers /dev/videoNN (V4L2 stateless m2m + decoder), /dev/mediaNN (media controller with request API), and + /dev/daedalus-v4l2 (chardev bridge to the userspace daemon). + . + The actual decode happens in the userspace daemon shipped by the + daedalus-v4l2 package — this module is just the kernel-side V4L2 + plumbing. Install both to actually serve VAAPI / V4L2 clients. + . + Built via DKMS against the running kernel's headers. diff --git a/debian/daedalus-v4l2-dkms/debian/copyright b/debian/daedalus-v4l2-dkms/debian/copyright new file mode 100644 index 000000000..9870f0236 --- /dev/null +++ b/debian/daedalus-v4l2-dkms/debian/copyright @@ -0,0 +1,21 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: daedalus-v4l2 +Upstream-Contact: Markus Fritsche +Source: https://git.reauktion.de/reauktion/daedalus-v4l2 + +Files: * +Copyright: 2026 Markus Fritsche +License: GPL-2.0-or-later +Comment: + Kernel module (loadable into the Linux kernel) — GPL-2.0-or-later. + The shared protocol header carries an additional Linux-syscall-note + exception so userspace inclusion is BSD-clean. + +License: GPL-2.0-or-later + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + On Debian systems, the complete text of the GNU General Public + License v2 can be found in `/usr/share/common-licenses/GPL-2'.