From e1fbf664e24d03fc39b538900c681a41a2dd8c88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sosth=C3=A8ne=20Gu=C3=A9don?= Date: Fri, 25 Apr 2025 15:43:56 +0200 Subject: [PATCH] Update littlefs including shrinking and block count check flag --- .gitmodules | 2 +- Cargo.toml | 2 -- build.rs | 27 +-------------------------- littlefs | 2 +- 4 files changed, 3 insertions(+), 30 deletions(-) diff --git a/.gitmodules b/.gitmodules index 0c7625c..d5e41dd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "littlefs"] path = littlefs - url = https://github.com/ARMmbed/littlefs + url = https://github.com/trussed-dev/littlefs diff --git a/Cargo.toml b/Cargo.toml index 9cb883b..c6cd5fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,5 +19,3 @@ trace = [] malloc = [] software-intrinsics = [] multiversion = [] - -unstable-disable-block-count-check = [] diff --git a/build.rs b/build.rs index 526b1f2..2c2105d 100644 --- a/build.rs +++ b/build.rs @@ -1,6 +1,5 @@ use std::env; use std::path::PathBuf; -use std::process::Command; fn main() -> Result<(), Box> { let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); @@ -23,30 +22,6 @@ fn main() -> Result<(), Box> { ) .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> { .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"); diff --git a/littlefs b/littlefs index d01280e..5328ae4 160000 --- a/littlefs +++ b/littlefs @@ -1 +1 @@ -Subproject commit d01280e64934a09ba16cac60cf9d3a37e228bb66 +Subproject commit 5328ae4b2ad95088a8079c0dfbc623df45598a88