Skip to content

Commit 088527f

Browse files
committed
remove ReadVersion command and other changes per review
1 parent 08f72fc commit 088527f

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

hubedit/src/main.rs

-24
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ pub enum Command {
4747
#[clap(short, long)]
4848
force: bool,
4949
},
50-
/// Read version and epoch values from an image.
51-
ReadVersion,
5250
/// Replaces the binary image within an archive with a different binary
5351
/// image, supplied on the command line as a raw (BIN) file.
5452
///
@@ -167,28 +165,6 @@ fn main() -> Result<()> {
167165
archive.erase_caboose()?;
168166
archive.overwrite()?;
169167
}
170-
Command::ReadVersion => {
171-
// Some images are missing an ImageHeader (old bootleby images),
172-
// or have no caboose, or have no caboose with an `EPOC` value.
173-
// The default epoch value is zero.
174-
175-
let (version, epoch) = if let Ok(caboose) = archive.read_caboose() {
176-
let version = match caboose.version() {
177-
Ok(vers) => {
178-
std::str::from_utf8(vers).unwrap_or("").to_string()
179-
}
180-
Err(_) => "".to_string(),
181-
};
182-
let epoch = caboose.epoch_u32().unwrap_or(0u32);
183-
(version.clone(), epoch)
184-
} else {
185-
// No caboose
186-
("".to_string(), 0u32)
187-
};
188-
189-
println!("Version: \"{version}\"");
190-
println!("Epoch: {epoch}");
191-
}
192168
Command::ReplaceImage { image } => {
193169
let contents = std::fs::read(&image).with_context(|| {
194170
format!("reading image file {}", image.display())

hubtools/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ impl RawHubrisImage {
361361
}
362362

363363
/// Return the image size up to but not including any signature block.
364-
pub fn image_size(&self) -> Result<u32, Error> {
364+
fn image_size(&self) -> Result<u32, Error> {
365365
let header = self.read_image_header()?;
366366
Ok(header.total_image_len)
367367
}

0 commit comments

Comments
 (0)