feat(core): add three-state LUKS2 initialization detection#129
Merged
Conversation
Add three-state initialization detection (None, Initializing, Ready) for LUKS2 volumes. get_init_state() reads the subsystem field from the raw LUKS2 header. is_initialized() is refactored to use get_init_state() internally, preserving backward compatibility. feat(core): write initializing marker in format() format() now sets subsystem='cryptpilot-initializing' directly in CryptParamsLuks2 during format(), making header creation and marker write a single atomic operation. Always pass params_ref so subsystem is written regardless of integrity type. feat(crypt): add Initializing state to volume status display Extend VolumeStatusKind with Initializing variant for partially initialized volumes. determine_status() now uses get_init_state() to distinguish None, Initializing, and Ready states. The show command displays Initializing volumes with a warning indicator. Also handle Initializing state in the init command to allow re-initialization of interrupted volumes. test(crypt): add three-state init integration tests Add tests for the full None -> Initializing -> Ready lifecycle: - Raw device returns None - After format returns Initializing - After mark returns Ready - is_initialized backward compat: true only for Ready - Full lifecycle test with blkid -p probing and retry loop cherry-picked from a32a378 (original branch), minus blkid.rs and before_sysroot.rs changes which were already addressed on this branch.
Remove 'branches: master' restriction from pull_request triggers so all CI workflows fire on PRs targeting any branch, not just master. Co-Authored-By: Claude <noreply@anthropic.com>
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
Co-Authored-By: Claude <noreply@anthropic.com>
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cherry-pick of three-state LUKS2 initialization feature from the original branch.
Changes
VolumeInitStateenum (None/Initializing/Ready) andget_init_state()API incryptpilot-coreformat()atomically writessubsystem="cryptpilot-initializing"in LUKS2 headershowcommand displaysInitializingvolumes with a warning indicatorinitcommand allows re-initialization of interrupted volumes (Initializing state)mark_volume_as_initialized()call in boot service (already present on this branch)What was NOT cherry-picked
blkid.rssubsystem field — this module was removed from this branch by prior refactoringbefore_sysroot.rsKnownSignature pattern — this file was rewritten on this branchBoth are functionally equivalent on this branch already.
🤖 Generated with Claude Code