[PATCH] sandbox: remove ram buffer file when U-Boot is loaded by SPL

Simon Glass sjg at chromium.org
Sun Nov 22 00:07:52 CET 2020


On Fri, 20 Nov 2020 at 02:48, Patrick Delaunay <patrick.delaunay at st.com> wrote:
>
> Update management of "--rm_memory" sandbox's option and force
> this option when U-Boot is loaded by SPL in os_spl_to_uboot()
> and remove the ram file after reading in main() as described
> in option help message: "Remove memory file after reading".
>
> This patch avoids that the file "/tmp/u-boot.mem.XXXXXX" [created in
> os_jump_to_file() when U-Boot is loaded by SPL] is never deleted
> because state_uninit() is not called after U-Boot execution
> (CtrlC or with running pytest for example).
>
> This issue is reproduced by
> > build-sandbox_spl/spl/u-boot-spl
>   and CtrlC in U-Bot console
>
> > make qcheck
>
> One temp file is created after each SPL and U-Boot execution
> (7 tims in qcheck after test_handoff.py, test_ofplatdata.py,
>  test_spl.py execution).
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
> ---
>
>  arch/sandbox/cpu/os.c    | 5 +++++
>  arch/sandbox/cpu/start.c | 7 +++++++
>  arch/sandbox/cpu/state.c | 4 ----
>  3 files changed, 12 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list