From ec9babea7662cbe7b249fd272e313fe697824ead Mon Sep 17 00:00:00 2001 From: weishu Date: Tue, 11 Jul 2023 18:30:33 +0800 Subject: [PATCH] ksud: Specify the block size of the ext4 image as 1K, because our subsequent size calculations are based on this; some phones such as the Samsung S23, if no default value is specified, will cause unexpected errors. close #721 --- userspace/ksud/src/module.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/userspace/ksud/src/module.rs b/userspace/ksud/src/module.rs index 1711a96d..acba325c 100644 --- a/userspace/ksud/src/module.rs +++ b/userspace/ksud/src/module.rs @@ -141,7 +141,7 @@ fn grow_image_size(img: &str, extra_size: u64) -> Result<()> { humansize::format_size(target_size, humansize::DECIMAL) ); let target_size = target_size / 1024 + 1024; - + 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()) @@ -392,6 +392,8 @@ fn _install_module(zip: &str) -> Result<()> { // format the img to ext4 filesystem let result = Command::new("mkfs.ext4") + .arg("-b") + .arg("1024") .arg(tmp_module_img) .stdout(Stdio::null()) .output()?;