From 16c5aba4ff00341e289ce3d0ed44b7b8f78fc719 Mon Sep 17 00:00:00 2001 From: weishu Date: Mon, 29 Jan 2024 15:51:54 +0800 Subject: [PATCH] ksud: fix dd failure --- userspace/ksud/src/boot_patch.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/userspace/ksud/src/boot_patch.rs b/userspace/ksud/src/boot_patch.rs index caf0cbdc..c665cb81 100644 --- a/userspace/ksud/src/boot_patch.rs +++ b/userspace/ksud/src/boot_patch.rs @@ -36,17 +36,19 @@ fn do_cpio_cmd(magiskboot: &Path, workding_dir: &Path, cmd: &str) -> Result<()> Ok(()) } -fn dd + std::fmt::Debug, Q: AsRef + std::fmt::Debug>( - ifile: P, - ofile: Q, -) -> Result<()> { +fn dd, Q: AsRef>(ifile: P, ofile: Q) -> Result<()> { let status = Command::new("dd") .stdout(Stdio::null()) .stderr(Stdio::null()) - .arg(format!("if={ifile:?}")) - .arg(format!("of={ofile:?}")) + .arg(format!("if={}", ifile.as_ref().display())) + .arg(format!("of={}", ofile.as_ref().display())) .status()?; - ensure!(status.success(), "dd if={:?} of={:?} failed", ifile, ofile); + ensure!( + status.success(), + "dd if={:?} of={:?} failed", + ifile.as_ref(), + ofile.as_ref() + ); Ok(()) }