diff --git a/backhand-cli/src/bin/add.rs b/backhand-cli/src/bin/add.rs index 57a5e020..016c67ad 100644 --- a/backhand-cli/src/bin/add.rs +++ b/backhand-cli/src/bin/add.rs @@ -58,6 +58,10 @@ struct Args { /// Override mtime read from #[clap(long, required_if_eq("dir", "true"))] mtime: Option, + + /// Custom KiB padding length + #[clap(long)] + pad_len: Option, } fn main() -> ExitCode { @@ -103,6 +107,10 @@ fn main() -> ExitCode { } } + if let Some(pad_len) = args.pad_len { + filesystem.set_kib_padding(pad_len) + } + // write new file let output = File::create(&args.out).unwrap(); if let Err(e) = filesystem.write(output) { diff --git a/backhand-cli/src/bin/replace.rs b/backhand-cli/src/bin/replace.rs index dbbce0af..c3e1e16f 100644 --- a/backhand-cli/src/bin/replace.rs +++ b/backhand-cli/src/bin/replace.rs @@ -35,6 +35,10 @@ struct Args { /// Squashfs output image #[clap(short, long, default_value = "replaced.squashfs")] out: PathBuf, + + /// Custom KiB padding length + #[clap(long)] + pad_len: Option, } fn main() -> ExitCode { @@ -54,6 +58,10 @@ fn main() -> ExitCode { return ExitCode::FAILURE; } + if let Some(pad_len) = args.pad_len { + filesystem.set_kib_padding(pad_len) + } + // write new file let output = File::create(&args.out).unwrap(); filesystem.write(output).unwrap();