b16a3f1a77
Upstream PR #1 landed daemon-side synthesis of H.264 SPS/PPS NAL units from the V4L2 stateless control structs. This bumps the package pin so both the userspace daemon and the kernel module pick up the change in lockstep (wire protocol grew a new DAEDALUS_REQ_FLAG_H264_META bit + struct daedalus_h264_meta — kernel and daemon MUST match). Effect on Pi 5 / CM5 hosts (higgs): ffmpeg -hwaccel vaapi against H.264 sources will actually decode through the daedalus daemon instead of failing with "non-existing PPS 0 referenced". Both arch + debian packages: pkgver 0.1.0.r20.3dd0eb0 (count from git rev-list), pkgrel reset to 1 (new upstream pin). VP9 / AV1 paths unchanged. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
175 lines
6.0 KiB
Bash
Executable File
175 lines
6.0 KiB
Bash
Executable File
#!/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=3dd0eb070a75893f78368ce819b9e9ebf08c124d
|
|
PKGVER=0.1.0+r20+g3dd0eb0
|
|
PKGREL=1 # reset for new upstream pin (3dd0eb0 — DAEMON-PPS H.264 SPS/PPS NAL synth)
|
|
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 --connect-timeout 10 --max-time 600 --retry 3 --retry-delay 5 -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}
|
|
KERNELVER=\$(uname -r)
|
|
|
|
# Yellow + bold ANSI for the warning so it stands out in apt's
|
|
# stream of "Setting up" lines. Disable colour on non-TTY.
|
|
if [ -t 1 ]; then
|
|
Y=\$(printf '\\033[1;33m'); R=\$(printf '\\033[0m')
|
|
else
|
|
Y=''; R=''
|
|
fi
|
|
|
|
warn() {
|
|
printf '%s==> daedalus-v4l2-dkms: %s%s\\n' "\$Y" "\$1" "\$R" >&2
|
|
}
|
|
|
|
if [ "\$1" = "configure" ]; then
|
|
if ! command -v dkms >/dev/null 2>&1; then
|
|
warn "dkms not installed; module \$NAME/\$VERSION not registered."
|
|
warn "Install 'dkms' then run: dkms add \$NAME/\$VERSION && dkms autoinstall"
|
|
exit 0
|
|
fi
|
|
|
|
dkms add "\$NAME/\$VERSION" 2>/dev/null || true
|
|
|
|
# Don't let autoinstall failure mask the actual problem behind '|| true'.
|
|
# Run it, capture the result, then verify post-condition.
|
|
autoinstall_rc=0
|
|
dkms autoinstall "\$NAME/\$VERSION" || autoinstall_rc=\$?
|
|
|
|
# Verify the module actually built + installed for the running kernel.
|
|
status=\$(dkms status -m "\$NAME" -v "\$VERSION" -k "\$KERNELVER" 2>/dev/null || true)
|
|
if ! printf '%s\\n' "\$status" | grep -q -E 'installed|loaded'; then
|
|
warn ""
|
|
warn "DKMS build did NOT land for kernel \$KERNELVER."
|
|
warn " dkms status -m \$NAME -v \$VERSION -k \$KERNELVER:"
|
|
warn " \$(printf '%s' "\$status" | head -1)"
|
|
warn ""
|
|
warn "Most likely cause: kernel headers package is missing."
|
|
warn " Raspberry Pi OS / Pi 5: apt install linux-headers-rpi-2712"
|
|
warn " Debian generic: apt install linux-headers-\$KERNELVER"
|
|
warn ""
|
|
warn "After installing headers, finish the install with:"
|
|
warn " sudo dkms autoinstall \$NAME/\$VERSION"
|
|
warn " sudo modprobe daedalus_v4l2"
|
|
warn ""
|
|
warn "Until then daedalus_v4l2 will NOT be loadable and the"
|
|
warn "userspace daedalus-v4l2 daemon will have nothing to talk to."
|
|
fi
|
|
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-rpi-2712 | linux-headers-rpi | 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"
|