fingerprintd/packaging/make-bin-tarball.sh
Jorijn van der Graaf 1934822554 An agent, so a finger can mean something in your session
The daemon announces every matched finger on the system bus and stops there,
because root has no session bus, no display and no business starting your
applications. fingerprintd-agent is the other half: it runs as you, subscribes
properly rather than parsing gdbus monitor output, filters by uid because the
signal is visible to every local user, and maps fingers to commands from a file
you own and can edit without restarting anything.

It is a separate binary and a separate subpackage because it is a separate
trust domain. /etc/fingerprintd/actions.conf is a root shell and is guarded
like one; ~/.config/fingerprintd/fingers.conf runs your commands as you, so it
is an ordinary dotfile.

Demonstrated on the phone: one press of the unlock finger both unlocks it and
opens plasma-camera.
2026-09-05 06:21:53 +02:00

38 lines
1.8 KiB
Shell
Executable file

#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-only
# SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
# make-bin-tarball.sh — bundle the cross-compiled fingerprintd binary and its
# runtime files into the source tarball APKBUILD consumes. Run from the repo
# root after a cross build; output lands in the current directory.
set -eu
VER="${1:-$(sed -n 's/.*char\* Version = "\(.*\)".*/\1/p' implementations/main.cpp)}"
[ -n "$VER" ] || { echo "could not determine version — pass it as \$1" >&2; exit 1; }
BIN=$(ls -t bin/fingerprintd-aarch64-*/fingerprintd 2>/dev/null | head -n1)
[ -n "$BIN" ] || { echo "no aarch64 fingerprintd build found — cross-compile first" >&2; exit 1; }
AGENT=$(ls -t bin/fingerprintd-agent-aarch64-*/fingerprintd-agent 2>/dev/null | head -n1)
[ -n "$AGENT" ] || { echo "no aarch64 agent build — cross-compile with --product=agent" >&2; exit 1; }
stage=$(mktemp -d)
trap 'rm -rf "$stage"' EXIT
mkdir "$stage/fingerprintd-$VER"
cp "$BIN" "$stage/fingerprintd-$VER/fingerprintd"
cp "$AGENT" "$stage/fingerprintd-$VER/fingerprintd-agent"
cp packaging/fingerprintd.service \
packaging/mnt-persist.mount \
packaging/80-fingerprintd.preset \
packaging/net.reactivated.Fprint.conf \
packaging/net.reactivated.Fprint.service \
packaging/net.reactivated.fprint.device.policy \
packaging/fingerprintd.tmpfiles.conf \
packaging/fingerprintd.modules-load.conf \
packaging/fingerprintd.json \
packaging/20-focal64.manifest \
packaging/fingerprint-auth.pam \
packaging/postlogin.pam \
packaging/actions.conf.example \
packaging/fingerprintd-agent.service \
packaging/fingers.conf.example \
"$stage/fingerprintd-$VER/"
tar -C "$stage" -czf "fingerprintd-$VER.tar.gz" "fingerprintd-$VER"
echo "wrote fingerprintd-$VER.tar.gz ($(du -h "fingerprintd-$VER.tar.gz" | cut -f1))"