From 59a2544e5916e37c752331a82d8a30d7956d699c Mon Sep 17 00:00:00 2001 From: Joel Low Date: Fri, 14 Jun 2024 16:45:04 +0800 Subject: [PATCH] Move clevis-zfs-common to /usr/libexec --- src/initramfs-tools/hooks/clevis-zfs.in | 2 +- src/zfs/clevis-zfs-bind | 2 +- src/zfs/clevis-zfs-list | 2 +- src/zfs/clevis-zfs-unbind | 2 +- src/zfs/clevis-zfs-unlock | 2 +- src/zfs/meson.build | 27 +++++++++++++++++++------ 6 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/initramfs-tools/hooks/clevis-zfs.in b/src/initramfs-tools/hooks/clevis-zfs.in index 110e5f99..9327cee5 100644 --- a/src/initramfs-tools/hooks/clevis-zfs.in +++ b/src/initramfs-tools/hooks/clevis-zfs.in @@ -53,7 +53,7 @@ copy_exec @bindir@/clevis-decrypt-tang || die 1 "@bindir@/clevis-decrypt-tang no copy_exec @bindir@/clevis-decrypt-sss || die 1 "@bindir@/clevis-decrypt-sss not found" copy_exec @bindir@/clevis-decrypt-null || die 1 "@bindir@/clevis-decrypt-null not found" copy_exec @bindir@/clevis-decrypt || die 1 "@bindir@/clevis-decrypt not found" -copy_exec @bindir@/clevis-zfs-common || die 1 "@bindir@/clevis-zfs-common not found" +copy_exec @libexecdir@/clevis-zfs-common || die 1 "@libexecdir@/clevis-zfs-common not found" copy_exec @bindir@/clevis-zfs-unlock || die 1 "@bindir@/clevis-zfs-unlock not found" if [ -x @bindir@/clevis-decrypt-tpm2 ]; then copy_exec @bindir@/clevis-decrypt-tpm2 || die 1 "@bindir@/clevis-decrypt-tpm2 not found" diff --git a/src/zfs/clevis-zfs-bind b/src/zfs/clevis-zfs-bind index 10d65c9e..9e999478 100755 --- a/src/zfs/clevis-zfs-bind +++ b/src/zfs/clevis-zfs-bind @@ -106,6 +106,6 @@ function main() { } if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then - . clevis-zfs-common + . @libexecdir@/clevis-zfs-common main "${@}" fi diff --git a/src/zfs/clevis-zfs-list b/src/zfs/clevis-zfs-list index 038a5001..c7efb371 100755 --- a/src/zfs/clevis-zfs-list +++ b/src/zfs/clevis-zfs-list @@ -41,6 +41,6 @@ main() { } if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then - . clevis-zfs-common + . @libexecdir@/clevis-zfs-common main "${@}" fi diff --git a/src/zfs/clevis-zfs-unbind b/src/zfs/clevis-zfs-unbind index f21351c1..5a542b7a 100755 --- a/src/zfs/clevis-zfs-unbind +++ b/src/zfs/clevis-zfs-unbind @@ -81,6 +81,6 @@ function main() { } if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then - . clevis-zfs-common + . @libexecdir@/clevis-zfs-common main "${@}" fi diff --git a/src/zfs/clevis-zfs-unlock b/src/zfs/clevis-zfs-unlock index 0b7e78fe..bf978ac4 100755 --- a/src/zfs/clevis-zfs-unlock +++ b/src/zfs/clevis-zfs-unlock @@ -81,6 +81,6 @@ function testing() { } if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then - . clevis-zfs-common + . @libexecdir@/clevis-zfs-common main "${@}" fi diff --git a/src/zfs/meson.build b/src/zfs/meson.build index 2593be9e..0aa37a31 100644 --- a/src/zfs/meson.build +++ b/src/zfs/meson.build @@ -1,6 +1,21 @@ -bins += join_paths(meson.current_source_dir(), 'clevis-zfs-bind') -bins += join_paths(meson.current_source_dir(), 'clevis-zfs-common') -bins += join_paths(meson.current_source_dir(), 'clevis-zfs-list') -bins += join_paths(meson.current_source_dir(), 'clevis-zfs-test') -bins += join_paths(meson.current_source_dir(), 'clevis-zfs-unbind') -bins += join_paths(meson.current_source_dir(), 'clevis-zfs-unlock') +install_data( + [join_paths(meson.current_source_dir(), 'clevis-zfs-common')], + install_dir: libexecdir +) + +zfs_bins = [ + 'clevis-zfs-bind', + 'clevis-zfs-list', + 'clevis-zfs-unbind', + 'clevis-zfs-unlock', +] +foreach b : zfs_bins + configure_file( + input: b, + output: b, + install_dir: bindir, + configuration: data + ) +endforeach + +test('clevis-zfs-test', find_program(join_paths(meson.current_source_dir(), 'clevis-zfs-test')))