Commit Graph

100 Commits

Author SHA1 Message Date
Sosthène Guédon 7a2887ac83 Update changelog 2023-11-15 12:01:49 +01:00
Sosthène Guédon e6c46e7ba5 Improve readability of file_name 2023-11-15 10:48:24 +01:00
Sosthène Guédon 8aa0c0db51 Add documentation 2023-11-15 10:48:23 +01:00
Sosthène Guédon dc4bd68692 Add file_name function 2023-11-15 10:48:23 +01:00
Sosthène Guédon 537712b0be Fix clippy warning 2023-11-15 10:48:23 +01:00
Sosthène Guédon c1894d4e25 path: add ancestors iterator 2023-11-15 10:48:23 +01:00
Sosthène Guédon ae57c29931 Fix deletion of root directory
This PR adds a check in the remove_dir_all method to avoid removing the root directory.
This Gives a simple fix to the case where one wants to remove all files in the filesystem,
and therefore calls remove_dir_all on `/`, which would previously fail because it can't delete the root.
2023-09-05 10:03:17 +02:00
Sosthène Guédon 8eb6b4ec48 Fix crashes when run with littlefs assertions 2023-06-23 15:37:56 +02:00
Sosthène Guédon ec304b8663 Add chunked file API 2023-06-12 11:07:14 +02:00
Sosthène Guédon 154e054329 Fix recursion handling in remove_dir_all_where
Fixes #35

`remove_dir_all_where` correctly handles the case where a file in the directory was skipped, but not if a subdirectory was skipped.
This commit fixes it
2023-06-12 10:47:18 +02:00
Sosthène Guédon b1ac5c3757 Fix clippy warnings 2023-06-12 10:47:18 +02:00
Sosthène Guédon a5f6e38a95 Run cargo clippy --fix 2023-06-12 10:47:18 +02:00
Sosthène Guédon 9fde6f06fc Run cargo fmt 2023-06-12 10:47:18 +02:00
Matt Sullivan 8019e8ad6d - Remove use-statement from previous commit.
- Add changelog entry.
2023-04-21 18:32:26 +02:00
Matt Sullivan a3ec29efba Fix typecast in Metadata::from implementation. 2023-04-21 18:32:26 +02:00
Lachezar Lechev 0a66788666 ci: add builds for more targets & update checkout
Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>
2023-04-21 18:26:30 +02:00
Lachezar Lechev 8ed5ea2e5b fix: Update urls and docs for:
- Urls to former users
- badges
- upstream release

Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>
2023-04-21 18:26:30 +02:00
Robin Krahl f906960d56 Fix macro hygiene for path! 2023-04-20 16:23:15 +02:00
Nicolas Stalder fd178ba1d4 Fix up Cargo.toml 0.4.0 2023-02-07 18:00:21 +01:00
Robin Krahl 6b02d54bcf Release v0.4.0 2023-02-07 17:59:09 +01:00
Robin Krahl ad3b40b896 Remove rust-toolchain.toml
As we fixed the lookahead buffer overflow, we no longer have to pin the
Rust version.

Fixes https://github.com/trussed-dev/littlefs2/issues/26
Fixes https://github.com/trussed-dev/littlefs2/issues/28
2023-02-07 10:01:42 +01:00
Robin Krahl 2f396cc0bc Replace LOOKAHEADWORDS_SIZE with LOOKAHEAD_SIZE
This patch replaces the LOOKAHEADWORDS_SIZE in driver::Storage (measured
in 4 bytes) with LOOKAHEAD_SIZE (measure in 8 bytes).  This makes it
impossible to set illegal values.
2023-02-07 10:01:42 +01:00
Robin Krahl aafa02e332 Fix lookahead buffer size reported to littlefs2-sys
Previously, we reported the lookahead buffer size in bytes but
littlefs2-sys expects the lookahead buffer size as a multiple of 8
bytes.  This could lead to a buffer overflow causing filesystem
corruption.  This patch fixes the reported lookahead buffer size.

Note that Storage::LOOKAHEAD_WORDS_SIZE allows users to set invalid
values (as it is measured in 4 bytes, not in 8 bytes).  Invalid values
that were previously accepted because of the wrong buffer size
calculation can now be rejected by littlefs2-sys.

This is a combination of two previous patches:
	https://github.com/trussed-dev/littlefs2/pull/19
	https://github.com/Nitrokey/littlefs2/pull/1

Fixes: https://github.com/trussed-dev/littlefs2/issues/16
2023-02-07 10:01:42 +01:00
Nicolas Stalder 7b6685771f Add negative test 2023-02-01 01:55:29 +01:00
Robin Krahl 0ed3c358b7 Support constructing const Path from str
Previously, we could simply construct a PathBuf from a str using
PathBuf::from, but not a Path.  This patch changes this by adding the
Path::from_str_with_nul method and the path! macro.  This even makes it
possible to create Path constants.
2023-02-01 01:55:29 +01:00