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

add support for luksSuspend/luksResume #558

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Narrat
Copy link
Collaborator

@Narrat Narrat commented Jan 29, 2025

May come in handy for hibernation/suspending the OS without completly closing the tomb.


Just a POC for #34 without a full close operation, but still avoiding writing the secret to places where it shouldn't be.
Not fully fleshed out, as bind mounts are ignored, operations on a suspened device are allowed.
But it is imo enough to play around with and decide if it is worth or close (or slam) is enough.

May come in handy for hibernation/suspending the OS without completly closing the tomb.
done

_message "Commanded to revive tomb ::1 tomb name::" $tombname
# Currently missing check if $tombname is valid or could be found
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this work?

if [[ ${#mounted_tombs[@]} -eq 0 ]]; then
	_failure "No mounted tombs found for: $tombname"
fi

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As a general check, yes. But it would still need to check on available/open mounts and their names in detail.

Comment on lines +3080 to +3085
# process bind-hooks (mount -o bind of directories)
# and exec-hooks (execute on open)
#option_is_set -n || {
# exec_safe_bind_hooks "${tombmount}"
# exec_safe_func_hooks open "${tombmount}"
#}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this is what we are going for

# Process bind-hooks and exec-hooks safely
if ! option_is_set -n; then
	if [[ -d "$tombmount" ]]; then
		exec_safe_bind_hooks "$tombmount" || _failure "Failed to execute bind-hooks."
		exec_safe_func_hooks open "$tombmount" || _failure "Failed to execute function hooks."
	else
		_failure "Invalid tomb mount directory: $tombmount"
	fi
fi

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The right direction.
I didn't look into implementing this, as the general question still needs an answer.
Does is offer some kind of benefit? The script would contain three ways to "close" a tomb. close, slam and then suspend/resume. With suspend/resume kinda in between close and slam and I'm still not sure it is a benefical addition.

@Narrat Narrat linked an issue Mar 23, 2025 that may be closed by this pull request
@Narrat Narrat added wip work in progress discussion labels Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion wip work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Close tombs on hibernation / suspend
2 participants