Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "littlefs"]
path = littlefs
url = https://github.com/ARMmbed/littlefs
url = https://github.com/trussed-dev/littlefs
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ trace = []
malloc = []
software-intrinsics = []
multiversion = []

unstable-disable-block-count-check = []
27 changes: 1 addition & 26 deletions build.rs
Original file line number Diff line number Diff line change
@@ -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());
Expand All @@ -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")
Expand All @@ -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");

Expand Down
2 changes: 1 addition & 1 deletion littlefs
Loading