Fingerprint

Usate questo forum per richieste di aiuto e consigli sull'hardware montato nelle vostre macchine con GNU/Linux Slackware.

Moderatore: Staff

Regole del forum
1) Citare sempre la versione di Slackware usata e la versione del Kernel. Questi dati aiutano le persone che possono rispondere.
2) Citare il tipo di hardware coinvolto in modo dettagliato.
3) Leggere attentamente le risposte ricevute
4) Scrivere i messaggi con il colore di default, evitare altri colori.
5) Scrivere in Italiano o in Inglese, se possibile grammaticalmente corretto, evitate stili di scrittura poco chiari, quindi nessuna abbreviazione tipo telegramma o scrittura stile SMS o CHAT. Non usare termini gergali come procio, mobo e simili per identificare i componenti hardware.
6) Appena registrati è consigliato presentarsi nel forum dedicato.

La non osservanza delle regole porta a provvedimenti di vari tipo da parte dello staff, in particolare la non osservanza della regola 5 porta alla cancellazione del post e alla segnalazione dell'utente. In caso di recidività l'utente rischia il ban temporaneo.
idefix
Linux 2.x
Linux 2.x
Messaggi: 238
Iscritto il: gio 19 giu 2008, 1:48
Nome Cognome: stefano
Slackware: slack64-15.0
Kernel: 5.16.10
Desktop: tde 14.0.11

Re: Fingerprint

Messaggio da idefix »

ciao, mi puoi mandare lo slackbuild dove sostituisci systemd con elongind ?
sto litigando con un soft e non trovo il flag giusto per meson.

grazie.

Avatar utente
lennynero
Linux 3.x
Linux 3.x
Messaggi: 641
Iscritto il: lun 3 mag 2004, 0:00
Nome Cognome: Luigi Picaro
Slackware: 15.0-x64
Kernel: 6.1
Desktop: Xfce-4.16
Località: Salerno

Re: Fingerprint

Messaggio da lennynero »

Ciao ti posto lo slackbuild (derivato da SBO) e la patch che applico.

fprintd.SlackBuild:

Codice: Seleziona tutto

#!/bin/sh

# Slackware build script for <appname>

# Copyright <year> <you> <where you live>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# |-----------------------------------------------------------------| #
# REMOVE THIS ENTIRE BLOCK OF TEXT #
#
# A license is required, and we strongly suggest you use the above
# BSD/MIT style license. We DO NOT accept "Public Domain" scripts.
# Public domain is not valid in some countries, and no license is
# worse than a "bad" license in those countries.
#
# This template is not meant to be a 'cut and paste' script to
# enable any random user to make a working package.  While
# we're certainly not discouraging use of this template, if
# you haven't manually gone through each step of the process
# without the build script (typically as a normal user, as this
# will reveal problems that you won't see as root), then there's
# a good chance that something important is missing from your
# submission.

# When using this template script, please remove as many of
# these unnecessary comments as possible.  Commented code is
# a good thing, but if it's obvious, there's no need to comment it.
#
# AGAIN, REMOVE THE COMMENTS IF THEY ARE NOT NEEDED - DON'T JUST
# DELETE THIS BLOCK OF TEXT WITHOUT BOTHERING TO READ WHAT'S IN IT.
#
# |-----------------------------------------------------------------| #

PRGNAM=fprintd			# replace with name of program
VERSION=${VERSION:-1.90.1}	# replace with version of program
BUILD=${BUILD:-2}
TAG=${TAG:-lnr}		# the "_SBo" is required

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
       *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}	# For consistency's sake, use this
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}	# Drop the package in /tmp

if [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e # Exit on most errors
# If you prefer to do selective error checking with
#   command || exit 1
# then that's also acceptable.

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION

# Apply Elogind patches
patch -p1 < $CWD/elogind.patch

chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

# Your application will probably need different configure flags;
# these are provided as an example only.
# Be sure to build only shared libraries unless there's some need for
# static.
#rm -r build
mkdir build
cd build
  CFLAGS="$SLKCFLAGS" \
  CXXFLAGS="$SLKCFLAGS" \
  meson .. \
    --buildtype=release \
    --infodir=/usr/info \
    --libdir=/usr/lib${LIBDIRSUFFIX} \
    --localstatedir=/var \
    --mandir=/usr/man \
    --prefix=/usr \
    --sysconfdir=/etc \
    --libexecdir=/usr \
    -Dgtk_doc=true
  ninja
  DESTDIR=$PKG ninja install
cd ..

# Strip binaries and libraries - this can be done with 'make install-strip'
# in many source trees, and that's usually acceptable if so, but if not,
# use this:
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

# Compress man pages
# If the man pages are installed to /usr/share/man instead, you'll need to either
# add the --mandir=/usr/man flag to configure or move them manually after the
# make install process is run.
find $PKG/usr/share/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/share/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done

# Remove perllocal.pod and other special files that don't need to be installed,
# as they will overwrite what's already on the system.  If this is not needed,
# remove it from the script.
# Remove 'special' files
find $PKG -name perllocal.pod \
  -o -name ".packlist" \
  -o -name "*.bs" \
  | xargs rm -f

# Copy program documentation into the package
# The included documentation varies from one application to another, so be sure
# to adjust your script as needed
# Also, include the SlackBuild script in the documentation directory
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

# Copy the slack-desc (and a custom doinst.sh if necessary) into ./install
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
#cat $CWD/doinst.sh > $PKG/install/doinst.sh

# Make the package; be sure to leave it in $OUTPUT
# If package symlinks need to be created during install *before*
# your custom contents of doinst.sh runs, then add the -p switch to
# the makepkg command below -- see makepkg(8) for details
cd $PKG
/sbin/makepkg -l y -c n $CWD/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}
elogind.patch:

Codice: Seleziona tutto

diff -aur fprintd-1.90.1-original/data/meson.build fprintd-1.90.1/data/meson.build
--- fprintd-1.90.1-original/data/meson.build	2020-02-10 14:59:42.000000000 +0100
+++ fprintd-1.90.1/data/meson.build	2022-03-08 10:23:54.872272391 +0100
@@ -11,16 +11,6 @@
     install_dir: dbus_service_dir,
 )
 
-configure_file(
-    configuration: configuration_data({
-        'libexecdir': fprintd_installdir,
-    }),
-    input: 'fprintd.service.in',
-    output: 'fprintd.service',
-    install: true,
-    install_dir: systemd_unit_dir,
-)
-
 polkit_policy = 'net.reactivated.fprint.device.policy'
 polkit_policy_target = i18n.merge_file(polkit_policy,
     input: '@0@.in'.format(polkit_policy),
diff -aur fprintd-1.90.1-original/meson.build fprintd-1.90.1/meson.build
--- fprintd-1.90.1-original/meson.build	2020-02-10 14:59:42.000000000 +0100
+++ fprintd-1.90.1/meson.build	2022-03-08 10:22:14.998265475 +0100
@@ -75,7 +75,7 @@
 polkit_gobject_dep = dependency('polkit-gobject-1', version: '>= 0.91')
 dbus_dep = dependency('dbus-1', required: false)
 dbus_glib_dep = dependency('dbus-glib-1')
-libsystemd_dep = dependency('libsystemd', required: get_option('pam'))
+libsystemd_dep = dependency('libelogind', required: get_option('pam'))
 pam_dep = cc.find_library('pam',
     required: get_option('pam'),
     has_headers: 'security/pam_modules.h',
@@ -84,14 +84,6 @@
 pod2man = find_program('pod2man', required: get_option('man'))
 xsltproc = find_program('xsltproc', required: get_option('gtk_doc'))
 
-# StateDirectory was introduced in systemd 235
-systemd_dep = dependency('systemd', version: '>= 235')
-systemd_unit_dir = get_option('systemd_system_unit_dir')
-
-if systemd_unit_dir == ''
-    systemd_unit_dir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
-endif
-
 dbus_service_dir = get_option('dbus_service_dir')
 dbus_data_dir = datadir
 dbus_interfaces_dir = ''
@@ -115,25 +107,8 @@
 
 polkit_policy_directory = polkit_gobject_dep.get_pkgconfig_variable('policydir')
 
-# Tests dependencies
-pam_wrapper_dep = dependency('pam_wrapper', required: get_option('pam'))
-
 xmllint = find_program('xmllint', required: false)
 python3 = find_program('python3') # No meson without it!
-python3_test_modules = {
-    'cairo': true,
-    'dbus': true,
-    'dbusmock': true,
-    'gi': true,
-    'pypamtest': get_option('pam'),
-}
-python3_available_modules = []
-
-foreach module, required : python3_test_modules
-    if required and run_command(python3, '-c', 'import @0@'.format(module)).returncode() != 0
-        error('Python3 module \'' + module + '\' required by test suite not found')
-    endif
-endforeach
 
 cdata = configuration_data()
 cdata.set_quoted('GETTEXT_PACKAGE', meson.project_name())
@@ -156,7 +131,6 @@
 if get_option('gtk_doc')
     subdir('doc')
 endif
-subdir('tests')
 subdir('po')
 
 output = []
@@ -169,7 +143,6 @@
 output += '  DBus service directory: ' + dbus_service_dir
 output += '  DBus interfaces directory: ' + dbus_interfaces_dir
 output += '  Polkit policy directory: ' + polkit_policy_directory
-output += '  Systemd service directory: ' + systemd_unit_dir
 if get_option('pam')
     output += '  PAM module directory: ' + pam_modules_dir
 endif
Ti riporto, per comodità anche lo slack-desc:

Codice: Seleziona tutto

# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':' except on otherwise blank lines.

       |-----handy-ruler------------------------------------------------------|
fprintd: fprintd (a daemon that provides fingerprint scanning functionality
fprintd:         over D-Bus.)
fprintd:
fprintd: fprintd is a daemon that provides fingerprint scanning functionality 
fprintd: over D-Bus. This is the software developers will want to integrate 
fprintd: with to add fingerprint authentication to OSes, desktop environments 
fprintd: and applications. 
fprintd: It also includes a PAM module to implement user login (pam_fprintd 
fprintd: replacing the obsolete pam_fprint module), and small command-line 
fprintd: utilities if your desktop environment does not integrate support.
fprintd: URL: https://fprint.freedesktop.org/
Tecnicamente quello che ho fatto è stato modificare il file meson.build e il file data/meson.build (dalla patch puoi dedurre le modifiche).

Con una patch analoga sono riuscito a compilare anche l'ultima versione di fprintd (v1.94.2), il problema però sembrerebbe, ma sto studiando meglio la cosa, che il file net.reactivated.Fprint.conf, dalla versione 1.90.4 (che pure mi risulta incompatibile) è stato modificato rispetto a quello di open-fprintd e dai miei primi esperimenti sembrano diventare incompatibili. In ogni caso non so se una versione più aggiornata di fprintd (qualora riuscissi a renderla compatibile con open-fprintd) potrebbe portare dei benefici...

Fammi sapere se riesci a risolvere.

Appena ho un po' di tempo provo a fare qualche altro esperimento per capire se effettivamente il problema semplicemente il fatto che open-fprintd è (attualmente) compatibile solo con quella versione di fprintd...

idefix
Linux 2.x
Linux 2.x
Messaggi: 238
Iscritto il: gio 19 giu 2008, 1:48
Nome Cognome: stefano
Slackware: slack64-15.0
Kernel: 5.16.10
Desktop: tde 14.0.11

Re: Fingerprint

Messaggio da idefix »

grazie per la risposta.
non avevo capito bene cio che hai fatto,
credevo avessi solo trovato un flag per cmake o meson
per fare la scelta su un sorgente che la offrisse.
invece hai fatto delle modifiche ai sorgenti.

il mio problema sono un paio di soft per gnome
che sembrano interessanti e vorrei provare,
dalle loro info sembra sia possibile fare la scelta tra systemd ed elogind
ma non spiegano la sintassi e ho provato varie ipotesi ma invano.

dato che sono troppo pigro, mi fermo qua.

grazie comunque, gentilissimo.

Avatar utente
lennynero
Linux 3.x
Linux 3.x
Messaggi: 641
Iscritto il: lun 3 mag 2004, 0:00
Nome Cognome: Luigi Picaro
Slackware: 15.0-x64
Kernel: 6.1
Desktop: Xfce-4.16
Località: Salerno

Re: Fingerprint

Messaggio da lennynero »

Giusto per completezza segnalo che in realtà mi sono reso conto che open-fprintd è perfettamente compatibile anche con fprintd-v1.94.2, nonostante usino un file net.reactivated.Fprint.conf leggermente diverso (che nel caso di open-fprintd è semplificato).

La patch applicata a fprintd-v1.94.2 è la seguente:

Codice: Seleziona tutto

diff -aur fprintd-v1.94.2-original/data/meson.build fprintd-v1.94.2/data/meson.build
--- fprintd-v1.94.2-original/data/meson.build	2022-02-24 17:19:57.000000000 +0100
+++ fprintd-v1.94.2/data/meson.build	2022-03-08 17:05:18.508624883 +0100
@@ -11,18 +11,6 @@
     install_dir: dbus_service_dir,
 )
 
-if get_option('systemd')
-    configure_file(
-        configuration: configuration_data({
-            'libexecdir': fprintd_installdir,
-        }),
-        input: 'fprintd.service.in',
-        output: 'fprintd.service',
-        install: true,
-        install_dir: systemd_unit_dir,
-    )
-endif
-
 polkit_policy = 'net.reactivated.fprint.device.policy'
 polkit_policy_target = i18n.merge_file(
     input: '@0@.in'.format(polkit_policy),
diff -aur fprintd-v1.94.2-original/meson.build fprintd-v1.94.2/meson.build
--- fprintd-v1.94.2-original/meson.build	2022-02-24 17:19:57.000000000 +0100
+++ fprintd-v1.94.2/meson.build	2022-03-08 17:09:01.881646399 +0100
@@ -92,7 +92,7 @@
 libfprint_dep = dependency('libfprint-2', version: '>=' + libfprint_min_version)
 polkit_gobject_dep = dependency('polkit-gobject-1', version: '>= 0.91')
 dbus_dep = dependency('dbus-1', required: false)
-libsystemd_dep = dependency('libsystemd', required: get_option('pam'))
+libsystemd_dep = dependency('libelogind', required: get_option('pam'))
 pam_dep = cc.find_library('pam',
     required: get_option('pam'),
     has_headers: 'security/pam_modules.h',
@@ -101,18 +101,6 @@
 pod2man = find_program('pod2man', required: get_option('man'))
 xsltproc = find_program('xsltproc', required: get_option('gtk_doc'))
 
-# StateDirectory was introduced in systemd 235
-systemd_dep = dependency('systemd', version: '>= 235', required: false)
-systemd_unit_dir = get_option('systemd_system_unit_dir')
-
-if systemd_unit_dir == '' and systemd_dep.found()
-    systemd_unit_dir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
-endif
-
-if get_option('systemd') and systemd_unit_dir == ''
-    error('systemd development files or systemd_system_unit_dir is needed for systemd support.')
-endif
-
 dbus_service_dir = get_option('dbus_service_dir')
 dbus_data_dir = datadir
 dbus_interfaces_dir = ''
@@ -136,26 +124,8 @@
 
 polkit_policy_directory = polkit_gobject_dep.get_pkgconfig_variable('policydir')
 
-# Tests dependencies
-pam_wrapper_dep = dependency('pam_wrapper', required: get_option('pam'))
-
 xmllint = find_program('xmllint', required: false)
 python3 = find_program('python3') # No meson without it!
-python3_test_modules = {
-    'cairo': true,
-    'dbus': true,
-    'dbusmock': true,
-    'gi': true,
-    'gi.repository.FPrint': true,
-    'pypamtest': get_option('pam'),
-}
-python3_available_modules = []
-
-foreach module, required : python3_test_modules
-    if required and run_command(python3, '-c', 'import @0@'.format(module)).returncode() != 0
-        error('Python3 module \'' + module + '\' required by test suite not found')
-    endif
-endforeach
 
 cdata = configuration_data()
 cdata.set_quoted('GETTEXT_PACKAGE', meson.project_name())
@@ -179,7 +149,6 @@
 if get_option('gtk_doc')
     subdir('doc')
 endif
-subdir('tests')
 subdir('po')
 
 output = []
@@ -192,7 +161,6 @@
 output += '  DBus service directory: ' + dbus_service_dir
 output += '  DBus interfaces directory: ' + dbus_interfaces_dir
 output += '  Polkit policy directory: ' + polkit_policy_directory
-output += '  Systemd service directory: ' + systemd_unit_dir
 if get_option('pam')
     output += '  PAM module directory: ' + pam_modules_dir
 endif
@@ -201,7 +169,5 @@
 output += '  Manuals: ' + get_option('man').to_string()
 output += '  GTK Doc: ' + get_option('gtk_doc').to_string()
 output += '  XML Linter ' + xmllint.found().to_string()
-output += '\nTest setup:\n'
-output += '  With address sanitizer: ' + address_sanitizer.to_string()
 
 message('\n'+'\n'.join(output)+'\n')
diff -aur fprintd-v1.94.2-original/meson_options.txt fprintd-v1.94.2/meson_options.txt
--- fprintd-v1.94.2-original/meson_options.txt	2022-02-24 17:19:57.000000000 +0100
+++ fprintd-v1.94.2/meson_options.txt	2022-03-08 17:07:30.786637625 +0100
@@ -6,13 +6,6 @@
     description: 'Generate the man files',
     type: 'boolean',
     value: true)
-option('systemd',
-    description: 'Install system service files',
-    type: 'boolean',
-    value: true)
-option('systemd_system_unit_dir',
-    description: 'Directory for systemd service files',
-    type: 'string')
 option('dbus_service_dir',
     description: 'Directory for dbus service files',
     type: 'string')
Resta comunque necessario (ovviamente) avviare open-fprintd e dbus-service (python-validity) con uno script ad hoc e gestire suspend/resume di open-fprintd con uno script in /lib64/elogind/system-sleep/

idefix
Linux 2.x
Linux 2.x
Messaggi: 238
Iscritto il: gio 19 giu 2008, 1:48
Nome Cognome: stefano
Slackware: slack64-15.0
Kernel: 5.16.10
Desktop: tde 14.0.11

Re: Fingerprint

Messaggio da idefix »

nonostante la mia infinita ignoranza, ho scoperto
come sceglere tra systemd e elogind con alcuni soft,
per esempio gnome 41.

non riuscivo a trovare la sintassi giusta per meson
ma ora ci sono riuscito: -Dlogind=libelogind

Rispondi