mirror of
https://github.com/trussed-dev/littlefs2-sys.git
synced 2026-06-20 04:16:31 -07:00
Update littlefs including shrinking and block count check flag
This commit is contained in:
committed by
sosthene-nitrokey
parent
55d0f97434
commit
1cfd35c997
+1
-1
@@ -1,3 +1,3 @@
|
||||
[submodule "littlefs"]
|
||||
path = littlefs
|
||||
url = https://github.com/ARMmbed/littlefs
|
||||
url = https://github.com/trussed-dev/littlefs
|
||||
|
||||
@@ -19,5 +19,3 @@ trace = []
|
||||
malloc = []
|
||||
software-intrinsics = []
|
||||
multiversion = []
|
||||
|
||||
unstable-disable-block-count-check = []
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
use std::process::Command;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
@@ -23,30 +22,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
)
|
||||
.expect("Failed to write lfs.h");
|
||||
|
||||
// maybe patch lfs.c to remove the mount check for the block count
|
||||
println!("cargo::rerun-if-changed=littlefs/lfs.c");
|
||||
let out_lfs_c = out_path.join("lfs.c");
|
||||
if cfg!(feature = "unstable-disable-block-count-check") {
|
||||
println!("cargo::rerun-if-changed=remove-mount-check.patch");
|
||||
assert!(
|
||||
Command::new("patch")
|
||||
.args([
|
||||
"littlefs/lfs.c",
|
||||
"-o",
|
||||
out_lfs_c.to_str().unwrap(),
|
||||
"remove-mount-check.patch"
|
||||
])
|
||||
.spawn()
|
||||
.unwrap()
|
||||
.wait()
|
||||
.unwrap()
|
||||
.success(),
|
||||
"Failed to apply patch"
|
||||
)
|
||||
} else {
|
||||
std::fs::copy("littlefs/lfs.c", out_path.join("lfs.c")).unwrap();
|
||||
}
|
||||
|
||||
let mut builder = cc::Build::new();
|
||||
let builder = builder
|
||||
.flag("-std=c99")
|
||||
@@ -55,7 +30,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
.flag("-DLFS_NO_ERROR")
|
||||
.include(&out_path)
|
||||
.include("littlefs")
|
||||
.file(out_lfs_c)
|
||||
.file("littlefs/lfs.c")
|
||||
.file("littlefs/lfs_util.c")
|
||||
.file("string.c");
|
||||
|
||||
|
||||
+1
-1
Submodule littlefs updated: d01280e649...5328ae4b2a
Reference in New Issue
Block a user