Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try both Clevis and passphrase in /etc/fstab setup #3528

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading