mirror of
https://git.sr.ht/~nabijaczleweli/tzpfms
synced 2025-04-07 09:20:00 +03:00
Read /usr/lib/tzpfms/$backend from /libexec/tzpfms-zfs-load-key@ to support fzifdso-style plugins
This commit is contained in:
parent
69a1bcc2ce
commit
ba81298aaa
6
Makefile
6
Makefile
@ -88,7 +88,7 @@ htmlpages : $(patsubst man/%.pp,$(OUTDIR)man/%.html,$(MANPAGE_SOURCES)) $(OUTDIR
|
||||
locales : $(patsubst po/%.po,$(OUTDIR)locale/%/LC_MESSAGES/tzpfms.mo,$(LOCALES))
|
||||
i-t : $(OUTDIR)initramfs-tools/usr/share/initramfs-tools/hooks/tzpfms $(OUTDIR)initramfs-tools/usr/share/tzpfms/initramfs-tools-zfs-patch.sh
|
||||
dracut : $(patsubst initrd/dracut/%,$(OUTDIR)dracut/usr/lib/dracut/modules.d/91tzpfms/%,$(sort $(wildcard initrd/dracut/*.sh)))
|
||||
init.d-systemd : $(OUTDIR)systemd/$(SYSTEMD_SYSTEM_UNITDIR)/zfs-load-key@.service.d/tzpfms.conf $(OUTDIR)systemd/usr/libexec/tzpfms-zfs-load-key@
|
||||
init.d-systemd : $(OUTDIR)systemd/$(SYSTEMD_SYSTEM_UNITDIR)/zfs-load-key@.service.d/tzpfms.conf $(OUTDIR)systemd/usr/libexec/tzpfms-zfs-load-key@ $(foreach l,$(subst init.d/systemd/usr-lib-tzpfms/,,$(wildcard init.d/systemd/usr-lib-tzpfms/*)),$(OUTDIR)systemd/usr/lib/tzpfms/$(l))
|
||||
|
||||
|
||||
$(BLDDIR)tzpfms.pot: src/*.[ch]pp src/bin/*.[ch]pp
|
||||
@ -120,6 +120,10 @@ $(OUTDIR)systemd/usr/libexec/tzpfms-zfs-load-key@ : init.d/systemd/libexec-tzpfm
|
||||
@mkdir -p $(dir $@)
|
||||
ln -f $< $@ || cp $< $@
|
||||
|
||||
$(OUTDIR)systemd/usr/lib/tzpfms/% : init.d/systemd/usr-lib-tzpfms/%
|
||||
@mkdir -p $(dir $@)
|
||||
ln -f $< $@ || cp $< $@
|
||||
|
||||
# The d-v-o-s string starts at "BSD" (hence the "BSD General Commands Manual" default); we're not BSD, so hide it
|
||||
# Can't put it at the very top, since man(1) only loads mdoc *after* the first mdoc macro (.Dd in our case)
|
||||
$(OUTDIR)man/% : man/%.pp $(MANPAGE_HEADERS)
|
||||
|
@ -12,12 +12,8 @@ zfs-tpm-list -H "$DSET" | while read -r _ backend keystatus coherent; do
|
||||
exit 1
|
||||
}
|
||||
|
||||
case "$backend" in
|
||||
TPM1.X) unlock='zfs-tpm1x-load-key'; deps='trousers.service' ;;
|
||||
TPM2) unlock='zfs-tpm2-load-key'; deps= ;;
|
||||
*) unlock=; deps= ;;
|
||||
esac
|
||||
|
||||
unlock=; deps=
|
||||
read -r unlock deps 2>/dev/null < "/usr/lib/tzpfms/$backend"
|
||||
command -v "$unlock" >/dev/null || {
|
||||
printf "%s\n" "${0##*/}[$$]: $DSET: unknown tzpfms back-end $backend." >&2
|
||||
exit # fall through, maybe there's another handler
|
||||
|
1
init.d/systemd/usr-lib-tzpfms/TPM1.X
Normal file
1
init.d/systemd/usr-lib-tzpfms/TPM1.X
Normal file
@ -0,0 +1 @@
|
||||
zfs-tpm1x-load-key trousers.service
|
1
init.d/systemd/usr-lib-tzpfms/TPM2
Normal file
1
init.d/systemd/usr-lib-tzpfms/TPM2
Normal file
@ -0,0 +1 @@
|
||||
zfs-tpm2-load-key
|
Loading…
x
Reference in New Issue
Block a user