From 3293cd6542bfbe35be6d281260e8327bdbc5667a Mon Sep 17 00:00:00 2001 From: Markus Fritsche Date: Mon, 18 May 2026 18:25:21 +0000 Subject: [PATCH] =?UTF-8?q?arch/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 PKGBUILD pinning the same daedalus-v4l2 @ f04d700 as the userspace sibling. Installs kernel/ source to /usr/src/daedalus_v4l2-/ with a generated dkms.conf; AUTOINSTALL=yes builds the module against the running kernel. The kernel/ Makefile uses -I$(src)/../include for the shared protocol header. In the userspace tree that's daedalus-v4l2/include/; for DKMS we flatten by copying the header into kernel/include/ and patching the Makefile in package() to point there. Sibling Debian package: debian/daedalus-v4l2-dkms/ Co-Authored-By: Claude Opus 4.7 (1M context) --- arch/daedalus-v4l2-dkms/PKGBUILD | 68 +++++++++++++++++++++++++++++++ arch/daedalus-v4l2-dkms/dkms.conf | 19 +++++++++ 2 files changed, 87 insertions(+) create mode 100644 arch/daedalus-v4l2-dkms/PKGBUILD create mode 100644 arch/daedalus-v4l2-dkms/dkms.conf diff --git a/arch/daedalus-v4l2-dkms/PKGBUILD b/arch/daedalus-v4l2-dkms/PKGBUILD new file mode 100644 index 000000000..963f6a74d --- /dev/null +++ b/arch/daedalus-v4l2-dkms/PKGBUILD @@ -0,0 +1,68 @@ +# Maintainer: Markus Fritsche +# +# daedalus-v4l2-dkms — DKMS package for the daedalus_v4l2 out-of-tree +# kernel module (V4L2 stateless decoder shim for Pi 5 / CM5). +# +# Pair to daedalus-v4l2 (userspace daemon). When loaded, the module +# registers /dev/videoNN (V4L2 m2m) + /dev/mediaNN (media controller) + +# /dev/daedalus-v4l2 (chardev to the userspace daemon). Userspace +# clients drive the V4L2 m2m + request API path; the daemon does the +# actual FFmpeg-backed decode on /dev/daedalus-v4l2. +# +# Project: https://git.reauktion.de/reauktion/daedalus-v4l2 +# Sibling userspace package: daedalus-v4l2 +# Sibling consumer: libva-v4l2-request-fourier + +pkgname=daedalus-v4l2-dkms +_module=daedalus_v4l2 + +# Same pin as arch/daedalus-v4l2 — keep kernel module + daemon +# bit-versioned together so the chardev wire protocol stays in sync. +_commit=f04d7000f858fe51d867aba14a529d3aef4fbd54 + +pkgver=0.1.0.r15.f04d700 +pkgrel=1 +pkgdesc="V4L2 stateless decoder shim kernel module (DKMS) — Pi 5 / CM5" +arch=('any') +url="https://git.reauktion.de/reauktion/daedalus-v4l2" +license=('GPL-2.0-or-later') +depends=('dkms') +makedepends=('git') + +source=("git+https://git.reauktion.de/reauktion/daedalus-v4l2.git#commit=${_commit}" + "dkms.conf") +sha256sums=('SKIP' + 'SKIP') + +pkgver() { + cd "${srcdir}/daedalus-v4l2" + printf '0.1.0.r%s.%s' \ + "$(git rev-list --count HEAD)" \ + "$(git rev-parse --short=7 HEAD)" +} + +package() { + local _src="${pkgdir}/usr/src/${_module}-${pkgver}" + + install -dm755 "${_src}" + + # Install the kernel/ subdir and embed the shared proto header in + # the same tree. The in-tree Makefile uses + # `ccflags-y += -I$(src)/../include` (assuming the parent + # daedalus-v4l2 layout); for DKMS we flatten by copying the header + # into kernel/include/ and patching the Makefile to point there. + cp -r "${srcdir}/daedalus-v4l2/kernel/." "${_src}/" + install -Dm644 "${srcdir}/daedalus-v4l2/include/daedalus_v4l2_proto.h" \ + "${_src}/include/daedalus_v4l2_proto.h" + sed -i 's|-I\$(src)/\.\./include|-I$(src)/include|' "${_src}/Makefile" + + # dkms.conf at the root of the source tree (DKMS convention). + # Substitute #MODULE_VERSION# placeholder with the actual pkgver + # so dkms install/uninstall match what's on disk. + install -Dm644 "${srcdir}/dkms.conf" "${_src}/dkms.conf" + sed -i "s/#MODULE_VERSION#/${pkgver}/" "${_src}/dkms.conf" + + # License + install -Dm644 "${srcdir}/daedalus-v4l2/kernel/daedalus_v4l2_main.c" \ + "${pkgdir}/usr/share/licenses/${pkgname}/SPDX-HEADER" +} diff --git a/arch/daedalus-v4l2-dkms/dkms.conf b/arch/daedalus-v4l2-dkms/dkms.conf new file mode 100644 index 000000000..607c28c33 --- /dev/null +++ b/arch/daedalus-v4l2-dkms/dkms.conf @@ -0,0 +1,19 @@ +# DKMS configuration for daedalus_v4l2 — V4L2 stateless decoder shim. +# +# Built against /lib/modules/$kernelver/build with the in-tree Makefile. +# The Makefile uses `obj-m := daedalus_v4l2.o` and links +# daedalus_v4l2_main.o + daedalus_v4l2_chardev.o into the final .ko. + +PACKAGE_NAME="daedalus_v4l2" +PACKAGE_VERSION="#MODULE_VERSION#" + +# Single module produced by the Makefile. +BUILT_MODULE_NAME[0]="daedalus_v4l2" +DEST_MODULE_LOCATION[0]="/updates" + +# Use the package's own Makefile — it already does +# `$(MAKE) -C $(KERNELDIR) M=$(PWD) modules`. +MAKE[0]="make KERNELDIR=/lib/modules/${kernelver}/build all" +CLEAN="make KERNELDIR=/lib/modules/${kernelver}/build clean" + +AUTOINSTALL="yes"