Skip to content

Commit

Permalink
Put debug-dump-store behind a feature-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Mar 30, 2023
1 parent 33968e5 commit 8d75a20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ clients-11 = []
clients-12 = []

test-attestation-cert-ids = []

# Command to write the filesystems to the logo
# Should not be enabled in production firmware
debug-dump-store = []
# [patch.crates-io]
# interchange = { git = "https://github.com/trussed-dev/interchange", branch = "main" }

Expand Down
5 changes: 5 additions & 0 deletions src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ impl<P: Platform> ServiceResources<P> {

// This is now preferably done using littlefs-fuse (when device is not yet locked),
// and should be removed from firmware completely
#[cfg(feature = "debug-dump-store")]
Request::DebugDumpStore(_request) => {

info_now!(":: PERSISTENT");
Expand Down Expand Up @@ -342,6 +343,10 @@ impl<P: Platform> ServiceResources<P> {

}

#[cfg(not(feature = "debug-dump-store"))]
Request::DebugDumpStore(_request) => Err(Error::RequestNotAvailable),


Request::ReadDirFirst(request) => {
let maybe_entry = match filestore.read_dir_first(&request.dir, request.location, request.not_before_filename.as_ref())? {
Some((entry, read_dir_state)) => {
Expand Down

0 comments on commit 8d75a20

Please sign in to comment.