-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a caboose EPOC
tag used by RoT update_server for rollback protection
#33
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "hubtools" | ||
version = "0.4.6" | ||
version = "0.4.7" | ||
edition = "2021" | ||
rust-version = "1.66" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,10 +72,7 @@ fn add_image_header(path: PathBuf) -> Result<Vec<u8>, Error> { | |
let offset = header_offset(&elf)?; | ||
drop(elf); | ||
|
||
let header = header::ImageHeader { | ||
magic: 0x64_CE_D6_CA, | ||
total_image_len: len as u32, | ||
}; | ||
Comment on lines
-75
to
-78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was an intentional choice when this was added to only add the magic and length fields to save space. It feels like a step in the wrong direction to add the full header back. |
||
let header = header::ImageHeader::new(len as usize); | ||
|
||
header | ||
.write_to_prefix(&mut f[(offset as usize)..]) | ||
|
@@ -89,6 +86,7 @@ pub fn bootleby_to_archive( | |
board: String, | ||
name: String, | ||
gitc: String, | ||
epoc: Option<u32>, | ||
lzrd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) -> Result<Vec<u8>, Error> { | ||
let f = add_image_header(path)?; | ||
|
||
|
@@ -103,8 +101,11 @@ pub fn bootleby_to_archive( | |
name = "{}" | ||
board = "{}" | ||
chip = "lpc55" | ||
epoch = {} | ||
"#, | ||
name, board | ||
name, | ||
board, | ||
epoc.unwrap_or(0u32) | ||
); | ||
|
||
archive.add_file("elf/kernel", &f)?; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be optional here, or should it be a bare
u32
(with responsibility for deciding on a default value given to the caller)?