ksud: Add cli for fast copy sparse file

This commit is contained in:
weishu
2024-01-30 12:49:24 +08:00
parent 946fb6f999
commit cce423a2f6

View File

@@ -112,6 +112,13 @@ enum Debug {
Mount, Mount,
/// Copy sparse file
Xcp {
/// source file
src: String,
/// destination file
dst: String,
},
/// For testing /// For testing
Test, Test,
} }
@@ -277,6 +284,10 @@ pub fn run() -> Result<()> {
} }
Debug::Su => crate::ksu::grant_root(), Debug::Su => crate::ksu::grant_root(),
Debug::Mount => event::mount_systemlessly(defs::MODULE_DIR), Debug::Mount => event::mount_systemlessly(defs::MODULE_DIR),
Debug::Xcp { src, dst } => {
utils::copy_sparse_file(&src, &dst)?;
Ok(())
}
Debug::Test => todo!(), Debug::Test => todo!(),
}, },