ksud: determine modules's size by checking partion size

This commit is contained in:
weishu
2025-02-17 21:05:13 +08:00
parent 4ede20ef83
commit 38dc2eb4f0
3 changed files with 15 additions and 2 deletions

View File

@@ -375,7 +375,8 @@ fn _install_module(zip: &str) -> Result<()> {
humansize::format_size(zip_uncompressed_size, humansize::DECIMAL)
);
let sparse_image_size = 1 << 40; // 1T
let data_vfs = fs4::statvfs("/data").with_context(|| "Failed to stat /data".to_string())?;
let sparse_image_size = data_vfs.total_space();
if !modules_img_exist && !modules_update_img_exist {
// if no modules and modules_update, it is brand new installation, we should create a new img
// create a tmp module img and mount it to modules_update