Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resolver = "2"
[workspace.package]
authors = ["Kun Lai <laikun@linux.alibaba.com>"]
edition = "2021"
version = "0.3.3"
version = "0.3.4"

[workspace.dependencies]
again = "0.1.2"
Expand Down
33 changes: 15 additions & 18 deletions cryptpilot-crypt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,27 +104,24 @@ Example table output:

Example JSON output:
```json
{
"volumes": [
{
"volume": "data0",
"volume_path": "/dev/mapper/data0",
"underlay_device": "/dev/nvme1n1p1",
"key_provider": "otp",
"extra_options": {
"auto_open": true,
"makefs": "ext4",
"integrity": true
},
"status": "ReadyToOpen",
"description": "Volume 'data0' uses otp key provider (temporary volume) and is ready to open"
}
]
}
[
{
"volume": "data0",
"volume_path": "/dev/mapper/data0",
"underlay_device": "/dev/nvme1n1p1",
"key_provider": "otp",
"extra_options": {
"auto_open": true,
"makefs": "ext4",
"integrity": true
},
"status": "ReadyToOpen",
"description": "Volume 'data0' uses otp key provider (temporary volume) and is ready to open"
}
]
```

JSON output fields:
- `volumes`: Array of volume status objects
- `volume`: Volume name
- `volume_path`: Path to the decrypted volume (always shows the mapper path)
- `underlay_device`: Underlying encrypted block device path
Expand Down
33 changes: 15 additions & 18 deletions cryptpilot-crypt/README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,27 +104,24 @@ cryptpilot-crypt show data0 --json

JSON 输出示例:
```json
{
"volumes": [
{
"volume": "data0",
"volume_path": "/dev/mapper/data0",
"underlay_device": "/dev/nvme1n1p1",
"key_provider": "otp",
"extra_options": {
"auto_open": true,
"makefs": "ext4",
"integrity": true
},
"status": "ReadyToOpen",
"description": "Volume 'data0' uses otp key provider (temporary volume) and is ready to open"
}
]
}
[
{
"volume": "data0",
"volume_path": "/dev/mapper/data0",
"underlay_device": "/dev/nvme1n1p1",
"key_provider": "otp",
"extra_options": {
"auto_open": true,
"makefs": "ext4",
"integrity": true
},
"status": "ReadyToOpen",
"description": "Volume 'data0' uses otp key provider (temporary volume) and is ready to open"
}
]
```

JSON 输出字段说明:
- `volumes`:卷状态对象数组
- `volume`:卷名称
- `volume_path`:解密后的卷路径(始终显示 mapper 路径)
- `underlay_device`:底层加密块设备路径
Expand Down
9 changes: 1 addition & 8 deletions cryptpilot-crypt/src/cmd/show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ pub struct ShowVolume {
status: VolumeStatus,
}

/// Collection of volume statuses for JSON output
#[derive(Serialize)]
struct VolumesCollection {
volumes: Vec<ShowVolume>,
}

impl ShowVolume {
/// Build volume status from config
async fn from_config(volume_config: &VolumeConfig) -> Self {
Expand Down Expand Up @@ -218,8 +212,7 @@ impl PrintAsJson for [VolumeConfig] {
volumes.push(ShowVolume::from_config(volume_config).await);
}

let volumes_collection = VolumesCollection { volumes };
let json = serde_json::to_string_pretty(&volumes_collection)?;
let json = serde_json::to_string_pretty(&volumes)?;
println!("{}", json);

Ok(())
Expand Down
12 changes: 10 additions & 2 deletions cryptpilot-crypt/tests/volume_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ pub async fn run_test_on_volume(config_str: &str, use_external_suite: bool) -> R
Some(MakeFsType::Swap) => {
// Just Open it and checking
open_then(&volume_config, |volume_config| async move {
assert!(!cryptpilot::fs::mkfs::is_empty_disk(&volume_config.volume_path()).await?);
if !matches!(volume_config.extra_config.integrity, Some(true)) {
assert!(
!cryptpilot::fs::mkfs::is_empty_disk(&volume_config.volume_path()).await?
);
}
Ok(())
})
.await?;
Expand Down Expand Up @@ -215,7 +219,11 @@ pub async fn run_test_on_volume(config_str: &str, use_external_suite: bool) -> R
Some(_) => {
// Just Open it and checking
open_then(&volume_config, |volume_config| async move {
assert!(!cryptpilot::fs::mkfs::is_empty_disk(&volume_config.volume_path()).await?);
if !matches!(volume_config.extra_config.integrity, Some(true)) {
assert!(
!cryptpilot::fs::mkfs::is_empty_disk(&volume_config.volume_path()).await?
);
}
Ok(())
})
.await?;
Expand Down
8 changes: 7 additions & 1 deletion cryptpilot.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%define release_num 1

Name: cryptpilot
Version: 0.3.3
Version: 0.3.4
Release: %{release_num}%{?dist}
Summary: Full-disk encryption and data protection tool for confidential computing
Group: Applications/System
Expand Down Expand Up @@ -271,6 +271,12 @@ fi


%changelog
* Tue Feb 03 2026 Kun Lai <laikun@linux.alibaba.com> - 0.3.4-1
- fix: correct is_empty_disk logic and streamline filesystem creation
- fix: replace makefs_if_empty with force_mkfs for reliable volume initialization
- fix: remove redundant filesystem checks relying on LUKS2 initialization status
- feat: unify volume status reporting with structured enum and description

* Mon Feb 02 2026 Kun Lai <laikun@linux.alibaba.com> - 0.3.3-1
- feat(luks2): implement atomic initialization check with subsystem

Expand Down
Loading