Skip to content

Commit c0f90bd

Browse files
Update littlefs including shrinking and block count check flag
1 parent 55d0f97 commit c0f90bd

File tree

4 files changed

+3
-30
lines changed

4 files changed

+3
-30
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "littlefs"]
22
path = littlefs
3-
url = https://github.com/ARMmbed/littlefs
3+
url = https://github.com/sosthene-nitrokey/littlefs

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,3 @@ trace = []
1919
malloc = []
2020
software-intrinsics = []
2121
multiversion = []
22-
23-
unstable-disable-block-count-check = []

build.rs

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::env;
22
use std::path::PathBuf;
3-
use std::process::Command;
43

54
fn main() -> Result<(), Box<dyn std::error::Error>> {
65
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
@@ -23,30 +22,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
2322
)
2423
.expect("Failed to write lfs.h");
2524

26-
// maybe patch lfs.c to remove the mount check for the block count
27-
println!("cargo::rerun-if-changed=littlefs/lfs.c");
28-
let out_lfs_c = out_path.join("lfs.c");
29-
if cfg!(feature = "unstable-disable-block-count-check") {
30-
println!("cargo::rerun-if-changed=remove-mount-check.patch");
31-
assert!(
32-
Command::new("patch")
33-
.args([
34-
"littlefs/lfs.c",
35-
"-o",
36-
out_lfs_c.to_str().unwrap(),
37-
"remove-mount-check.patch"
38-
])
39-
.spawn()
40-
.unwrap()
41-
.wait()
42-
.unwrap()
43-
.success(),
44-
"Failed to apply patch"
45-
)
46-
} else {
47-
std::fs::copy("littlefs/lfs.c", out_path.join("lfs.c")).unwrap();
48-
}
49-
5025
let mut builder = cc::Build::new();
5126
let builder = builder
5227
.flag("-std=c99")
@@ -55,7 +30,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
5530
.flag("-DLFS_NO_ERROR")
5631
.include(&out_path)
5732
.include("littlefs")
58-
.file(out_lfs_c)
33+
.file("littlefs/lfs.c")
5934
.file("littlefs/lfs_util.c")
6035
.file("string.c");
6136

0 commit comments

Comments
 (0)