Skip to content

Commit

Permalink
Try both Clevis and passphrase in /etc/fstab setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaublitz committed Jan 9, 2024
1 parent aa492c2 commit 492a89e
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions systemd/stratis-fstab-setup
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,29 @@ done

if $(stratis-min pool is-stopped "$POOL_UUID"); then
if $(stratis-min pool is-bound "$POOL_UUID"); then
if ! stratis-min pool start --unlock-method=clevis "$POOL_UUID"; then
if stratis-min pool start --unlock-method=clevis "$POOL_UUID"; then
exit 0
else
echo Failed to start pool with UUID $POOL_UUID using Clevis. >&2
exit 1
fi
elif $(stratis-min pool is-encrypted "$POOL_UUID"); then
if ! systemd-ask-password \
fi
if $(stratis-min pool has-passphrase "$POOL_UUID"); then
if systemd-ask-password \
"Enter password for pool with UUID $POOL_UUID" |
stratis-min pool start --unlock-method=keyring --prompt "$POOL_UUID"; then
exit 0
else
echo Failed to start pool with UUID $POOL_UUID using passphrase. >&2
exit 1
fi
else
if ! stratis-min pool start "$POOL_UUID"; then
fi
if ! $(stratis-min pool is-encrypted); then
if stratis-min pool start "$POOL_UUID"; then
exit 0
else
echo Failed to start pool with UUID $POOL_UUID. >&2
exit 1
fi
fi
exit 1
fi

udevadm settle

0 comments on commit 492a89e

Please sign in to comment.