From 3fc35732a93d3b6de6bf07d87c4d3791acb52256 Mon Sep 17 00:00:00 2001 From: Kun Lai Date: Tue, 3 Feb 2026 14:19:56 +0800 Subject: [PATCH 1/2] fix: remove volumes field introduced in 3c62c78 Signed-off-by: Kun Lai --- cryptpilot-crypt/README.md | 33 ++++++++++++-------------- cryptpilot-crypt/README_zh.md | 33 ++++++++++++-------------- cryptpilot-crypt/src/cmd/show.rs | 9 +------ cryptpilot-crypt/tests/volume_tests.rs | 12 ++++++++-- 4 files changed, 41 insertions(+), 46 deletions(-) diff --git a/cryptpilot-crypt/README.md b/cryptpilot-crypt/README.md index caab07a..d0b1ed4 100644 --- a/cryptpilot-crypt/README.md +++ b/cryptpilot-crypt/README.md @@ -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 diff --git a/cryptpilot-crypt/README_zh.md b/cryptpilot-crypt/README_zh.md index bd8eec6..6f91635 100644 --- a/cryptpilot-crypt/README_zh.md +++ b/cryptpilot-crypt/README_zh.md @@ -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`:底层加密块设备路径 diff --git a/cryptpilot-crypt/src/cmd/show.rs b/cryptpilot-crypt/src/cmd/show.rs index c8925a8..6940db4 100644 --- a/cryptpilot-crypt/src/cmd/show.rs +++ b/cryptpilot-crypt/src/cmd/show.rs @@ -89,12 +89,6 @@ pub struct ShowVolume { status: VolumeStatus, } -/// Collection of volume statuses for JSON output -#[derive(Serialize)] -struct VolumesCollection { - volumes: Vec, -} - impl ShowVolume { /// Build volume status from config async fn from_config(volume_config: &VolumeConfig) -> Self { @@ -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(()) diff --git a/cryptpilot-crypt/tests/volume_tests.rs b/cryptpilot-crypt/tests/volume_tests.rs index 2ed8928..d794a48 100644 --- a/cryptpilot-crypt/tests/volume_tests.rs +++ b/cryptpilot-crypt/tests/volume_tests.rs @@ -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?; @@ -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?; From 946a4311ac763674f2ac98289cf0d9e9979e4597 Mon Sep 17 00:00:00 2001 From: Kun Lai Date: Tue, 3 Feb 2026 00:03:37 +0800 Subject: [PATCH 2/2] chore: bump version to 0.3.4 Signed-off-by: Kun Lai --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- cryptpilot.spec | 8 +++++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a1f980e..1c51849 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -878,7 +878,7 @@ dependencies = [ [[package]] name = "cryptpilot" -version = "0.3.3" +version = "0.3.4" dependencies = [ "again", "anyhow", @@ -943,7 +943,7 @@ dependencies = [ [[package]] name = "cryptpilot-crypt" -version = "0.3.3" +version = "0.3.4" dependencies = [ "anyhow", "async-trait", @@ -975,7 +975,7 @@ dependencies = [ [[package]] name = "cryptpilot-fde" -version = "0.3.3" +version = "0.3.4" dependencies = [ "anyhow", "async-trait", @@ -1009,7 +1009,7 @@ dependencies = [ [[package]] name = "cryptpilot-verity" -version = "0.3.3" +version = "0.3.4" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index ea156cd..feef7e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ resolver = "2" [workspace.package] authors = ["Kun Lai "] edition = "2021" -version = "0.3.3" +version = "0.3.4" [workspace.dependencies] again = "0.1.2" diff --git a/cryptpilot.spec b/cryptpilot.spec index 4e5de88..628ea85 100644 --- a/cryptpilot.spec +++ b/cryptpilot.spec @@ -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 @@ -271,6 +271,12 @@ fi %changelog +* Tue Feb 03 2026 Kun Lai - 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 - 0.3.3-1 - feat(luks2): implement atomic initialization check with subsystem