mirror of
https://github.com/tiann/KernelSU.git
synced 2025-02-20 11:43:32 +08:00
ksud: determine modules's size by checking partion size
This commit is contained in:
parent
4ede20ef83
commit
38dc2eb4f0
13
userspace/ksud/Cargo.lock
generated
13
userspace/ksud/Cargo.lock
generated
@ -1,6 +1,6 @@
|
|||||||
# This file is automatically @generated by Cargo.
|
# This file is automatically @generated by Cargo.
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 3
|
version = 4
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "addr2line"
|
name = "addr2line"
|
||||||
@ -591,6 +591,16 @@ dependencies = [
|
|||||||
"miniz_oxide",
|
"miniz_oxide",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "fs4"
|
||||||
|
version = "0.12.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c29c30684418547d476f0b48e84f4821639119c483b1eccd566c8cd0cd05f521"
|
||||||
|
dependencies = [
|
||||||
|
"rustix 0.38.41",
|
||||||
|
"windows-sys 0.52.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "generic-array"
|
name = "generic-array"
|
||||||
version = "0.14.7"
|
version = "0.14.7"
|
||||||
@ -806,6 +816,7 @@ dependencies = [
|
|||||||
"encoding_rs",
|
"encoding_rs",
|
||||||
"env_logger",
|
"env_logger",
|
||||||
"extattr",
|
"extattr",
|
||||||
|
"fs4",
|
||||||
"getopts",
|
"getopts",
|
||||||
"hole-punch",
|
"hole-punch",
|
||||||
"humansize",
|
"humansize",
|
||||||
|
@ -43,6 +43,7 @@ tempfile = "3.14"
|
|||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
hole-punch = { git = "https://github.com/tiann/hole-punch" }
|
hole-punch = { git = "https://github.com/tiann/hole-punch" }
|
||||||
regex-lite = "0.1"
|
regex-lite = "0.1"
|
||||||
|
fs4 = "0.12"
|
||||||
|
|
||||||
[target.'cfg(any(target_os = "android", target_os = "linux"))'.dependencies]
|
[target.'cfg(any(target_os = "android", target_os = "linux"))'.dependencies]
|
||||||
rustix = { git = "https://github.com/Kernel-SU/rustix.git", branch = "main", features = [
|
rustix = { git = "https://github.com/Kernel-SU/rustix.git", branch = "main", features = [
|
||||||
|
@ -375,7 +375,8 @@ fn _install_module(zip: &str) -> Result<()> {
|
|||||||
humansize::format_size(zip_uncompressed_size, humansize::DECIMAL)
|
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 !modules_img_exist && !modules_update_img_exist {
|
||||||
// if no modules and modules_update, it is brand new installation, we should create a new img
|
// 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
|
// create a tmp module img and mount it to modules_update
|
||||||
|
Loading…
x
Reference in New Issue
Block a user