From 0af25af1beb0e3a827bf14781f3fdc4d53334af7 Mon Sep 17 00:00:00 2001 From: weishu Date: Thu, 17 Aug 2023 22:05:49 +0800 Subject: [PATCH] ksud: exposed the command stdout/stderr to log --- userspace/ksud/src/module.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/userspace/ksud/src/module.rs b/userspace/ksud/src/module.rs index ff7a7bf1..dc8a4c17 100644 --- a/userspace/ksud/src/module.rs +++ b/userspace/ksud/src/module.rs @@ -140,8 +140,7 @@ fn get_minimal_image_size(img: &str) -> Result { fn check_image(img: &str) -> Result<()> { let result = Command::new("e2fsck") .args(["-yf", img]) - .stdout(Stdio::null()) - .stderr(Stdio::null()) + .stdout(Stdio::piped()) .status() .with_context(|| format!("Failed to exec e2fsck {img}"))?; let code = result.code(); @@ -172,7 +171,7 @@ fn grow_image_size(img: &str, extra_size: u64) -> Result<()> { info!("resize image to {target_size}K, minimal size is {minimal_size}K"); let result = Command::new("resize2fs") .args([img, &format!("{target_size}K")]) - .stdout(Stdio::null()) + .stdout(Stdio::piped()) .status() .with_context(|| format!("Failed to exec resize2fs {img}"))?; ensure!(result.success(), "Failed to resize2fs: {}", result); @@ -402,7 +401,7 @@ fn _install_module(zip: &str) -> Result<()> { .arg("-b") .arg("1024") .arg(tmp_module_img) - .stdout(Stdio::null()) + .stdout(Stdio::piped()) .output()?; ensure!( result.status.success(),