debian/daedalus-v4l2-dkms: new package — kernel module via DKMS

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-<ver>/ 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) <noreply@anthropic.com>
This commit is contained in:
2026-05-18 18:25:46 +00:00
parent add049f0bd
commit f3dd1c1886
4 changed files with 187 additions and 0 deletions
+131
View File
@@ -0,0 +1,131 @@
#!/bin/bash
# Build daedalus-v4l2-dkms_<ver>_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" <<EOF
PACKAGE_NAME="${MODULE_NAME}"
PACKAGE_VERSION="${PKGVER}"
BUILT_MODULE_NAME[0]="${MODULE_NAME}"
DEST_MODULE_LOCATION[0]="/updates"
MAKE[0]="make KERNELDIR=/lib/modules/\${kernelver}/build all"
CLEAN="make KERNELDIR=/lib/modules/\${kernelver}/build clean"
AUTOINSTALL="yes"
EOF
# Doc
install -m 644 "$work/$SRCDIR/README.md" \
"$ROOT/usr/share/doc/daedalus-v4l2-dkms/README.md"
install -Dm644 "$HERE/debian/copyright" "$ROOT/usr/share/doc/daedalus-v4l2-dkms/copyright"
install -Dm644 "$HERE/debian/changelog" "$ROOT/usr/share/doc/daedalus-v4l2-dkms/changelog.Debian"
gzip -9 -n "$ROOT/usr/share/doc/daedalus-v4l2-dkms/changelog.Debian"
# DKMS post-install / pre-remove hooks.
cat > "$ROOT/DEBIAN/postinst" <<EOF
#!/bin/sh
set -e
NAME=${MODULE_NAME}
VERSION=${PKGVER}
if [ "\$1" = "configure" ] && command -v dkms >/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" <<EOF
#!/bin/sh
set -e
NAME=${MODULE_NAME}
VERSION=${PKGVER}
if [ "\$1" = "remove" ] && command -v dkms >/dev/null 2>&1; then
dkms remove "\$NAME/\$VERSION" --all || true
fi
#DEBHELPER#
EOF
chmod 755 "$ROOT/DEBIAN/prerm"
cat > "$ROOT/DEBIAN/control" <<EOF
Package: daedalus-v4l2-dkms
Version: ${PKGVER}-${PKGREL}
Section: kernel
Priority: optional
Architecture: all
Depends: dkms (>= 2.1.0.0)
Recommends: daedalus-v4l2, linux-headers-generic | linux-headers
Maintainer: Markus Fritsche <mfritsche@reauktion.de>
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"
+11
View File
@@ -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 <mfritsche@reauktion.de> Mon, 18 May 2026 23:00:00 +0000
+24
View File
@@ -0,0 +1,24 @@
Source: daedalus-v4l2-dkms
Section: kernel
Priority: optional
Maintainer: Markus Fritsche <mfritsche@reauktion.de>
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.
+21
View File
@@ -0,0 +1,21 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: daedalus-v4l2
Upstream-Contact: Markus Fritsche <fritsche.markus@gmail.com>
Source: https://git.reauktion.de/reauktion/daedalus-v4l2
Files: *
Copyright: 2026 Markus Fritsche <fritsche.markus@gmail.com>
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'.