Add size to the initfs header

This commit is contained in:
bjorn3
2024-03-12 14:13:49 +01:00
parent 7978d794f7
commit 12ed3151f3
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -72,6 +72,7 @@ pub struct Header {
pub creation_time: Timespec,
pub inode_count: U16,
pub bootstrap_entry: U64,
pub initfs_size: U64,
}
const _: () = {
+1
View File
@@ -487,6 +487,7 @@ pub fn archive(
inode_count: state.inode_count.into(),
inode_table_offset,
bootstrap_entry: bootstrap_entry.into(),
initfs_size: state.file.metadata().context("failed to get initfs size")?.len().into(),
};
write_all_at(&*state.file, &header_bytes, header_offset, "writing header")
.context("failed to write header")?;