Update littlefs2 to v0.5.0

This commit is contained in:
Robin Krahl
2024-10-14 15:54:45 +02:00
parent f66f5263db
commit 599d205e47
4 changed files with 12 additions and 9 deletions
+4 -4
View File
@@ -15,7 +15,8 @@ cbor-smol = { version = "0.5.0", features = ["heapless-v0-7", "heapless-bytes-v0
ctaphid-dispatch = "0.1"
delog = "0.1"
iso7816 = "0.1"
littlefs2 = "0.4"
littlefs2 = { version = "0.5", optional = true }
littlefs2-core = { version = "0.1", features = ["heapless-bytes03"] }
serde = { version = "1.0.180", default-features = false }
strum_macros = "0.25.2"
trussed = "0.1"
@@ -39,11 +40,10 @@ log-warn = []
log-error = []
# Utils to test migration
migration-tests = []
migration-tests = ["dep:littlefs2"]
[patch.crates-io]
ctaphid-dispatch = { git = "https://github.com/trussed-dev/ctaphid-dispatch.git", rev = "57cb3317878a8593847595319aa03ef17c29ec5b" }
littlefs2 = { git = "https://github.com/trussed-dev/littlefs2.git", rev = "ebd27e49ca321089d01d8c9b169c4aeb58ceeeca" }
trussed = { git = "https://github.com/Nitrokey/trussed.git", tag = "v0.1.0-nitrokey.18" }
trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "046478b7a4f6e2315acf9112d98308379c2e3eee" }
trussed-manage = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "manage-v0.1.0" }
trussed-se050-manage = { git = "https://github.com/Nitrokey/trussed-se050-backend.git", tag = "se050-manage-v0.1.0" }
+5 -2
View File
@@ -5,7 +5,7 @@ use core::{convert::TryInto, marker::PhantomData, time::Duration};
use ctaphid_dispatch::app::{self as hid, Command as HidCommand, Message};
use ctaphid_dispatch::command::VendorCommand;
#[cfg(feature = "factory-reset")]
use littlefs2::path::PathBuf;
use littlefs2_core::PathBuf;
use serde::Deserialize;
use trussed::store::Store;
use trussed::try_syscall;
@@ -449,6 +449,10 @@ where
response.push(FACTORY_RESET_APP_FAILED_PARSE).ok();
return Ok(());
};
let Ok(path) = PathBuf::try_from(client) else {
response.push(FACTORY_RESET_APP_FAILED_PARSE).ok();
return Ok(());
};
let Some((_, flag)) = self.config().reset_client_id(client) else {
response.push(FACTORY_RESET_APP_NOT_ALLOWED).ok();
@@ -460,7 +464,6 @@ where
response.push(FACTORY_RESET_NOT_CONFIRMED).ok();
return Ok(());
}
let path = PathBuf::from(client);
match self.config.reset_client_config(client) {
crate::config::ResetConfigResult::Changed => {
+1 -1
View File
@@ -5,7 +5,7 @@ use core::{
};
use cbor_smol::{cbor_deserialize, cbor_serialize_to};
use littlefs2::{path, path::Path};
use littlefs2_core::{path, Path};
use serde::{de::DeserializeOwned, Serialize};
use strum_macros::FromRepr;
use trussed::{
+2 -2
View File
@@ -1,11 +1,11 @@
use littlefs2::object_safe::DynFilesystem;
use littlefs2_core::DynFilesystem;
#[derive(Debug)]
pub struct Migrator {
/// The function performing the migration
///
/// First argument is the Internal Filesystem, second argument is the External
pub migrate: fn(&dyn DynFilesystem, &dyn DynFilesystem) -> Result<(), littlefs2::io::Error>,
pub migrate: fn(&dyn DynFilesystem, &dyn DynFilesystem) -> Result<(), littlefs2_core::Error>,
/// The version of the storage for which the migration needs to be run
pub version: u32,