fingerprintd/packaging/make-bin-tarball.sh
Jorijn van der Graaf fd244238d0 Ship postlogin too, the other half of the seam kscreenlocker expects
fingerprint-auth alone was not enough. /etc/pam.d/kde-fingerprint is written
for a Fedora/authselect layout and its auth stack is two lines: a substack of
fingerprint-auth followed by an include of postlogin. Alpine ships neither.

With only the first supplied, the fingerprint MATCHED and PAM still answered
Permission denied -- the include of a missing service failing after the match
had already succeeded, which is a confusing way to be told a file is absent.
The daemon's own log said MATCH while pamtester said no.

On Fedora postlogin does lastlog and umask bookkeeping. Nothing here needs
that; what is needed is that the seam exists and contributes nothing, so the
stack's result stays the one the fingerprint substack produced. Hence four
optional pam_permit lines and a comment explaining why it is deliberately
empty rather than merely unfinished.

Also observed while testing, and worth knowing before anyone calls this
broken: the lock screen arms fingerprint ONCE when it appears, waits 30
seconds -- pam_fprintd's own timeout -- and then cancels and falls back to a
password. Pressing outside that window reaches nothing at all, and the daemon
records it as `verify: cancelled over 0 press(es)`.
2026-09-05 05:56:47 +02:00

33 lines
1.5 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; }
stage=$(mktemp -d)
trap 'rm -rf "$stage"' EXIT
mkdir "$stage/fingerprintd-$VER"
cp "$BIN" "$stage/fingerprintd-$VER/fingerprintd"
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 \
"$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))"