Skip to content

clevis: auto-enable feature for bound LUKS devices#56

Open
romenskiy2012 wants to merge 3 commits intoosboot:masterfrom
romenskiy2012:master
Open

clevis: auto-enable feature for bound LUKS devices#56
romenskiy2012 wants to merge 3 commits intoosboot:masterfrom
romenskiy2012:master

Conversation

@romenskiy2012
Copy link
Copy Markdown
Contributor

Add a guess/device script for the clevis feature.

The script checks dm-crypt devices, resolves the underlying LUKS device and enables the clevis feature automatically when a Clevis binding is present.

dev="$(readlink -ef "$dev" 2>/dev/null || true)"

[ -b "$dev" ] || exit 0
command -v clevis >/dev/null 2>&1 || exit 0
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@romenskiy2012 Maybe we should move this check up earlier?

Just after [ -d "$SYSFS_PATH$1"/dm ] || exit 0 ?

because none of the other steps are necessary if this utility isn't available.

# CRYPT-LUKS1-00000000000000000000000000000000-name
# CRYPT-LUKS2-00000000000000000000000000000000-name
=======
>>>>>>> 9f9d7d14 (clevis: auto-enable feature for bound LUKS devices)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. You forgot to check the difference.

Add a new clevis feature that installs the tools and files
required for TPM2-backed LUKS unlock in initrd.

The feature is optional and is enabled explicitly through
FEATURES.

Signed-off-by: Arseniy Romenskiy <romenskiy@altlinux.org>
When no keyfile is available and the volume is not activated,
try clevis-based unlock before falling back to interactive
passphrase entry.

If clevis is unavailable or unlock fails, keep the existing
password prompt logic unchanged.

Signed-off-by: Arseniy Romenskiy <romenskiy@altlinux.org>
Add a guess/device script for the clevis feature.

The script checks dm-crypt devices, resolves the underlying
LUKS device and enables the clevis feature automatically when
a Clevis binding is present.

Signed-off-by: Arseniy Romenskiy <romenskiy@altlinux.org>
@romenskiy2012
Copy link
Copy Markdown
Contributor Author

I made a critical mistake with rebase, and corrupted the story.
Everything should be right now.

@legionus
Copy link
Copy Markdown
Collaborator

legionus commented Apr 2, 2026

You're still having trouble with the rebase. On github and locally, I see 3 commits. The first two add a feature that you've already submitted in another PR.

$ git log --oneline master..github-pull-56
1f2e8175 (github-pull-56) clevis: auto-enable feature for bound LUKS devices
7850d028 luks: try clevis unlock before prompting for passphrase
050076f6 clevis: add feature for TPM2-based LUKS unlock

Please rebase onto master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants