Compare commits

..

No commits in common. "31cafc8e7d01f6b2d879403d1ce676b4bbe1498c" and "f573008075fce7111542ba666b16693dd1f44f25" have entirely different histories.

3 changed files with 6 additions and 28 deletions

View file

@ -2,10 +2,10 @@
project('zlevis', license: 'GPL3', version: '1')
# Define bindir
bindir = join_paths(get_option('prefix'), get_option('bindir'))
bindir=join_paths(get_option('prefix'), get_option('bindir'))
# Define bins list
bins = []
bins=[]
# Define subdir with bins
subdir('src')

View file

@ -1,14 +1,4 @@
# Find scripts
encrypt = find_program('zlevis-encrypt')
decrypt = find_program('zlevis-decrypt')
fetch = find_program('zlevis-fetch')
# Test the scripts
test('zlevis-encrypt', encrypt, args: '--summary')
test('zlevis-decrypt', decrypt, args: '--summary')
test('zlevis-fetch', fetch, args: '--summary')
# Add paths of scripts to bins
bins += join_paths(meson.current_source_dir(), 'zlevis-encrypt')
bins += join_paths(meson.current_source_dir(), 'zlevis-decrypt')
bins += join_paths(meson.current_source_dir(), 'zlevis-fetch')
bins += join_paths(meson.current_source_dir(), 'zlevis-fetch')

View file

@ -3,20 +3,8 @@
# Exit immediately if a command exits with a non-zero status
set -e
# Summary of the script's functionality
summary="Decrypts a ZFS root pool with a TPM2.0 chip."
# Display summary if requested
if [ "$1" = "--summary" ]; then
echo "$summary"
exit 0
fi
# Check if zlevis-decrypt is present
if ! command -v zlevis-decrypt > /dev/null; then
echo "Script zlevis-decrypt is not present"
exit 1
fi
command -v zlevis-decrypt > /dev/null || exit 1
# Read ZFS dataset information.
zfs list -Ho name,encryption,keystatus,encryptionroot,tpm:jwe | while IFS=$'\t' read -r ds enc keystatus encroot jwe; do
@ -30,8 +18,8 @@ zfs list -Ho name,encryption,keystatus,encryptionroot,tpm:jwe | while IFS=$'\t'
echo "Unlocked $ds"
else
echo "Failed to unlock $ds" >&2
exit 1
exit 1
fi
fi
fi
done
done