forked from containers/composefs-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With this change, we create the erofs filesystem for ourselves, instead of using the external mkcomposefs CLI. This currently produces a different output than the output of mkcomposefs. We're planning to make changes here to make the output more similar to mkcomposefs while pursuing changes in mkcomposefs to make it more similar to our format. This work is being tracked as an issue in containers/composefs#198 and a first pull request in containers/composefs#410 . Closes containers#56 Signed-off-by: Allison Karlitskaya <[email protected]>
- Loading branch information
1 parent
8f9c3ac
commit 600e69f
Showing
16 changed files
with
2,446 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use std::{fs::File, io::Read, path::PathBuf}; | ||
|
||
use clap::Parser; | ||
|
||
use composefs::erofs::debug::debug_img; | ||
|
||
/// Produce a detailed dump of an entire erofs image | ||
/// | ||
/// The output is in a diff-friendly format, such that every distinct image produces a distinct | ||
/// output (ie: an injective mapping). This is useful for determining the exact ways in which two | ||
/// different images are different. | ||
#[derive(Parser)] | ||
struct Args { | ||
/// The path to the image file to dump | ||
image: PathBuf, | ||
} | ||
|
||
fn main() { | ||
let args = Args::parse(); | ||
let mut image = File::open(args.image).expect("Opening file"); | ||
|
||
let mut data = vec![]; | ||
image.read_to_end(&mut data).expect("read_to_end() failed"); | ||
debug_img(&mut std::io::stdout(), &data).unwrap(); | ||
} |
Oops, something went wrong.