ksud: fix dd failure
This commit is contained in:
@@ -36,17 +36,19 @@ fn do_cpio_cmd(magiskboot: &Path, workding_dir: &Path, cmd: &str) -> Result<()>
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dd<P: AsRef<Path> + std::fmt::Debug, Q: AsRef<Path> + std::fmt::Debug>(
|
fn dd<P: AsRef<Path>, Q: AsRef<Path>>(ifile: P, ofile: Q) -> Result<()> {
|
||||||
ifile: P,
|
|
||||||
ofile: Q,
|
|
||||||
) -> Result<()> {
|
|
||||||
let status = Command::new("dd")
|
let status = Command::new("dd")
|
||||||
.stdout(Stdio::null())
|
.stdout(Stdio::null())
|
||||||
.stderr(Stdio::null())
|
.stderr(Stdio::null())
|
||||||
.arg(format!("if={ifile:?}"))
|
.arg(format!("if={}", ifile.as_ref().display()))
|
||||||
.arg(format!("of={ofile:?}"))
|
.arg(format!("of={}", ofile.as_ref().display()))
|
||||||
.status()?;
|
.status()?;
|
||||||
ensure!(status.success(), "dd if={:?} of={:?} failed", ifile, ofile);
|
ensure!(
|
||||||
|
status.success(),
|
||||||
|
"dd if={:?} of={:?} failed",
|
||||||
|
ifile.as_ref(),
|
||||||
|
ofile.as_ref()
|
||||||
|
);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user