feat: 支持在线升级功能

This commit is contained in:
mofeng-git
2026-02-11 19:41:19 +08:00
parent 60b294e0ab
commit 934dc48208
36 changed files with 945 additions and 100 deletions

View File

@@ -328,9 +328,7 @@ impl VentoyDrive {
let image = match VentoyImage::open(&path) {
Ok(img) => img,
Err(e) => {
let _ = rt.block_on(tx.send(Err(std::io::Error::other(
e.to_string(),
))));
let _ = rt.block_on(tx.send(Err(std::io::Error::other(e.to_string()))));
return;
}
};
@@ -340,9 +338,7 @@ impl VentoyDrive {
// Stream the file through the writer
if let Err(e) = image.read_file_to_writer(&file_path_owned, &mut chunk_writer) {
let _ = rt.block_on(tx.send(Err(std::io::Error::other(
e.to_string(),
))));
let _ = rt.block_on(tx.send(Err(std::io::Error::other(e.to_string()))));
}
});
@@ -545,12 +541,10 @@ mod tests {
.output()?;
if !output.status.success() {
return Err(std::io::Error::other(
format!(
"xz decompress failed: {}",
String::from_utf8_lossy(&output.stderr)
),
));
return Err(std::io::Error::other(format!(
"xz decompress failed: {}",
String::from_utf8_lossy(&output.stderr)
)));
}
std::fs::write(dst, &output.stdout)?;