From 1c52fcca72b9338c1dd205520a83d1a954d3316a Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 6 Feb 2021 09:57:34 -0700 Subject: [PATCH] sandbox: Write out bloblist when exiting Sandbox provides a way to write out its emulated memory on exit. This makes it possible to pass a bloblist from one phase (e.g. SPL) to the next. However the bloblist is not closed off, so the checksum is generally invalid. Fix this by finishing up the bloblist before writing the memory file. Signed-off-by: Simon Glass --- arch/sandbox/cpu/state.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c index 4ffaf16378..f63cfd38ee 100644 --- a/arch/sandbox/cpu/state.c +++ b/arch/sandbox/cpu/state.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -398,8 +399,12 @@ int state_uninit(void) { int err; + log_info("Writing sandbox state\n"); state = &main_state; + /* Finish the bloblist, so that it is correct before writing memory */ + bloblist_finish(); + if (state->write_ram_buf) { err = os_write_ram_buf(state->ram_buf_fname); if (err) { -- 2.39.5