From 12ed3151f3df859775f327250244b483ea699edb Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Tue, 12 Mar 2024 14:13:49 +0100 Subject: [PATCH] Add size to the initfs header --- src/types.rs | 1 + tools/src/archive_common.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/types.rs b/src/types.rs index b041ac8875..6faf321db5 100644 --- a/src/types.rs +++ b/src/types.rs @@ -72,6 +72,7 @@ pub struct Header { pub creation_time: Timespec, pub inode_count: U16, pub bootstrap_entry: U64, + pub initfs_size: U64, } const _: () = { diff --git a/tools/src/archive_common.rs b/tools/src/archive_common.rs index a968bdf1e7..b7a0b250b9 100644 --- a/tools/src/archive_common.rs +++ b/tools/src/archive_common.rs @@ -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")?;